Archive for the ‘Mobile’ Category

Planet in a Bottle Reaches 200k Downloads, Updates to Come

Friday, March 25th, 2011

I just wanted to thank everyone for playing all my games, but especially Planet in a Bottle. I woke up and refreshed my developer console this morning to show 200,445 total downloads for the game. I really never thought folks would be this interested in my humble game, and while it’s no Angry Birds, I’m still proud of how well it’s done in the past year. So, thank you to all of the fans!

In honor of this milestone, I am working on some updates that will include some bug fixes, graphics updates, and a couple surprises I think you will like. Look for it in the next couple days.

Will Someone Please Make the Kogan Agora Android Phone?

Tuesday, January 11th, 2011

Kogan Agora Phone

I’ve decided to rant a little on my frustrations with Android.  Don’t get me wrong, I’ve been a die-hard fan and developer since Android was announced, and I have owned and loved several Android devices, but I think there are still some problems with the handset makers.  At CES this year it seemed every phone announced was an Android phone.  ”Awesome” you might say, and they are, with the top-of-the line processors and screens and all. However, THEY ARE ALL THE EXACT SAME PHONE as far as the user’s overall experience is concerned (with exception of the Motorola Atrix 4G, and its crazy netbook hybrid technology).  They are all about the same size and shape with similar sized full, portrait screens, and fast processors.  Where is the variation of form factors? Android is flexible enough to easily support many form factors, screen sizes, devices.  It’s being installed in other devices such as tablets, TV’s, and even Refrigerators, so why not make some crazy, sleek, awesome form factor phones?

You may remember around this time two years ago that the Kogan Agora (Planning to be the second Android phone EVER) ended up being delayed indefinitely.  While this phone was not the hottest phone possible with a resistive touch display, mediocre processor, and limited features, I was a fan immediately after gawking at the first renderings.  Also, as a long-time Blackberry user, I loved the position of the hardware keyboard.  Furthermore, this phone represented the original idea of the Android platform – that it was flexible enough to install on a wide range of mobile platforms and form factors.

Two years have gone by, and I still don’t see my phone – the one that fits me like a well fitted pair of Jeggings.  You may be saying “What about the Droid Pro, or the Motorola Charm?” While steps in the right direction, these devices show the chunky design practices of Motorola (also not a fan of the BLUR user interface), and in my opinion, they would not be able to compete with the sleek corners and glossy smooth finish of the proposed Agora.

So is it the market demand that is driving every Android handset maker to release the same phone?  Is it the platform (while advertised as easy and open) limiting the hardware as far as a different screen size and orientation?  In any case I am disappointed in the lack of innovation of the Android handset selection currently on the market.

Disable Pre-Scaling of Android Image Resources

Monday, November 15th, 2010

As more Android powered tablets are released and announced, more developers should be making sure that their applications are optimized for them. In Android this means firstly stating that the application can handle any screen size with the following code.

<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true" />

Place this in your application’s AndroidManifest.xml file inside the <Application> tags.

However, this didn’t solve all my problems. While enabling my application to run full-screen on tablets without a big black border, it did some funky things with my image sizing. To accomodate large displays Android automatically scales Bitmap images to the display’s dpi. If you are using pixels for placement and sizing of images, like me, this can really screw up the way your app looks.

Solution

Drawable resources are stored in /res/drawable. However there are several other drawable directories you can use to support different things. I just wanted to disable scaling altogether. No matter what dpi the screen is, I want to draw my Bitmap at it’s native size. To do this, place all of these images in the /res/drawable-nodpi directory. Any resources in this directory will never be scaled. You will not have to change anything in your code as the Android API automatically checks this directory for the image.

Learn more on the Android developer guide: Resource directory qualifiers for screen size and density

Adam Gates Stealing Games and Hurting Indie Devs

Saturday, October 23rd, 2010

Several people have brought to my attention that the developer Adam Gates has reverse engineered one of my games and rereleased it under his own developer name and AdMob ID. Investigating further, I found his other apps all seem to be rip-offs as well. I know that there are solutions to protect application published in the Android Market, but I have chosen not to protect my apps with copy protection or Google’s licensing service because I would like people to have the freedom to share my games however they want. However, it saddens me to say that this situation may give me no choice but to lock them up as much as possible.

I know that independent Android game developers love what they do. It’s not for the money, but ideally, we would all make enough to support ourselves fully from these games enabling us to continue to produce fun and innovative games. I would hate to see this problem go unchecked and keep hurting this market.

So, if you can, rate his games low and comment that they are in direct copyright violation of original games. Also, please send an email to Google to try to raise awareness to this issue and the harm it is causing to good developers.

[Update]
Google has removed the violating app. However, it looks like he still has plenty of rip-offs still available. How long until Google will shut this guy down?

Other victims of Adam Gates:
http://blog.electricgoat.net/2010/09/stealing-games-to-make-money/
http://blog.electricgoat.net/2010/09/is-google-doing-any-cleanup-of-the-android-market/
http://groups.google.com/group/android-developers/browse_thread/thread/b493c24fbe9745a1/d0046c876742e089

SQLite Batch Transactions

Thursday, August 26th, 2010

Just wanted to give props to this guy, circle. He gave an awesome tip about doing many inserts into a SQLite database. Instead of having each statement be treated as its own transaction, group them into one big transaction to cut down on overhead.

