Toxic Bakery

Tag: Lucky Suite

Its Alive!

by on May.15, 2010, under Android Applications

Yep, lightning hit it and its breathing. Okay so maybe the combined 100+ hours between Shawn and myself had more to do with it but that is no where near as exciting. Today we finally ‘finished’ development on the Lucky Suite and are finishing up some small graphical and functional elements in the mean time. Hitting our first real mile stone I thought I would make this post to maybe help other developers that are just starting out.

Developing an Android application was not only an experience in Android development itself but also in structured development of Java applications. It seemed that for every ten lines of code that went smoothly we had to take three hours aside for doing research of why something seemingly simple would inexplicably not work. The worst example of such is that the SDK allows for you to create Frame-by-Frame Animations which is an awesome feature until you actually try to use it for doing something useful. The flaw in frame animations is that they do not have event listeners such as when they started or when they stop. They do have methods for checking if they started or if they stopped however this is no where near as powerful as a listener. Because of this Shawn had to write a library to allow us to know when the simple events happen (start, end, repeat).

Another example where a seemingly lacking SDK was a pitfall and time waste for us was the lack of ability to simply rotate the image contained in an image view. For our dice throw we simply wanted 1-3 dice and we would dynamically set the image for the image views, randomly position the dice, and then add some random rotation to make it more realistic in appearance. All went well and great except for the simple fact that we somehow assumed, and we all know what assuming does to you, that ImageView had some method for rotating the image they are containing. Apparently Google did not feel that anyone would have a use for this so we where left with the option of rewriting our content view to use paint/canvas or figure out how to rotate the image before applying it to the ImageView. We took the second option and found that converting a Drawable to a Bitmap you can apply a Matrix to the Bitmap then finally apply the new rotated Bitmap to the ImageView. Of course this caused another problem going back to my statement of every 10 lines of code causes three hours of related problems. Now the issue here is not to blame on Google or Java as placing each ImageView to an X Y coordinate requires that you also specify the width and height of the ImageView. This creates a problem because when you take a square and say rotate it 45 degrees, it now requires a container thats about 40% larger then it did at 0 degrees. ImageView was then resizing the dice to our preset widths giving us dice that are randomly larger and smaller. I finally figured out the needed trig function and solved the issue however hopefully by now you can understand that any development you plan on doing, go ahead and factor in that initially you will spend a lot of time solving problems you never would have imaged.

In the meantime of our development we have spent a little time doing other necessary things such as getting our EIN from the IRS and setting up a checking account specifically for our Advertising and Market incomes and allowing us a location to keep the associated tax monies for the end of year expenses. We also spent a lot of time reading other developers blogs and learning about advertising verse selling applications. It appears that  unless you sell a crap ton of apps, advertising has the best revenue and if you have a decent application revenue can be a fairly consistent source of income. Furthermore advertising with companies like AdMob allow you to include your own ads for free such as advertising an ad free version of your application or advertise other applications you have developed. We are still learning the way of the advertisement and our first release will be with ads so after we spend a little time using them I hope that I will have more to report on the subject.

Anyways this is just some thoughts and experience from the past few weeks dabbling in Android development. I expect in our next two apps that development will move a little faster and hopefully a little less trouble free as we have been working at creating our own custom libraries to solve problems we have encountered and now have the knowledge to fix some of the common problems you run into in general development.

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!