Text
mobile devices have constraints that are completely different to the world of desktop computers
Text
failure to account for such limitations may lead to very poor performance and poor memory management
not only for the app alone but also for the entire device
most devices in the mobile ecosystem have low memory
android runs various activities and services in parallel. apps dont need to relauch afresh from the start
if these apps consume more memory than they have to. the result is?
the android system starts to evict processes and services forcing a user into a situation where apps are constantly relaunching
this is due to pressure piled on memory
overall use as little mem as possible otherwise the whole system suffers
highest end mobile CPUs compared to desktop CPUs. comparison?
don't benchmark your apps performance based on its performance on high end devices e.g(nexus 5/6).
also at times the cpu is throtled down to better utilize battery life. therefore only a fraction of cpu pow
also at times the cpu is throttled down to better utilize battery life. therefore only a fraction of cpu power is at use then.
you app may also be the one preventing down clocking by triggering things such as animations
animation effect on CPU
grab the cheapest phone as your main development phone
the average time that an application should target for processing input, layout and drawing should be 16ms for a frame
allows the system to render at 60fps during animations and input gestures
less than this speed is picked up on users as slow or jerky motion
even more problematic are apps that can hit that 16ms time but drop a frame or two due to inability to consistently hit that speed
JIT vs Ahead-of-time
speed of both
is directly proportional to the number of objects in an app
process by which runtime frees memory for objects which are no longer referenced
Android is a single threaded UI system
lots of jank problems are due to doing too much on the UI thread
all activities that occur on views including drawing them happen on the single UI thread in the activity
doing other things on this thread can cause jank since 16ms just isnt enough time to do everything
lollipop introduced the render thread which involves sending everything being rendered to the GPU
input scrolling and animations still happen on the UI thread
it varies with the low end devices having as low as 4gb for everything which includes, OS, media downloaded and all applications
no app should be greedy in its utilization of system resources