-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|702|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
Cower
Created : 26 July 2010
Edited : 08 August 2010
System : Mac

Ascension for Android (and Disjointed Rambling!)



Well, I just finished my first app for Android, a live wallpaper I'm calling Ascension.

You can view some pictures here on AppBrain, this is a market link (this link will only work on Android phones with the Market app), and this is a giant version of the icon and a QR code if you like using that sort of thing:


It's been about.. maybe 7 hours? I've got two comments with five stars, so I'm pretty happy if that's the initial response. Most people don't seem to leave comments. It seems it's already been pirated, no surprises there, it just happens that Android Market's got more holes than something with a lot of holes. |edit| Not too sure about this part anymore - if piracy has affected me, I'm not entirely sure how much it has, though. Either way, sales have been going fine and people seem happy, so all's well for both sides. |edit|

I don't think I'm going to bother worrying about piracy for something that cost me $0 to develop and gets me less than a dollar per sale. I'm more interested in having something that people like and being able to say that I made it, because I think that'll help in the long run to show I'm not one of the spam developers (more on that later).

Disjointed rambling about Android coding/market follows

So it turns out coding for Android, once you get past the fact that Java sucks (and you're just gonna have to deal with that, since the NDK is not a good approach for most things), is actually really easy. Java and bugs aside - there are bugs in Android, and they will make you really frustrated when you find out it's a known bug in the OS you've been trying to fix in your code for the past few hours - it's a very pleasant bunch of APIs to work with.

UI Rambling

Making custom UI components is remarkably easy. For example, there is no color picker I can find in Android's base widgets (if there is, please don't tell me about it, because it will make me really unhappy), so I ended up having to write my own code to handle this. There were a few different iterations to this. First, I did a quick mockup of how I would perhaps ideally want to pick a hue on a touchscreen:


Some people have different approaches to this. Some use a wheel for hue, or an RGB triangle, or a circle that handles hue and saturation at the same time, and having used those over the years, I really hate them. Another issue with the wheel, triangle, etc. approaches is that touchscreens on Android devices are really not very accurate. I can prove this by going into a simple paint application and attempting to draw a straight line on my phone, so I am not going to want to deal with the location I pick on a circle or triangle going all wobbly thanks to the touchscreen. If this were the iPhone or iPod, my opinion would probably be in favor of a triangle, because their touchscreens are incredibly good, and despite my grudges, it would work pretty well.

After making that and deciding I liked it, I went about making an implementation to test it. Not a lot of work, and I was pretty happy with the idea to begin with. So because I liked it and confirmation bias seems to confirm that I'm right all the time, this was put into the live wallpaper and sent out to my testers who generally all liked it (there were a few problems, but those were minor fixes). I'm actually pretty glad that concept to implementation on this worked out, but given it's more or less a compound textbox and slider, it's not that impressive.

Finally, after tweaks and bug fixings and more tweaked iterations, the code was adapted to support picking hue, saturation, and value. This isn't really interesting, but the final UI for picking a color ended up looking like this:


Turns out rounded corners on the slider portion made it harder to decide where exactly the range of color ended, so those got dropped pretty quickly. All in all, it took a few hours to get the majority of the code for that working, and I think it turned out pretty well. And it was easy to do, which is great, because I like easy stuff.

Preferences / Settings

Another thing to mention is preferences and such in Android. Preferences are really easy to work with. Essentially, you subclass PreferencesActivity, and then you load the preferences from XML (you can also create them programmatically, but considering preferences don't need performance, it's easier to use XML). Your main activity or service can then implement an interface to listen for and react to changes to your app's preferences (Android likes *Listener interfaces a lot). Setting up dependencies between preferences is fairly simple as well, since you just assign the key of a preference for one to depend on, and that preference will then be enabled or disabled depending on the other preference.

Overall, it's really simple, and a far sight better than the gigantic disaster we have on desktops with hidden folders, application data/support, binary registries, etc. Creating new preferences is simple too - I won't go into that, but just trust me when I say that it shouldn't take you more than five to ten minutes to use any view for a preference that isn't already supported. Downside is you're going to inevitably have to do this, because Android supports very few views in preferences out of the box. SeekBars, for example, do not have a preference class. You're on your own there, but thankfully it's simple to do.

The Market

Lastly, there's the Android market. This depressed me, because I got all happy about how nicely my project was progressing, so I decided to look into what's going on with the Android market. Bad idea to do that early-on in a project, because you will lose a lot of your motivation to continue working on your project. The market is now a disaster area, especially if you're making a live wallpaper. Searching for live wallpapers yields about 90 spam apps with all the good stuff hidden between them. Most of these are flags for countries and spinning Android mascot models, the latter only differing in the model's color between each different app the authors have so graciously spammed users with.

You have no hope of beating these guys in the search results for a live wallpaper, and your chances of being noticed without it being through a blog, website, twitter, facebook, etc. are very, very low. This is the same for the iPhone, although the iPhone has better search results and quality control, so it's less of an issue there. My point, however, is your app is not going to be found in generic search results. Give up on that.

Instead, begin looking into who you're selling to and what they're looking for, find forums that they post on and which allow you to announce your app to them without breaking their forum's rules, talk to them, etc. By now, this should all be common sense to people developing for the iPhone and Android, I think, but on Android this really is your only choice. You have absolutely no chance of the market coming through for you unless you are well-known (e.g., Yelp, Yahoo, Skype - that sort of well-known).

That said, I'm still working on this part of the distribution and trying to find as many places as I can where the users welcome announcements and talking with the developers behind the apps they're using. I'm not good at marketing, so I'm afraid I'm just plain slow here.

Anyhow, I can't think of anything else I want to add to this, so hopefully that was informative.. or something. I'm not sure. I doubt it, but I wanted to write about Android.

 

Comments


Tuesday, 27 July 2010, 05:45
mole
Interesting read, thanks.
Tuesday, 27 July 2010, 05:49
CodersRule
I had a dream about this last night.
I think now I need to buy it because of that.

Main problem is that I don't have an Android phone.