- 21 Dec 2023
- 2 Minuten zu lesen
- Drucken
- DunkelLicht
- pdf
Android SDK Quickstart
- Aktualisiert am 21 Dec 2023
- 2 Minuten zu lesen
- Drucken
- DunkelLicht
- pdf
Overview
In this guide, you will create a HelloWorld app using Android Studio and integrate the ScreenMeet Mobile SDK. You will be able to being streaming the app to the ScreenMeet session.
Prerequisites
Latest version of Android Studio is installed.
You have a Mobile API key generated for your organization.
You have access to create a remote support session for your organization either through Salesforce or the ScreenMeet Console.
Step 1 -- Launch Android Studio and create a new "Basic Activity" app.
Step 2 -- Fill in the details for the application name and click the "Finish" button.
Step 3 -- Find and edit your app/build.gradle file.
Step 4 -- Add the compiler compliance declaration
Note
It appears that this is already added in the latest Basic Activity template included with Android Studio. You may skip this step if it's already there.
// NEEDS TO BE SPECIFIED FOR SCREENMEET SDK
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
Step 5 -- Add the ScreenMeet maven repository.
repositories {
// NEEDED FOR SCREENMEET SDK
maven {
url "https://nexus.screenmeet.com/repository/maven-releases/"
}
}
Step 6 -- Add the ScreenMeet SDK dependency
// NEEDED FOR SCREENMEET SDK
implementation 'com.screenmeet:sdk:3.0.10'
Step 7 -- Sync the gradle file.
Step 8 -- Edit the MainActivity.java file and initialize the ScreenMeet SDK.
ScreenMeet.init(this.getApplicationContext(), new ScreenMeet.Configuration("YOUR API KEY"));
this.getApplication().registerActivityLifecycleCallbacks(ScreenMeet.activityLifecycleCallback());
Congratulations!
At this point, the SDK is integrated into your app. If you would like to start a session, let's add some functionality to that button...
Step 9 -- Show the session initiation dialog.
ScreenMeet.connect("YOUR SESSION CODE", new CompletionHandler() {
@Override
public void onSuccess() {
ScreenMeet.shareScreen();
ScreenMeet.shareAudio();
}
@Override
public void onFailure(@NotNull CompletionError completionError) {
//DO SOME ERROR HANDLING
}
});
Code Complete!
Your are now code complete! You just need to build/run the app on device or in the emulator.
Running your HelloWorld app
When your run your app should now see the HelloWorld app:
Input your session code and your app will now be streamed to the console on the other end.
Next Steps...
Explore our Android sample application to see some additional samples or visit our API documentation.