Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does number of Activities matter in Android App?

I am developing an Android app. I have already crossed more than 20 Activities. So I am bit concerned about it. I mean if there are more Activities in an Android app, does it affect the performance of App like Speed, Memory or any other issue?

Though it is not a standard question but still I feel its something which might help others too

like image 553
suraj Avatar asked Nov 04 '22 23:11

suraj


1 Answers

Yes Suraj more activities will affect performance
An activity is the equivalent of a Frame/Window in GUI toolkits. It takes up the entire drawable area of the screen (minus the status and title bars on top). Activities are meant to display the UI and get input from the user An Activity (calling-Activity) can spawn another Activity (sub-Activity) in 2 ways:

  • Fire and forget – create an event (Intent) and fire it
  • Async callback – create an event (Intent), fire it, and wait for it’s response in a callback method (of the calling-Activity).

So the effect of activities will depend on performance of your device, its processor and memory etc. Even if any activity will remain in stack and not finish then it affects device performance. Even you have to take a look at security measures.

like image 52
itechDroid Avatar answered Nov 13 '22 16:11

itechDroid