Skip to main content

Notes

Declaration Variable

  • Always declare each variable above the class, commented and grouped based on the type of variable.

    Example :

    class EditProfileActivity : AppCompatActivity() {

    //Data Binding
    private lateinit var binding: ActivityEditProfileBinding

    //View Model
    private lateinit var viewModel: EditProfileActivityViewModel

    //Dialog
    private lateinit var progressDialog: Dialog

    override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    binding = ActivityEditProfileBinding.inflate(layoutInflater)
    setContentView(binding.root)
    }
    }
  • Create a function declared inside the onCreate method, no inline code.

    Example :

    override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    binding = ActivityEditProfileBinding.inflate(layoutInflater)
    setContentView(binding.root)

    initVar()
    initToolbar()
    clickListener()
    initObserver()
    }
  • Try not to have complicated logic inside Activity or Fragment class, all logic should be in ViewModel class.

Helper Class

  • If there is a function to use in another activity, try putting it in a helper class.
  • Before creating a new function, please check the functions in the helper class first. It is feared that there will be duplication of functions.

Versioning Application

Please note that in declaring the Version Code and Version Name of the app.

  • Always start Version Name "0" before upload to play store

    Example :

    versionName "0.1.0"
  • For naming the Version Name as follows:

    [release_version].[module_number].[task_number].[bug_fix_number]

    Example :

    Release Version : 0 (The apps haven't been uploaded to the Play Store yet)
    Module Number : 1.Auth
    Task Number : 5.Forgot Password
    Bug Fix Number : -

    So the version name is:
    versionName "0.1.5"
  • For naming the Version Code just count based on the number of apk created, because this will affect the Remote Config Firebase to force update.

  • For naming APK as follows:

    [type_apk] - [application_name] v[version_name].apk

    Example :

    Dev - Blueprint Mobile Kotlin v1.0.0.apk
    Staging - Blueprint Mobile Kotlin v1.0.0.apk
    Production - Blueprint Mobile Kotlin v1.0.0.apk