March 30, 2012

Dev-mode for your Android App

When you develop an App it is often useful to have some switches that allow you to gain more inside into what is going on. The classic example for such a feature is logging. Setting the log to a very noisy level can give you lots of extra information. In Android you can change the log level at runtime using the Android Developer Bridge (adb). Just run adb shell setprop log.tag.<your logtag> DEBUG to enable debug level logging.
But what if you want to bring up extra UI-elements, test different algorithms or even use different backends? A valid approach for this is to use a file that (if it exists) puts the App into dev mode. This works well in Android but is also quite static. A more dynamic switch is available by (ab)using the above log level mechanism. Just define a special logger (e.g. dev-mode) and check if it is set to debug level logging (using Log.isLoggable). This allows you to toggle dev-mode at runtime.
I implemented the above approach for a client who wanted a special dev-version for testing purposes. But in that case the dependence on the AndroidSDK (you need adb) was a concern, so we settled on the property file approach.
If you have any other ideas how to dynamically switch on additional features at runtime, I'd be happy to hear them.

January 23, 2012

ActionBar support

With Ice Cream Sandwich being on the rise now there is really no excuse for not supporting the ActionBar UI pattern anymore, even if you don't support a tablet version of your app. There are quite a few projects out there to help you with that.

Basic support is easily added thanks to the ActionBarCompat sample project that comes with the SDK. You can just copy that over into your project and have a consistent action bar (although very limited) across all Android versions.
It is also a nice example of how to abstract out platform-specific code. And consisting only of a couple of classes it is easy to understand and tweak. There is one little thing you should be aware of, though. The Home button is disabled in Ice Cream Sandwich by default, as described in this stackoverflow question).

For more complete action bar support have a look at ActionBarSherlock.

December 18, 2011

Keep track of your App's Market data

If you maintain any Apps in the Android Market then you have probably come across questions like
"How many downloads did the app have last week/month/year...?"
or
"Did the ratings improve since the last update?"
It's not easy to answer those questions since the Android Market's Developer console only gives you the current data. (There is statistics for active installs though.) So you have to keep track of these data yourself.
I found it quite tedious to do this by hand, so I built a little (Java) Selenium test that grabs the data and writes it to disk. Happily, it even runs headless, and can thus be easily put into the cloud. Lately, I fixed it up and put it on github. Hopefully this saves you some time, too.

February 25, 2011

Wallpaper still does not open

Lately, my Slider Live Wallpaper was "awarded" with a one-star rating again. The comment stated
"It wont even let me open it."
I've blogged about this problem before and now there is even an issue for it. As pointed out in the comments there you can work around this behavior by registering a special activity with the INFO category. This is what I'll do now. Here is a good how-to. But, unfortunately, you can not trigger the wallpaper selection directly, so the best you can do is displaying the list of all the installed live wallpapers. This is still somewhat limited for my taste.

So if anybody knows of a better way to handle this, please comment so that I can avoid above awards in the future.

September 29, 2010

Installing a wallpaper should be easier

Live wallpapers are great for showing off your Android phone, especially in an Android vs iPhone battle. Make sure to install "Show Off" from the market to be well-prepared.

A while ago I've done my first own live wallpaper. It is called "Slider" and is basically a 15-puzzle-like tile animation of an image selectable from the phone's gallery. It hasn't gained much attention (downloads) though. I wonder if many people try out live wallpapers regularly. Guess not, probably stick with a good one after a while.

Lately, I had a little email conversation with one (of the few) downloaders. It went like this:
DL: "Does not work!"
Me: "Could you explain..."
DL: "Does not open!"
Me: "Did you try HomeScreen>Menu>Wallpapers..."
DL: "That's not the problem, can not open, only uninstall."
Me: "Do any other live wallpapers work?"
DL: ">App will not open. no wallpapers at all. i do not know what do they look like. the app does not open..."
Me: "Live wallpapers are not applications, so you can not open them. This is why the button "open" does not work.You start a wallpaper from the menu "wallpapers" of your homescreen..."

This shows another problem with live wallpapers. Installing from the market is not as easy as it should be. I don't know why the "Open" button is just disabled, would be much better IMHO to at least let it open the list of installed wallpapers or the settings activity for the downloaded wallpaper. What do you think?

