Description

AppRollout Android SDK Documentation

Overview

The AppRollout Android SDK allows Android developers to easily integrate AppRollout features into their applications. This SDK helps in managing and automating app rollout processes, improving version control, and simplifying app updates.

Installation

Step 1: Add the SDK to your project

To add the AppRollout SDK to your Android project, include the following line in your app-level build.gradle file under dependencies:

implementation 'com.approllout.android-sdk:approllout-sdk:1.0.0'

Step 2: Sync the project with Gradle files

Once you've added the dependency, sync your project with Gradle to download the SDK and its dependencies.

Setup

Step 1: Initialize the SDK

To initialize the AppRollout SDK, add the following code to your MainActivity or Application class:

import com.approllout.sdk.AppRollout;
    
    public class MyApplication extends Application {
        @Override
        public void onCreate() {
            super.onCreate();
            // Initialize AppRollout SDK with your API key
            AppRollout.initialize(this, "YOUR_API_KEY");
        }
    }

Features

  • Automatic Rollout: Automatically manage and rollout app updates to users.
  • Version Control: Keep track of different app versions and handle their updates smoothly.
  • User Notifications: Notify users when a new update is available and manage updates accordingly.

Usage

Check for updates

To check for app updates, use the following method:

AppRollout.checkForUpdates(new AppRollout.UpdateCallback() {
        @Override
        public void onUpdateAvailable(String newVersion) {
            // Handle update available logic here
        }
    
        @Override
        public void onUpToDate() {
            // Handle app is up-to-date logic here
        }
    });

Trigger a manual update

You can trigger an update manually like this:

AppRollout.triggerUpdate();

Error Handling

If an error occurs while checking for updates or managing the rollout, the SDK provides error callbacks to handle different cases. Use the following:

AppRollout.setErrorCallback(new AppRollout.ErrorCallback() {
        @Override
        public void onError(String errorMessage) {
            // Handle error
            Log.e("AppRollout", errorMessage);
        }
    });

Example Code

import com.approllout.sdk.AppRollout;
    
    public class MainActivity extends AppCompatActivity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            // Initialize AppRollout SDK
            AppRollout.initialize(this, "YOUR_API_KEY");
    
            // Check for updates
            AppRollout.checkForUpdates(new AppRollout.UpdateCallback() {
                @Override
                public void onUpdateAvailable(String newVersion) {
                    // Inform the user about the new version
                    Log.d("AppRollout", "New update available: " + newVersion);
                }
    
                @Override
                public void onUpToDate() {
                    // Inform the user that the app is up to date
                    Log.d("AppRollout", "App is up-to-date");
                }
            });
        }
    }

Contact & Support

For any issues or questions, please contact our support team at support@approllout.com.