Android Fragments, Saving State and Screen Rotation

On July 12, 2011, in API, by Evelina Vrabie
8

Since the introduction of Loaders in Honeycomb and Compatibility Library, the Android world has changed for the better. However, it took me quite some time to dissect and understand the rather scarce documentation about how to work with these on special cases, like the hated case of screen configuration change – aka screen flips. It turns [...]

Continue Reading

Reading text files is damn slow on Android!

On July 11, 2011, in Performance, by Cristian Vrabie
0

In a Android application I wanted to use Scanner class to read a list of floats from a text file (it’s a list of vertex coordinates for OpenGL). Exact code is: It seems however that this is incredibly slow (it took 30 minutes to read 10,000 floats!) – as tested on the 2.1 emulator. Run [...]

Continue Reading

Method calls through interface references are slower

On July 11, 2011, in Performance, by Cristian Vrabie
0

In the 2009 Google I/O talk about writing real-time games for Android it is recommended that for performance we don’t use interfaces. Supposedly the calls through an interface reference are about 30% slower. It is also mentioned that calls to static methods are faster. In these circumstances, i asked myself if all calls to a [...]

Continue Reading

Android Tabs with Fragments

On July 10, 2011, in UX, by Evelina Vrabie
25

I’ve been recently using the Android Compatibility Library in a project where I  found myself in the need for a tabbed layout, in which each of the tab’s children would be a fragment.  The usual way to do this is for the activity you need the tabs in to extend TabActivity. However, if you want to [...]

Continue Reading

Proper way to add/remove OverlayItems

On July 6, 2011, in 3rd party API, by Cristian Vrabie
7

Some time ago I contributed to an app for Android which had to manage a lot of Google map OverlayItems. The Google API support and performance for overlay items is satisfactory while you have a manageable amount of items but gets messy if you have lots and lots of items. Further more, it seems that [...]

Continue Reading