Albert Rosa It's not what you say it's how you say it

3Apr/120

Faster Native Android Development with Roboguice

No Gravatar

To this date all of the applications I have release and demoed have been written entirely from scratch using no 3rd party libraries and used a full Test Driven Development pattern that I'm used to ( write it, run it, works Ok, don't work Fix it).  Personally I do recommend developers who are starting with android development to do so without any assistance with Roboguice, just so you can see what it actually entails and what roboguice actually does for you.

So Roboguice, you are wonder what it is, well its an injection based library for android. I have converted one of my prototypes to use roboguice and I must say its much cleaner than before but there isn't much of a difference in performance so it fits in just right. It's fairly simple to follow and use, here's the link to robo guice ( http://code.google.com/p/roboguice/ ) and with that you will also need to install guice ( http://code.google.com/p/google-guice/ ).  Roboguice extends guice for Android development. Again Guice is a injection framework for java 5 and above.

I do recommend the use of these libraries for all application development for ease of use and improvement in code read-ability. Give it a shot and see how it compares to your previous works of art.

Share
Filed under: Android, Resource No Comments
3Apr/120

Android simple Game tutorial

No Gravatar

I have been thinking of a way to expand my knowledge of game development towards Android, so far I've created small simple games that respond to the normal android lifecycle and no real Game Mechanics.

I have found a few resources on line that started tutorials around some Action Type of game development I just wanted to share the knowledge:

http://www.javacodegeeks.com/2011/07/android-game-development-create-project.html

 

Share
3Apr/120

Android how to get installed package information

No Gravatar

It's been a while since I've had a chance to actually make some post or even check on the blog itself. Sorry it's taken so long but it's been a long road to get to where I am now, and still a road a head.  I've been developing Android apps now for a little over a year I believe not too sure but feels like more.

Currently I have two apps out in the market which both need major love in order to work correctly on all devices. One thing that I've been trying to do is to notify the user of a new version of the application being release into the market. I know that the Android Market now called 'PLAY" does this automatically but I want to notify them that a new better version is out.

It took some time to figure out the best solution for this but I have found one. Bellow are the steps and a small piece of code to get the version installed in the application.

Solutions:

The best solutions I have for this problem is to host an xml file or json file somewhere in my server containing the package name, the version number, version name, a what's new details and a link to download (the link isn't entirely necessary).

Once I have that file uploaded, I begin my android coding.

First I want to get the current installment the user has, I search all over stack over flow ( wasn't that hard to find once you have the correct key terms ;-) )  the code is as follows

try {
            String pkg = mContext.getPackageName();
            mVersionNumber = mContext.getPackageManager().getPackageInfo(pkg, 0).versionName;
        } catch (NameNotFoundException e) {
            mVersionNumber = "?";
        }

Now here we have versionName but it can easily be versionNumber which return an Integer (best for me)

after that we just pull down the xml parse and get the versionNumber compare and then display the information if and only if the version on the website is the latest version compared to the installed one.

How you actually implement it is completely up to you.

Share

Albert Rosa is using WP-Gravatar