Recent Posts

Android Dynamic Form Fragment

Continuing on the same topic of saving the state of a fragment across screen flips, I’ve recently encountered a rather strange issue. I wanted a fragment representing a simple form, with a bunch of TextView as labels and EditText as fields. The real case scenario involved fetching some data over […]

Android Fragments, Saving State and Screen Rotation

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 […]

Reading text files is damn slow on Android!

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: Scanner in = new Scanner(new BufferedInputStream(getAssets().open(""))); final float[] vertexes = new float[nrVertexes]; for(int i=0;i vertexes[i] = in.nextFloat(); } It […]

Proper way to add/remove OverlayItems

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. […]