Android resource hungry operations

  1. I am using JSON to receive data from the web service, creating text to JSON object is resource hungry operation.
  2. I have to load images from the web, I am lazy loading images in the async process how can I compress and make the cache ??
  3. After the crash, how can I stop re-launching activity?
  4. How can I know how much memory remaining and Android OS will kill my object?


Asked by: Edgar131 | Posted: 20-01-2022






Answer 1

You can cache your images using a pool of SoftReferences (http://developer.android.com/intl/de/reference/java/lang/ref/SoftReference.html). This will allow the OS to clean them up if it's running out of memory while still allowing you to access them. This should help with #2 and #4, but I am not sure what you mean by #3.

Answered by: David286 | Posted: 21-02-2022



Similar questions

performance - Order of UI operations on Android?

I've been building for Android for six months now, and I'm still confused about how things happen in the UI. When I learned iOS programming, the books and docs were very clear about what happened when: for instance, that view changes and animations didn't take effect until the next iteration through the run loop. This understanding is critical to debugging UI glitches, and without it I'm having trouble tracking stuff down ...


android - Slow Performance of Complex Operations

Folks. I've designed a currency exchange application in which i got all exchange rates once at application start and create own SQLite DB then easily pull them into the converter interface. I've designed the change to be done in my Edittext onTextChanged listener with a textwatcher and all works perfectly. I've also have a listview in the same activity for Favorite exchange rates and its also has to be calculated ...


performance - Android ListView Refresh Single Row

After I have gotten the data for a single row of a ListView, I want to update that single row. Currently I am using notifyDataSetChanged(); but that makes the View react very slowly. Are there any other solutions?


Performance TestCase Interface in Android

Has anybody implemented the PerformanceTestCase provided by android and got some results...If you have done it please provide some source code,it will be really helpful... Here is the android link: http://developer.android.com/reference/android/test/Performance...


android OpenGL ES simple Tile generator performance problem

following this question : Best approach for oldschool 2D zelda-like game Thank to previous replies, and with a major inspiration from http://insanitydesign.com/wp/projects/nehe-android-ports/ , i started to build a ...


Streaming video playback performance issues with background tasks on Android

I have developed a little application that can play video from a rstp streaming sever (darwin in this case, but this is not relevant) by means of the VideoView widget (I have tried Mplayer+SurfaceView approach too). I use Wifi connection for this. The video plays just smooth when video is the only task. The small application should carry out other tasks at the same time such as continously discover...


Replace standard Android JSON parser for better performance?

I know that Android has a JSON parser baked in but I was wondering if it was worth using something that offered better performance (like Jackson - see http://jackson.codehaus.org/) ? Anybody tried that ?


dalvik - Changing coding style due to Android GC performance, how far is too far?

I keep hearing that Android applications should try to limit the number of objects created in order to reduce the workload on the garbage collector. It makes sense that you may not want to created massive numbers of objects to track on a limited memory footprint, for example on a traditional server application created 100,000 objects within a few seconds would not be unheard of. The problem is how far should I tak...


android - For-Loop Performance Oddity

I just noticed something concerning for-loop performance that seems to fly in the face of the recommendations given by the Google Android team. Look at the following code: package com.jackcholt; import android.app.Activity; import android.os.Bundle; import android.util.Log; public class Main extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(save...


performance - How to cache and store objects and set an expire policy in android?

I have an app fetch data from internet, for better performance and bandwidth, I need to implement a cache layer. There are two different data coming from the internet, one is changing every one hour and another one does not change basically. So for the first type of data, I need to implement an expire policy to make it self deleted after it was created for 1 hour, and when user request that data, I will check the s...


How does Android emulator performance compare to real device performance?

I'm looking into writing an Android game, tough I don't curerntly own an Android device. For those of you who own a device, how does the performance on the emulator relate to real device performance? I'm especially interested in graphics related tasks. This obviously depends on both the machine running the emulator, and the specific device in question, but I'm talking rough numbers here. This question is a ...


performance - Is it better to use GL_FIXED or GL_FLOAT on Android

I would have assumed that GL_FIXED was faster, but the iPhone docs actually say to use GL_FLOAT because GL_FIXED has to be converted to GL_FLOAT. Is it the same on Android? I suppose it varies by phone, but what about recent popular ones (Nexus One, Droid/Milestone, etc.)? Bonus points: This appears to be completely undocumented (e.g. search google for GL_FI...






Still can't find your answer? Check out these communities...



Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android



top