Archive for the ‘Games’ 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.

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

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.

Distracted

Friday, February 26th, 2010

I feel I need to apologize to all the Green Tree uses for not paying enough attention to bug fixes.  I value everyone’s feedback and I hope to push some updates and bug fixes soon.

However, I do have an excuse for neglecting it.  For the past week or so I’ve been working on a new game.  If you like Green Tree I think you will like this one too. It’s a much more solid and smooth game as I have learned a lot since releasing Green Tree (my first Android app).  I can’t really spend much more time on it because I am broke, and I need to go find some paying gigs, but I hope to release this weekend.  So, check back often or follow me. I may post up some screenshots of it before launching.

Green Tree Re-released

Friday, January 22nd, 2010

greenTreeQrcode

I got a chance to test out my game some more on two phones and a few Android virtual machines.  Because of the nature of this game (The tree “grows” even when you are not playing) it takes a few days to test it out fully.  This was the reason for the number of bugs in the game before.

All that aside, I think it is a pretty fun game, and based on the emails I received after it was removed from the market, there seems to be a sort of a following for it.

To download, scan the above bar code above or search the market for ‘Green Tree’.

Thanks, everyone, for the support, and let me know if you have any issues or feature requests for me.

New Developments

Tuesday, January 12th, 2010

I feel I’ve utilized my time off well.  The job hunt will soon begin, so I had better do as much as possible while I can.  One of the things I hope to finish is my Android game I’m making.  I’ll probably be posting a beta of it on here very soon!

vtree-screen

It isn’t named yet but the basic idea is a virtual tree. The player must care for it by watering (but not over watering) it periodically.  There will also be obstacles that arise randomly such as storms that run the risk of drowning your plant, and bug swarms that eat away at your tree.  While the program does not actually run in the background, it is updated every time you open it as if it never stopped.  This way a user can play off and on for a prolonged period of time.  I hope to have it last from two weeks to a month or so (maybe even indefinitely).

The payoff: fruit that will give the player resources to buy tools and supplies to further the tree’s growth.