SDK Integration

MicroBrew's lightwieght SDKs are compatible Android by having a universal framework. We wanted to give an easy way to access our API with a SDK that you can place in any App or Library you create. file_download Github


Android Native Integration

free_breakfast 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.

priority_highImportant: 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();
      }
  }
});


                  

App Data API Calls

Call the MicroBrew API to gather App Store Metadata


  // Call to get app data with its Bundle ID, this uses the default platform(Google) and country(US), 
  MicroAPI.GetAppWithBundleID("com.company.exampleapp", new MicroBrewAppRequestCallback() {
    @Override
    public void onFinished(JSONObject jsonObject) {
        //Use the retrieved data here
    }
  });

  // Call to get app data with a Apple App ID
  MicroAPI.GetAppWithAppID("12345678", new MicroBrewAppRequestCallback() {
    @Override
    public void onFinished(JSONObject jsonObject) {
        //Use the retrieved data here
    }
  });

  // Call to get app data with its Bundle ID from a seperate platform, available platforms are Google and iOS
  MicroAPI.GetAppWithBundleID("com.company.exampleapp", "ios", new MicroBrewAppRequestCallback() {
    @Override
    public void onFinished(JSONObject jsonObject) {
        //Use the retrieved data here
    }
  });

  // Call to get app data with its Bundle ID from a seperate platform and a different country
  MicroAPI.GetAppWithBundleID("com.company.exampleapp", "ios", "GB", new MicroBrewAppRequestCallback() {
    @Override
    public void onFinished(JSONObject jsonObject) {
        //Use the retrieved data here
    }
  });

  // Call the same for AppIDs 
  MicroAPI.GetAppWithAppID("12345678", "GB", new MicroBrewAppRequestCallback() {
    @Override
    public void onFinished(JSONObject jsonObject) {
        //Use the retrieved data here
    }
  });

                  

Data Returned in Dictionary

Check out the API docs to see differences in responses for each platform and MicroBrew User types.


  {
    "timestamp": "2021-09-12T04:19:52.849Z",
    "apps_requested": [
        "com.companyname.exampleapp",
        "com.secondcompany.exampleapp"
    ],
    "data": [
        {
            "bundle_id": "com.companyname.exampleapp",
            "country": "us",
            "platform": "google",
            "app_privacy_policy": "",
            "app_size": "154M",
            "app_version": "1.1.1",
            "avg_rating": 4.32,
            "contains_ads": true,
            "contains_iap": true,
            "content_ratings": [
                "Teen",
                "Violence, Blood, Rabits"
            ],
            "description": "He who is valient and pure of spirit may find the holy grail in the castle of AAAUUUUGGGGHHHH.....",
            "developer_address": "Camelot Castle, Britain",
            "developer_email": "arthur@knight-o-table.com",
            "developer_name": "Knights Who Say NI!,
            "developer_website": "EKKI-EKKI-EKKI-PIANG.ZOOM-BOING",
            "genres": [
                "Action"
            ],
            "key_words": [
                "candies",
                "craving",
                "purchases",
                "crush",
                "going",
                "tasty",
                "candy",
                "combos",
                "king",
                "game",
                "boosters"
                ...
            ]
            "icon": "icon-url.somewhere",
            "installs_amount": "50001-100000",
            "ios_app_id": "",
            "last_update_message": "Bug fixes - added coconuts",
            "last_updated": "April 13, 2021",
            "rating_count": 0,
            "screenshots": [
                "some-url.to_the_appstores",
                ...
            ],
            "store_name": "Journey for the Holy Grail",
            "app_state": "available",
            "pricing": "free"
        },
        {
            "bundle_id": "com.companyname.exampleapp",
            "country": "us",
            "platform": "google",
            ...
        }
    ]
}