Application Note App Interface
AN 1105 v1.0 | 3/3
Implementing the launch of the app
MobileConnect/CinemaConnect
Google Android - How to launch the MobileConnect app or the
Play Store to download it
An Androip app that wants to launch MobileConnect has to execute the following lines of code:
String appPackageName = “de.sennheiser.sst.mobileconnect”;
Intent launchIntent = getPackageManager().getLaunchIntentForPackage(app-
PackageName);
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (launchIntent != null) {
startActivity(launchIntent);
}
else {
try {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(“market://details?id=” + appPackageName)));
}
catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(“https://play.google.com/store/apps/details?id=” +
appPackageName)));
}
}
The code tries to create an intent to launch the package de.sennheiser.sst.mobileconnect. If the
intent can not be created we assume that MobileConnect is not installed and redirect the user to
the MobileConnect page in the Play Store.
Return to the launching app
This should be done with the back button. Android users are used to the back button functionality.



