With Android Jumpstart, we want to zero down the scaffolding time for Android apps. Most apps we work on share the same boilerplate code, including
- Declaring dependencies
- Auto-increment version code
- Setting up Retrofit for API interaction
- Setting up Dagger for dependency injection
- Setting up common utility classes
- Creating a mocking framework for testing
Jumpstart takes care of all this, and more. Jumpstart adds support for many commonly used libraries,
Setting up is really easy, there's a python script here that clones the Jumpstart repo, changes the project name and package name. All the developer needs to after this is the update the API urls and they have a base project ready.
How to use
Make your activities extend one of
(all of which subclass
AppCompatActivity) depending on your requirements. This gives you access
APIService which is injected into the BaseActivities.
Setting up the Navigation Drawer
The BaseDrawerActivity handles the Navigation Drawer setup, and the DrawerActionToggle. You can
customize the drawer menu by modifying the file
Setting up the toolbar
The BaseToolbarActivity handles setting up the toolbar and the home as up button. Simply have your classes extend this and there's no need to worry about the toolbar.
TODO Add information about FragmentTransactionHandler
BaseFragment gives you access to
apiService. It also adds
utility methods to show and hide progress dialogs.
// Show loading dialog showLoadingDialog(R.string.loading_message); // Hide loading dialog cancelLoadingDialog();
A very common requirement in an app is to show a loading dialog. When you just need to show a simple dialog with a title and a message, use the LoadingDialog class as
LoadingDialog.newInstance(title, description, showCancelButton);
The retrofit configuration is done here.
Jumpstart adds four build types by default, debug, debugProd, release, releaseProd. You should configure these as per your requirements.