5 Major Mistakes Android Developers Make With GitHub

Both new and advanced Android developers can make mistakes. Some of these mistakes are due to ignorance and naivety. Knowing about new trends and paradigms in mobile development is a part of a programmer’s due diligence and helps them become a better Android developer. Embracing best practices will result in creating better, robust and responsive apps. Here are five mistakes Android developers should stop making.

1) Not Knowing About Docker Android

Containers can be used to package the application and all its dependencies. Finding and running the desired version of the emulator can be very difficult. Docker Android provides a solution, we can build Android projects and run unit tests on them with the latest build tools in different emulators. UI tests and monkey tests can be run for Android apps with different frameworks such as appium, espresso and robotium.

Appium is a framework used to test both native and hybrid mobile applications. Appium can be dockerized (Docker-Appium). Multiple devices can be tested at the same time in the isolated containers to fasten the testing process. The advantages of using Docker Android include the ability to connect to Selenium Grid, screen-mirroring, ability to record video during tests for debugging and its easy integration with other cloud solutions such as Genymotion cloud. Additional test utilities such as SMS simulation are also available in Docker Android.

JFrog Artifactory is another tool used in DevOps to store build artifacts that have been created in the code pipeline. In Android CI/CD JFrog Artifactory offers a centralised binary repository for artifacts and project dependencies. JFrog is compatible with Docker Images among other DevOp technologies.

2) Not Performing Tests

Testing Android apps reveals minor bugs early enough and saves the developer the time of fixing major defects and breakages in the future. Running automated tests for Android code helps to catch bugs before they reach the end users. Unit testing, end-to-end testing and integration testing are the main testing strategies that Android developers often miss.

Code should be organized in modules for easy testing. Unit-tests should cover all possible scenarios of interaction such as invalid user inputs to eliminate ambiguity and malfunction. Even when using thoroughly-tested libraries like Jetpack UI libraries, developers should be careful not to leave out any unhandled cases especially during validation of user input. If an app uses coroutines, it is critical to write tests for units and modules that interact with flows such as asynchronous database streams.

3) Sticking to Deprecated Libraries and Functions

Certain libraries in the Android framework have been declared obsolete and legacy for years. Newer functions and libraries are being introduced with every subsequent update. A function with a strike-through decoration or a ‘deprecated’ annotation means there is a better-working piece of code.

Old tutorials from the internet may lead new developers into using deprecated dependency libraries. This may result in conflicts with the gradle and/or SDK versions or even break the code. Developers should develop the habit of reading official docs and using the latest stable releases of plugins and dependencies. While using deprecated libraries is discouraged, developers should also not write new code from scratch if a similar working solution already exists.

4) Not Using Material Design for UX

With the advancement in mobile technology, users expect equally advanced UI. Adopting Material design specifications helps create standard and attractive User Interface. Adhering to the most common UX patterns such as using Floating Action Buttons (FABs) for primary actions and other material components like bottom navigation bars and material buttons makes the designs compliant with Android UI best practice.

Material design comes with new features such as the z-property for view elevation and shadowing. It also has out-of-the-box animation APIs to improve user experience. Material components from the Android catalog have easily-obvious attributes which have been optimized therefore accelerating the UI design process. Just like xml styling, the new Jetpack Compose toolkit provides implementations of all material design components.

5) Not Knowing Kotlin

Kotlin is the official Android programming language. As much as Java is still a popular language in the native Android development space, Kotlin is slowly overtaking it with most of the new apps being written in Kotlin. Kotlin is faster and simpler to write than Java as it is less verbose and comes with tons of syntactic sugar. It has vast documentation and a fast-growing community to offer support to its developers.

Android apps originally written in Java are continually being migrated to Kotlin. Kotlin is totally interoperable with Java and module integration is very common. Developers who can code in both Kotlin and Java come in handy when testing and debugging collaborative inter-op projects.