When you're starting to write an app, there are certain classes, methods and lines of code you implement over and over. So, I thought I should have base template usable across all my apps. I hope to write an Android Studio plugin to generate this automatically later in the future.
This template contains some of my favourite packages, config, classes and methods. In my research, I found alot of boiler plate templates, some of which I adapted some techniques and structures from. This is still under development, and many ideas were sourced from various places.
##Features
- Dependency Injection using Dagger: This section is still not fully developed; I'm just wrapping my head around DI with dagger
Navigator
class to handle Navigation.MediaPickerFragment
(with Android Marshmallow Permission).- Base classes -
BaseActivity
,BaseFragment
,BasePresenter
- Util classes & methods
AppUtils
with the following util methods:getAppVersion()
isTablet()
isServiceRunning()
hideKeyboard()
BitmapUtils
with the following util methods:decodeBitmapFromStream()
calculateInSampleSize()
DateUtils
with the following util methods:getDay()
getMonthShort()
getMonth()
DeviceUuidFactory
to retrieve the device id of the device.DialogUtils
ListUtils
Logger
- for logging. Different fromandroid.util.Log
by a flagDEBUG_ON
which you can use to toggle whether or not you want to show the logNetworkUtils
with the following util methods:isNetworkConnected()
PreferenceUtils
- very much like a Preference manager for your SharedPreferencesStringUtils
- String utils with the following util methods:isEmpty()
- that returns true if the String is null, empty or "null"nullify()
- to return the value of a string or null if the string is empty
UriUtils
- utils to convert a URI to a file path. This is useful when you're picking files from the device. File picking is fragmented and occurs differently on different versions of Android. This class helps to convert such into file paths.
##Usage This part is still work in progress :)
##Todo
- Add Usage
- Add testing templates
- Write AndroidStudio/IntelliJ template to automatically crate this, with the correct package name