3. Installing the Bayun SDK

3.1 Adding the Bayun SDK

  • Copy the bayun-android-sdk.jar file into the /libs directory of your Android Studio application.
  • Navigate to the JAR file in the Android Studio navigator, right-click and select “Add As A Library…”.
  • Navigate to your build.gradle file and ensure that you include the following:
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])


The Bayun Android SDK requires some permissions and references from your app’s AndroidManifest.xml file. These permissions allow the SDK to monitor network state.

<!-- Standard permissions -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

The Bayun Android SDK contains a service and an activity that must be declared in your app's AndroidManifest.xml file, for it to work.

<!-- Declare Bayun SDK's background service -->
service android:name="com.bayun_module.BayunBackgroundService"/>
<!-- Declare Bayun SDK's background activity for screen locks -->
service android:name="com.bayun_module.EmptyActivity"/>

results matching ""

    No results matching ""