In my application I am starting two activities (TTS and animation) at the same time. My app is also facing memory issues for some users.
Is running two or more activities at the same time advisable? Will this approach consume more memory?
Please advice me.
Abilash,
Depends on the application, but many applications will run more than one activity simultaneously. The helps to create a smooth experience for the users while allowing us developers to logical segregate unrelated pieces of code. Many tabbed applications have tabs that each contain their own Activity.
Certainly. Both Activities are active, so each one uses its own resources. The issue here is how much memory each uses independently and whether it is bigger than your allotted heap size. If both Activites together are bigger than the device’s heap, you must either: a) reduce memory usage or b) separate the Activities.
Recommendations
Utilize a memory analyzer tool, such as the Eclipse Memory Analyzer. Find out the minimum heap size of the devices it is running on. (This is normally determined by Android version on the device.) Take some snapshots of a device’s memory while the application is running.
Hope this helps,
FuzzicalLogic