Android App Updates: Get to the Top of the “Just in” List

Tuesday, August 24th, 2010

I noticed that when I push a new update for one of my apps, it bumps it to the top of the “Just in” list for my category.  When I tried the same for my newer app it didn’t promote it the same way.  I decided to do some research and found that if you wait about a week between your updates, the Android Market will bump you to the top. That’s actually pretty convenient for a smaller app since a good dev cycle including plenty of testing is about a week (at least for me), and discourages posting constant trivial updates just to continue to stay at the top of the list.

Why is this feature in the Android Market a good thing? People are constantly looking for new content, new games, and updates. You would think it’s kind of cheating to bump yourself to the top of the “Just in” list every week, but it’s really a good thing for developers as well as end users. It ensures that applications that are under active development get exposure while stale ones bubble down to oblivion and also promoting bug fixes and feature additions for anyone wanting the attention. It is a necessity especially in the Android Market with the store becoming flooded with duplicate and garbage applications.

New Release: Pineapple Farm

Thursday, August 19th, 2010

farm3

My newest game, Pineapple Farm, is now available in the android market.  If you liked Green Tree and Planet in a Bottle, I’m sure you will enjoy this one.  The goal is to grow your crops and build up your farm by buying nearby property.  There are also items you can buy that will help you automate maintenance on your fields.  Find it in the Android market by searching for “Pineapple Farm”, or use Barcode Scanner to scan the QR code below.

farm-qrcode

Android Bitmaps and Memory Leaks

Sunday, August 15th, 2010

I wanted to share some info that I have been learning about in my latest project. It seems that Android has an interesting way of memory management for Bitmaps. Drawables seem to act normal and get cleaned up with the garbage collector, but Bitmaps are apparently not in the normal application heap. This causes problems… for me anyway. There is an awesome article about it here if you want to learn more about it and how to find memory leaks in general.

Basically the solution to this problem is to manually recycle any Bitmaps you create once you are done using them. This seems pretty simple because you can basically call recycle() on all your bitmaps in the onDestroy() hook in your Activity. However, most of the time you have a separate thread running that is using these image resources. If you recycle your bitmaps in the Activity, there is no guarantee that your background thread won’t come searching for these resources before it dies.

My solution: I created an “ImageManager” class.

class ImageManager {
    private HashMap<Integer, Bitmap> mBitmaps;
    private HashMap<Integer, Drawable> mDrawables;
    private Context mContext;

    private boolean mActive = true;

    public ImageManager(Context c) {
        mBitmaps = new HashMap<Integer, Bitmap>();
        mDrawables = new HashMap<Integer, Drawable>();
        mContext = c;
    }

    // We need to share and cache resources between objects to save on memory.
    public Bitmap getBitmap(int resource) {
        if (mActive) {
            if (!mBitmaps.containsKey(resource)) {
                mBitmaps.put(resource,
                    BitmapFactory.decodeResource(mContext.getResources(), resource));
            }
            return mBitmaps.get(resource);
        }
        return null;
    }

    public Drawable getDrawable(int resource) {
        if (mActive) {
            if (!mDrawables.containsKey(resource)) {
                mDrawables.put(resource, mContext.getResources().getDrawable(resource));
            }
            return mDrawables.get(resource);
        }
        return null;
    }

    public void recycleBitmaps() {
        Iterator itr = mBitmaps.entrySet().iterator();
        while (itr.hasNext()) {
            Map.Entry e = (Map.Entry)itr.next();
            ((Bitmap) e.getValue()).recycle();
        }
        mBitmaps.clear();
    }

    public ImageManager setActive(boolean b) {
        mActive = b;
        return this;
    }

    public boolean isActive() {
        return mActive;
    }
}

This does two things: first, it makes it easy to recycle all your bitmaps and keep track of when you have recycled them to shut down your app, and second, It enables you to share repeated resources.  In my app, I have images that I use many instances of. Previously I would instantiate a new Drawable or Bitmap for these using up memory for a resource I already had in memory.  When you get a resource from the ImageManager, because it keys on the drawable ID, it checks to see if it is already available before loading it again.

It also makes it a little easier to get an image.  the ImageManager object you create will have to be passed to every object you want to use it, but when it’s available just call im.getDrawable(R.drawable.whatever) to get your Drawable.

You will still have the problem of the background thread trying to access assets after they are recycled.  To avoid this you will have to either check every time to see if the ImageManager is still active, or (the lazy way) catch the NullPointerException it throws when it tries to draw.

Green Tree Update 1.2 Has Been Released

Tuesday, March 2nd, 2010

Many were commenting on some issues and frustrations with the app.  I finally got around to releasing an update that hopefully fixes many of those problems.  The issue with storms or bugs appearing while the game was paused should be fixed as well as a couple other bug fixes.  It should generally run smoother now as well.

Some were frustrated that their tree would die overnight.  While my response to this has been “You need to remember to pause before sleeping.”, I’ve made it so it should survive the night in most cases.  I’ve also added difficulty options so the player can specify a difficulty explicitly.

Please keep contacting me about suggestions or problems. They have been extremely helpful.

Planet in a Bottle

Saturday, February 27th, 2010

planet-complete-1

Check out my new release.  It’s a game I’ve been working on for the past week or so.  It’s loosely based on my Green Tree game that was released in January.

Download it for free and let me know what you think!

I’ll try to get the QR code posted soon for a direct download.