This is my blog for my ventures into Android and Cooking. I like to code, and cook, and currently do neither for a living. I hope to actually post more often, but that often never works out.
Monday, June 4, 2012
Appreciation Month!
Tuesday, May 1, 2012
Do that Back Up Thing
One thing I really hate is when I play through most of a game, and then something happens where I either update my device's OS or have to reset it to factory settings and ALL of my game progress is lost. This can be easily prevented, and is not only applicable to games! Any app that has user specific data should be utilizing the Android Backup Service APIs to allow a user to have their information backed up to the cloud.
While most devices support some backup service, it's not guaranteed to be Google's backup service. However, you only need to register for Google's service. If some devices uses a different service they will have all the framework for it done internally. Also, you do not need to do anything special for devices that do not support any backup service, as your BackupAgent
will just never be run on those devices.
Wednesday, March 7, 2012
Relative-ly Easy
Friday, February 24, 2012
Loading, Loading, Loading...
With the Introduction of Android 3.0 Honeycomb, came a lot of new features, but one I really have found useful is the implementation of Loaders. Loaders provide the basis for loading data in the background, weather it is from an SQLite Database, Images from a webservice or just a shit-load of items into a list a Loader's are the way to go!
While only a mere 4.4% of Android devices are on 3.0 or higher (as of Feb 1st 2012), Loaders were added to the Android Compatibility Library provides support all the way back to 1.6 (as does Jake Whorton's Action Bar Sherlock library). That's right, support all the way back to DONUT! (Yum) Not only are they super useful, but they are super easy to use. Here's how to go about it:
Thursday, February 16, 2012
Velvety Red
Not the cleanest slice, but still yummy! |
The reason I'm writing about this recipe today is because I made another Red Velvet Cake for my sister's birthday, which wasn't actually red because I had no food coloring. My icing didn't come out quite as good this time around because of the butter I was using (there is NO substitute for real butter when baking) but it was still quite good.
Saturday, February 4, 2012
Ant Build, Install and LAUNCH
Well, after my latest OS Re-Install I decided to give IntelliJ IDEA a go. I liked eclipse, but I must say that IntelliJ's Perforce integration is much better, and I like they way it separates different projects. I'm still getting used to it, but I quite like it. However, often times I would try to launch my app and IntelliJ would compile, package and then just sit there. There was a background task running that had a full progress bar and output of "Packaging Android Resources" or something like that. IntelliJ also has no verbose build output for android compiling, which is quite frustrating.
I've been wanting to learn more with Ant anyway, so I decided to just start building with the command line. Here's a piece of advice if you're using Intellij and going to build with Ant... do NOT use the "Generate And Build... option. The file it generates does will compile everything fine, but it won't package it into your apk for you. Not sure it converted your classes to dex either. So, to get your build.xml file for Ant, use the command:
android update project -p <path to project>
This will create your build.xml file as well as multiple properties files. local.properties contains properties to JDK and the Android SDK, and you can put anything else that is specific to your machine here. ant.properties contains any properties you want to adjust for the project and can be added to a SCM system without worrying about local machine settings. The last file, project.properties, is generated from reading your AndroidManifest.xml file, and will be re-generated, so don't modify it!
This was working well except for one thing... The "ant debug install" command would build my project, package my apk with my debug key and install it to my device. It would not however launch my Launcher activity. So in my build.xml file I added a custom target, launch, which depends on install, to scan the xml file for the package and name of the LAUNCHER activity and start it using adb.
Wednesday, January 25, 2012
New Design, New Host and New Topics!
I have also decided that I am also going to post about food. Whether it be a recipe my amazing girlfriend and I come up with, something we adapted from somewhere else or just something we'd like to try.
I hope you find something useful from my ramblings, either code or food :)