The Be-Bound Developer Hub

Welcome to the Be-Bound developer hub. You'll find comprehensive guides and documentation to help you start working with Be-Bound as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Getting started

Requirements

  • IDE: Android Studio.
  • Languages: java and kotlin.
  • Android KitKat API level 19.
  • A Be-Bound Manifest.
  • Be-Bound Credentials.

📘

Be-Bound Manifest Dependency

  • Check the steps required to create a Be-Bound Manifest on Be-Bound Console here.

  • Check how to create a good Be-Bound Manifest here.

1. Add your Be-Bound Manifest

Add your Be-Bound Manifest file at the root of your application (at the same level of <ProjectRoot>/<ModuleRoot>/build.gradle).

2. Download the SDK

To download the Be-Bound SDK, add the following dependency in your gradle (<ProjectRoot>/build.gradle):

buildscript {
    ...
    repositories {
        google()
        jcenter()
        maven {
            url 'https://sdk.be-bound.com/artifactory/external-release-v7'
            credentials {
                username 'Your Maven User'
                password 'Your Maven Password'
            }
        }
    }
    dependencies {
        ...
        classpath 'Import provided by Be-Bound'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://sdk.be-bound.com/artifactory/external-release-v7'
            credentials {
                username 'Your Maven User'
                password 'Your Maven Password'
            }
        }
        maven {
            url 'URL provided by Be-Bound'
            credentials {
                username 'Your Maven User'
                password 'Your Maven Password'
            }
        }
    }
    ...
}

Then, in the module where you want to import the Be-Bound SDK (<ProjectRoot>/<ModuleName>/build.gradle):

apply plugin: 'com.bebound.generator'

augmentedApp {
    appName = "Your Project Name" // You can find it on Be-Bound Console
    appPackage = "com.example.generated" // Where you want the generated classes to be stored
    manifestPath = "./manifest.xml" // Where the Be-Bound Manifest was stored in the previous step "1. Add your Be-Bound Manifest"
}

android {
    compileSdkVersion 28 //Example; use the latest one.
    ...
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

dependencies {
    ...
    api 'com.be-bound:sdk:XXXXXX'// This value is provided by Be-Bound
    ...
}

📘

Android SDK Documentation

The Java/Kotlin documentation of the android SDK is accessible here

3. Classes Generation

Be-Bound SDK include a code generator. The code generator will analyze your Be-Bound Manifest to create a Java Class for each Message. Consequently, each generated class corresponds to one Message.

📘

Generated classes are used to create Message objects and are easily usable to create a Request, to handle a Response or a Push.

You can start the scrip at Gradle tab / Your Project name / app / augmentedapp / generateClasses

Gradle task: Classes Generation in detail

To run the generateClasses script, right click on the gradle task and click on the command "Run" in the appearing menu.

This action will generate the classes and locate them in the path your provided in the app build gradle (see step 2. Downloading the SDK).

augmentedApp {
    ...
    appPackage = "com.example.generated" // Where the autogenerated classes are stored
    ...
}

📘

You have to execute this Gradle Script each time you modify your Be-Bound Manifest.

4. Ask for permissions

The Be-Bound SDK requires permissions. Make sure your application asks for them.

The complete list of permission required is:
Manifest.permission.RECEIVE_SMS, Manifest.permission.READ_SMS, Manifest.permission.READ_PHONE_STATE, Manifest.permission.SEND_SMS, Manifest.permission.INTERNET

You can ask for these permissions like this:

private val permissions = arrayOf(
        Manifest.permission.RECEIVE_SMS,
        Manifest.permission.READ_SMS,
        Manifest.permission.READ_PHONE_STATE,
        Manifest.permission.SEND_SMS,
        Manifest.permission.INTERNET
 )
  
  override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        if (Build.VERSION.SDK_INT >= 23) {
            ensurePermissions(*permissions)
        }
  }
  
  @TargetApi(23)
    private fun ensurePermissions(vararg permissions: String) {
        var request = false
        for (permission in permissions) {
            if (checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
                request = true
                break
            }
        }
        if (request) {
            requestPermissions(permissions, requestCodePermission)
        }
   }

Don't forget to add these permissions in your AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
(...)
<application
        android:name="PUT_YOUR_APPLICATION_CLASS_HERE"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        (...)
</application>
(...)

See more details about permissions here

Updated about a year ago

Getting started


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.