Getting Started With Android Application Development (Part 2)
In this part, I’ll try to cover the basic concepts in android development.
“The article is based on my learning which I gained through my internships and recently started corporate experience as an android dev. In case your opinion differs, feel free to reach out. I’ll be happy to include your opinion/viewpoint”.
In case you are getting started with Android Application Development, Checkout Part 1.
Over the last few years, there has been a change in the android native development using Kotlin/java landscape, ever since AndroidX has rolled out, many components of android legacy code are being migrated to AndroidX. With the latest release(as of Feb 2022) marking the inclusion of Activity in AndroidX.
What is AndroidX?
AndroidX is a major improvement to the original Android Support Library, which is no longer maintained. androidx
packages fully replace the Support Library by providing feature parity and new libraries.
List of Concepts One should know:
Architecture-Based
The low-level details of android application and an android application’s structure
- The architecture of Android OS (helps with app-permissions and package managers etc).
- Android App’s Structure (significance and usage of each package in an android application).
- Significance of Manifest file.
App Components
On a high level, Android Application Development can be summed up into these 4 components. Activity is the most basic one, the other 3 have awesome and unique use cases. All of them are important as they are fundamental to android development.
- Activity.
- Services.
- Broadcast receivers.
- Content providers.
Code Components
“The Kotlin/Java Files used to render the UI and handle the user’s interaction”
- Activities ( Have a look at types of sample activities provided by android studio, along with the lifecycle of activity: most asked interview question).
- Fragments (along with Fragment Stack and lifecycle of the fragment)
Intents and their type.
UI Components
“The views used to design UI in android and their events like click etc. Using of styles to make sure we want our desired UI in case of both Light Mode and Dark Mode”
- Different types of layouts in Android and their use cases.
- Different types of Views in Android ( ImageView, TextView, etc).
- Recycler View, ListView.
- UI Events in android (eg. ClickListener, etc).
- Styles (Handle the appearance of your elements for both Light Mode and Dark Theme).
- Design Guidelines.
Background Processing
Here background processing is very similar to multithreading, or async and await in JavaScript.
- Async Task (It’s replaced by coroutines now, still it’s important to know what was it used for) and Async Task Loader.
- Coroutines and their use case.
- Scopes in Coroutines and Dispatcher.
UI Layers
Interaction between our UI and the business logic.
- ViewBinding (improvement over findViewById).
- DataBinding.
- ViewModel.
- LiveData and MutableLiveData.
Architecture
Rather than writing all the code in the activity, one should follow existing architectures in order to make the code cleaner and more organized.
- MVVM (Model-View-ViewModel) Most Commonly Used.
- MVI (Model-View-Intent).
- MVC (Model-View-Controller).
- MVP (Model-View-Presenter).
- Among these commonly used architectures here’s the comparison between the same.
Network Calls
In order to use an online API making networking calls are required. The same can be done in various methods depending on the type of API. In the case of RESTAPI, we can use HTTP Client and for GraphQL API we have to use Apollo-Android and for Kotlin written backend we need Ktor.
- okHTTP.
- Retrofit and Volley (along with comparison).
- Apollo-Android (Incase your backend supports GraphQL).
- Ktor.
Local Storage
In many cases we need to either store some data in form or database or key-value pair. One Should know about the use cases of both and how it’s done.
Navigation
The below-mentioned navigations can either be implemented by handling the fragment stack ourselves or the better way is Jetpack Navigation. Using Jetpack Navigation makes it much more convenient to handle all the cases in navigation.
- Bottom Navigation Bar.
- Navigation Drawer.
- Tab Navigation.
- Fragment + ViewPager.
Extra Services
These services are add-on that adds new dimensions to the already existing applications.
- Google Play Services, Maps (used in applications where maps are required).
- Google AdMob / any similar advertisement client (to display ads in your application).
- Firebase.
Publishing an Android App on Google Play Store.
Firebase
A wrapper made over Google Cloud Platform has a collection of services that can be used in an application Android, IOS, and Web), it makes the work of developers easier in case of using online Databases (Realtime and Firestore), Authentication, and Storage.
The Above mentioned topics are the basics of android development, this is the bare minimum of what a developer must know.
How to learn about these concepts?
- Follow an android development course that has the above-mentioned topics in its curriculum. (Even if you follow an android course, rarely will you come across a course that has all of the topics, so mostly you’ll have to follow the second option). In case you are looking forward to following a tutorial, My Suggestion Is to follow a course by developr.android.com.
- Google the topic, read the official documentation to understand the theory and need of the same, have a look at the sample code, If you can’t understand the working while looking at the sample. Have a look at the tutorial which uses the same.
No matter which of the above method you follow. Make sure to implement the topic in code in an application that has a use case of the topic. (Eg. Notes App for RoomDB). This approach has worked wonders for me, as it made me familiar with the theory as well as the actual implementation.
What’s Next once you have learned all the topics?
Congratulations now you know the basics of android development, you have the power of making awesome apps. Before that, do make multiple projects using these topics. Feel free to use any architecture you like, pair it up with a local database, an API call to get the results from an API-Server, and anything else that you can think of.
Go on and implement something great, the only limit is your imagination.
References -
- https://github.com/futurice/android-best-practices
- https://github.com/skydoves/android-developer-roadmap
- https://developer.android.com/courses/android-basics-kotlin/course
Please Feel free to share your opinions in the comments.