I have been developing embedded software in C for a few years for which I have been taught to use a layered architecture and I got used to it. Recently I made a switch to Android (and Java) and I am wondering if a similar approach is in use. OOP is also pretty new to me so at some points I am struggling at making good design choices. Are there any OFFICIAL design guidelines for the code of Android applications? I have seen a separation of activity and view related code, but I don't know if it is a good approach, and is something like this officially encouraged by Google.
Android is based somehow in MCV paradigm. Basically, you define your views in xml files called layouts. Activities, fragments and widgets in a lower level let you control the functionality of your views. OOP is also present since you are able to define your own models.
Try to define all your views in XML files and take advance of OOP defining your own models related to Android (or custom) widgets. In activities and fragments you should implement all the listeners stuff and related.
Android developer has some great tutorials and guides: https://developer.android.com/guide/index.html
Anyway, this is a very wide question that can be answered in many and valid ways.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With