Monday, June 4, 2012

Appreciation Month!

It is Phandroid's Developer Appreciation month! They will have contests, giveaways and generals stuffs. One of said giveaways is a ticket to Google I/O: Only the most coveted conference for Chrome, Android and all things Google. I would relish in the chance to be able to attend I/O and meet more developers and learn even more about Android. Part of the contest is to spread awareness of Phandroid's Appreciation Month. So here I am trying to spread the word. Good luck to all the entrants all hopefully I'll see my fellow developers at I/O at the end of the 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

Layout XML files are a huge part of Android. Layouts in general really, because anything you design in XML you can create in raw JAVA code as well, but let's face it, XML layouts make everyone's lives easier. According to Romain Guy the best layouts are flat (not a lot of nested widgets). What I see most often coming from new android devs (and I've done it before too) is something similar to this:

Friday, February 24, 2012

Loading, Loading, Loading...

Keep that train a' 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!
So a few years ago I made a Red Velvet Cake for my girlfriend (aka The Panda) for her birthday. I am not a huge fan of chocolate cakes, but this one came out nice and moist and quite delicious. The best part of this cake was the icing, which was NOT cream cheese based. I don't care how your grandmother, who may have even invented the recipe, made the icing, cream cheese icing has no place on anything.

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

After using Eclipse, like all new android developers, for quite some time I got very used to the process of clicking GO and having Eclipse compile, package, install and then launch my android app. The latest ADT build did screw up the build output though, so if you had it set to verbose it would crash while trying to build. I enjoy having a verbose build, I like seeing all the steps.

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've officially moved this site to Blogger, since most everything else I do is hosted by Google, figured this one can be too. I am working on a major release for the MPG Calculator, and hope to have some good code snippets to post about migrating an App to fragments, including action bar support, implementing loaders and designing for tablets. I hope to also add some reviews for some of my favorite apps.

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 :)