September 13, 2010

Android Market stats improvement suggestions

Lately, my minesweeper clone (called Mines) passed 50 000 downloads in the Android market. I uploaded the first version of the game in August 2009, so it took quite a while to get there. My users seem to be quite happy with the game though, at least I don't get too many ratings like "Rubbish" or "Uninstalled" ;-) and the rating average is still above 4. Also, the active installs are still above 40 percent.
Thinking of these numbers I came to realize that there are a couple of things I would like to know about the downloads/active installs but that is not provided by the market developer console.
  • I would like to have statistics over time.
  • I would like to filter over languages, would be great for comments/ratings also.
  • I would like to know how the game was found in the market.
The developer console has evolved over the last year, at least you get error stack traces, comments, and ratings numbers now. But there is still a lot of room for improvement.
For now I built a Selenium Test that runs once a day to grab the current download/rating numbers. That should at least allow for some basic statistics on these numbers.

April 23, 2010

Keep track of your android app stats

Lately, I fiddled around with the google gadget api again. One of the things I like to see on my igoogle page is the current stats of my android apps. Cyrket provides all the relevant data, but their page is to big to fit into a gadget. So I wrote a little gadget that extracts the basic data (rating average, number of ratings, number of comments) and shows just that.


Here it is.



February 5, 2010

Mines - six months in the market

Mines, my little Minesweeper game, has been in the Android Market for six months now. And I am quite happy with its performance. It still rates above 4 out of 5 points and has been downloaded more than 20000 times. Most amazing to me is the number of active installs, which still is close to 50 percent. So more than 10000 copies are running somewhere in Android land.

The game has been rated by more than 200 people. Unfortunately, Google's Market developer site does not give access to the ratings and comments. And the Market application on the phone just shows the comments for the phone's selected language. But there are solutions to this limitation, like AndroLib.com or Cyrket.com, which allow you to access (hopefully) all comments. Cyrket just came back after having been offline for quite a while, and I was pleased to find out about my first polish comment, which did not show up on AndroLib.

I am still regularly working on the game in my sparetime, which is fun, especially with so many active users. So thanks to all the Mines users out there!

November 12, 2009

Developer Pride

Visit this post at blogger to see the fancy animation at the top. Nice promo. ;-)

August 5, 2009

Mines is in the Market


Mines, my minesweeper clone for the Android platform finally made it into the Android market. It was a lot of work but mostly fun. I am not quite satisfied with the art works yet (though I tried my best), so if you want to help improve let me know.

(Download count at the time of this writing: 839)

May 11, 2009

obfuscate4e 0.7.0 released

Just want to let you know that obfuscate4e 0.7.0 is now available to help you obfuscate your eclipse plugins. The hightlight of this release is automatic detection of classes referenced in extensions. This makes setting up your project for obfuscation a lot easier. So check it out!

March 13, 2009

Android Minesweeper: Yes we can!


Thanks to my folks from PartMaster I own a Android Dev Phone 1 for a couple of weeks now. I am quite impressed by the Android platform, although the G1 is not quite as slick as the IPhone. But this definitely has a huge potential. Especially the extensiblity and openess are amazing.

Coding for Android is no different from regular java, but it takes a while to get to know the framework concepts and classes. I chose to port the minesweeper code which I already use in eidle. Since I could reuse the model code as is, I had the basic game running within an hour and could then focus on the UI widgets, menus, preferences and lifecycle issues etc. This was really fun and ideal to get used to android. The application is not finished yet, but it is working smoothly already.

Stay tuned for updates.

January 24, 2009

A Feed Reader for Eidle

One of the things I have on my ToDo list for quite a while is integrating feed reading into one of my little fun projects, the Eidle screensaver framework. As I stumbled on Google's feed API yesterday I realized how easy that would be. I saved the sample they provide here to my hard disk, fiddled around with the css styling to make it look more appealing for a screen saver, and set eidle's browser screen properties to use it.
I am quite happy with the outcome, with just an hour of work. In general, with integrating a browser into eidle the possibilities are manyfold, the sky being the limit. Currently, you can only have one browser screen in eidle, but I think of a less static use of the eidle screens for a while already. So stay tuned for news! In the meantime check out eidle and build your own browser based screens. I'm looking forward to hearing about your ideas.

