CategoryAndroid Application Developpement

Testing on Android – A practical approach

Testing an application is very important. It may serve a lot of purposes such as be sure some features are correctly working, put in confiance other developers in modifying legacy code, or even development technics like TDD. However testing on Android evolved quite quickly recently,  a lot of new tools have to be considered, and the platform itself make testing on Android quite a challenge.

[Edit] I wont write any part 2 about using emulators for now, since the new official emulator has been released. For now it can not be used in CI since it does not support headless mode yet. More than that, Clean Architecture is taking a huge step forward lately (like Android-CleanArchitecture, or Ribot app). This kind of architecture let us minimize the dependency to the Android framework, and thus allow us to write a lot more pure Java tests.

About writing, debugging, and getting result from tests using AS, the official documentation from Google about testing has been fully rewritten. I encourage you to refer to it.

I may however write posts about specific cases of testing using Clean Architecture, based on RX Android and Dagger 2. [End of edit]

Continue reading

Android Dual Cache

I just released the version 2.0.0 of my Android library for caching. Tired to choose between DiskLruCache and LruCache ? Simply use this android lib and get the best of disk and RAM caching.

Continue reading

How to build customized Android application using Gradle

In this article, I will present a totally new feature introduced by Gradle (in comparison with Ant) : the ability to build an app against different environments. I mean to be able to have (almost) the same flexibility as C preprocessor directives, giving us the ability to provide specific resources, or even classes, for a specific environment.

Continue reading

How to improve quality and syntax of your Android code

In this article, I will present different ways of improving your Android code with automatic tools such as Checkstyle, Findbugs,  PMD, and of course Android Lint. Test your code in an automated way can be very useful, especially when you are working with teammates, in order to maintain a rigorous syntax through your code, and avoid a lot of bad practices and errors. I will explain precisely how to use these tools directly through your Gradle build script, and how to configure them at your convenience.

Continue reading

© 2016 Vincent Brison

Theme by Anders NorenUp ↑

Fork me on GitHub