This is a collection of commonly used functions in Android apps from BaltiApps.
Feel free to use and contribute.
App should have an "app instance class" extending Application class.
That class should be registered in the android:name component of the application manifest.
Example:
class AppInstance: Application() {
...
}
<manifest ...>
<application
...
android:name=".AppInstance">
...
</application>
</manifest>
- Clone this repo/download as zip and extract.
- In your Android Studio project, goto
File -> New -> Import module - Navigate to the the extracted folder and click
Ok
Verification: go tobuild.gradleof yourappmodule and check if dependencies have this:Go toimplementation project(path: ':baltitoolbox')settings.gradlefile and check if the module is included:include ':app', ':baltitoolbox' - Register the
initfunction inonCreateof your app instance classimport balti.module.baltitoolbox.ToolboxHQ class AppInstance: Application() { ... override fun onCreate() { ... ToolboxHQ.init(this) } } - Done! Now you can use this library
All functions are "static". Hence they can be used from anywhere in the app.