Category: Android Development

  • What I Know About Kotlin Language

    Kotlin language is mostly used with Android studio to create native Android apps. I don’t know other use of this language BTW, of course it could be useful in some other fields too.

    Var vs Val

    There are two ways to define a variable in this language which are var and val

    1. Var -> when we define a variable using var keyword in this language, that variable’s value can be modified. It is similar to let in the JavaScript language
    2. Val -> when we define a variable using val keyword its value cannot be modified later. It is similar to const in the JavaScript language.

  • About Jetpack Compose in Android Studio

    Jetpack compose is used to build modern UI using Material 3 library and you don’t need to create UIs in the XML as we do in the normal android studio project.

    Best dependencies or packages I found while learning about Jetpack Compose:

    1. Coil -> It is used to show the image directly from the URL in the app. You just need to add the dependencies in the build.gradle file at app level and done. Now you are ready to use the AsyncImage function (I don’t know exactly what to say those who render something on the screen.
      Note: as you are going to use URL in the AsyncImage that means you need have the internet permission in the android manifest.
    2. Retrofit -> It is used to do API calls either it is GET, POST, PUT, PATCH or DELETE or any other HTTP methods. To use this package you need implement its latest version in the app level build.gradle file.
      Not: as it is also going to use internet, you should have internet permission in the android manifest xml file.
    3. Converter-Gson -> It is used with Retrofit to parse JSON from the response we receive from the API.
    4. Media -> This package is used to play the video from the URL in the jetpack compose.