Android Native Integration
Before you start: MicroBrew supports Android API Version 21.0 and above.
1: Import MicroBrew Android '.aar' Library, "MicroBrewSDK-Release.aar", to your project
To import the library file go to File -> and select "Project Structure", select "Dependencies" and hit the "+" in Modules.
Pick to import .JAR/.AAR Package, and route to where you have the MicroBrew Library.
To implement the dependency in your project hit the "+" button in "Declared Dependencies" and select to add a Module Dependency, then just select the MicroBrewSDK-release.
Important: Initialize MicroBrew. MicroBrew SDK does not support offline event caching.
2: Go to your MicroBrew Dashboard
Go to your profile on the MicroBrew dashboard and find your API Key listed on the dashboard.
3: Input user email & API key
Inside your code, start initializing MicroBrew have your email and API Key on hand.
4: Manually initialize MicroBrew
Whenever using the MicroBrew Library make sure to import "com.bytebrew.microbrewsdk".
import com.bytebrew.microbrewsdk.*;
...
// Initialize MicroBrew
MicroAPI.InitWithEmailAndKey("EMAIL", "API_KEY");
//Track when a initialization or authentication state changes
MicroAPI.InitializationStateChanged(new MicroAPIAuthStateChange() {
@Override
public void onChange(boolean b) {
if(b) {
GetData();
}
}
});