android-performance

What is the ideal place to cache images?

I am fetching a lot of thumbnails in my application from a remote server and lazy loading these in a list View. The image fetches run in a background AsynTask and when completed the fetched images are stored in a HashMap using SoftReferences. This works just fine but when the images in the cache gets GC'd the fetches have to be rerun. I...

What are the ways to get a handle on the view amidst recycling?

I have a GridView, in my activity, that displays about 30 thumbnails fetched from a remote server. I am doing 2-level caching for the images: there is an in-memory cache(HashMap using softReferences) Secondly, all the images fetched are written to Sdcard(so as to avoid refetches when in-memory bitmaps are GC'd). From the getView of...

Impact of 'instanceof' in Android Java code

Does the 'instanceof' keyword bear with it a relatively heavier impact on the Android platform (and more speciffically the mobile phones running the Dalvik VM)? Thank you. ...

Array index lookup versus Instance field lookup

Is someArray[index] a faster way to get to a value than someObject.field? E.G.: if(intArray[i] == 42) {//do stuff} VS if(someObject.x == 42) {//do stuff} I will try to test it soon and post the results; just wondering if you all had any thoughts. ...

Cannot select my Android client in DDMS perspective of eclipse

I want to check my program code for time consuming operations. I thought DDMS is the best tool to achieve that. However, I cant see Threads, Heaps and so on. It tells my to select a client. But I dont know where other than the Devices Tab, which doesnt take effect. What do I have to do? Is there maybe smth wrong with my ADB setup (But ...

Is just setting a value faster than the checking of existance and only setting if doesn't exist - like in this Android / Java code?

Example: That code is run each time, when the listAdapter requests a new row: if (textViewTitle != null) textViewTitle.setTypeface(Controller.getInstance().widgetSettings.getBoldTypeface()); vs. if (textViewTitle != null && textViewTitle.getTypeface() != null && textViewTitle.getTypeface().equals(Controller.getIns...