Ive been searching the internet for a while now but cant find a good page for good habit examples in android programming. For examples im interested in things like how to name classes or xml files (what case letters, where to use _) and also in file things like naming variables and fields or edittexts, prefixes and everything like that.
If someone could help me with a link i would be very grateful!1
Android developers has its answer for this.
If you need anything elaborated I’ll update my answer from your comments 🙂
For Classes use Java naming convention:
MyActivity or MySettingsActivity
Why a lot java files are called Activity in the end. It is to describe in the name that they inherit from from the superclass "Activity". It is a principle that came became big with Android, which uses it a lot, examples if these classes are inherited:
(super class = end of their heirs name)
AsyncTask = Task
Service = Service
Activity = Activity
Handler = Handler
I could go on 🙂
For xml files, belonging to activities I personally like to call them the name before Activity, so MainActivity’s xml layout would be main.xml