by Zigurd · 14y ago · 0 comments
Understand component lifecycle. Understand it well enough to know you have to design your app around it, because you can't subvert it. Do this first. Do not write code before you understand this. A good way of understanding this is to override all the lifecycle methods in Activity and log them, then watch what happens. Understand that Android can "destroy" both individual component instances and whole processes. Understand that you can't thwart "destroy" by holding a reference.
Understand Android's support for a data model in a sql database, abstracted by ContentProvider, and how to build an observer pattern around this.
Understand Android's support for concurrency, enough that you know the limitations.
This works well in Android where each process's maximum heap is something between 16 and 48MB, and keeping your data model in a database is a way of continuously persisting it.
There are exceptions. You probably would not want to build a CAD program this way. Instead you would take the performance hit to rebuild your POJOs after the component they are contained in gets reaped.
As someone who has a decent grasp on the lifecycle part, could you sprinkle the other two points with a link or two? Or .. a general direction? "Enough to know the limitations" for example is .. hard to follow-up on.