P.S. You can even let Google generate the code for you.

January 9, 2009

Monkey bidden

Lately I have installed GreaseMonkey and GreaseFire. This really lubes up Firefox. Lot's of cool scripts that enhance many popular sites. But the real fun started when I decided to build a script myself.
Here is the problem it solves: I often visit a page to find out about upcoming events. If something is interesting I add an entry to my Google calendar. All the data I need for this entry is there on the event info page. So lots of copy/paste here. My script now adds a button next to each event and when I click it generates the calender entry for me in a new tab. All I have to do then is press another button (save) and close the tab. Very handy, and I have a lot of events in my calender now. ;-)

August 29, 2008

eidle 0.2 final finally

The new version 0.2 of Eidle is available! Get it NOW!

August 15, 2008

Eidle 0.2 Release Canditate 2

The second candidate of the version 0.2 of Eidle is available. It includes all the functionality planned for 0.2. Since candidate 1, I added (basic) support for multi-monitor systems and further evolved the auto minesweeper.
The final release isn't far away and will probably not be too different from this candidate. So give it a try, and tell me what you think.

May 16, 2008

Eidle 0.2 Release Canditate 1

I've just uploaded the first candidate for the upcoming Eidle release. So let me tell you what Eidle is all about.
Eidle is a screensaver framework based on EclipseRCP. As such it can easily be extended by your own animations. Currently, it comes with a 15-puzzle-like animation, a flashlight animation, an integrated browser, a picture presenter and a minesweeper autoplayer.
Eidle currently focuses on the integration into Windows, for which an installer is provided. I've also made some experiments on integrating it into EclipseRCP-based applications like the EclipseIDE or Lotus Notes8, but this probably won't make it into the next release.

May 14, 2008

Misleading names

My favorite misleading name these days: CM Synergy. If you were forced to use it you'll certainly know what I mean.

May 9, 2008

Plugin obfuscation with obfuscate4e

A new version of obfuscate4e is out the door. So let me tell you what it's all about.

Obfuscate4e helps you obfuscating your eclipse-plugins. It integrates ProGuard into the EclipseIDE and provides some functionality to ease the integration into the PDE build process. That means whenever you build your plugin (using plugin export, feature build or product build) it is obfuscated automatically.

There are quite a few reasons to obfuscate your plugins: smaller bundles and faster downloads, removing unused classes, hiding implementation details, ...

Even if you don't develop plugins, obfuscate4e has something to offer: it registers a proguard ant task you can use in your build scripts. But to leverage its full strength, consider converting your java project into a plugin project, even if you don't plan to use it in an OSGi environment.

Obfuscate4e comes currently in version 0.6, so it is not quite rock solid. And some knowledge of the ProGuard syntax is needed. But don't be afraid, it is not that tricky. So check it out, use it, and give us some feedback on how to improve it.

September 26, 2007

Switching between languages at runtime

One of the requirements we have in our project is to support switching between different languages at runtime. To make this work in the RCP runtime, we decided to close the workbench window and open a new one when the language changes. This works quite well, especially since we have put all state data of the gui in separate models.
Another thing was how to handle data lazily loaded by the platform. For example, a view tab may be visible before the view is actually instanciated. The platform then uses the data (name) given in the extension definition of the view. But this is static, so it won't change if the language changes. We solved this by providing what we call ViewLocalizations via a custom extension point. The ViewLocalization resides in the same bundle as the view it belongs to and knows how to translate the view name. Our Presentation then uses the view localization to determine the right name for the view. Of course, a bundle should not be activated only because one of its ViewLocalizations is needed. Therefore, we put all the ViewLocalizations of a bundle in a separate package which we excluded from the lazyStart-mechanism.
This solution works quite well, but generates a considerable overhead. Especially since beside views, also perspectives, actions, etc. have to be handled this way. So if you have any ideas for improvements, please let me know.

About Me

codes for a living and also in his freetime, probably for lack of a real hobby. ;-)