Skip navigation

JS API - for 0.2.18 firmware (pdf)

Android STBEmulator additional API

Application API for Android STB Emulator

Returns result of checking the specified application for existense on current device. app_name - full package name.

boolean isInstalled(String app_name)

Example:

var exist = gSTB.isInstalled("com.infomir.stbemul");

Run application if it exists. app_name - full package name.

void startApplication(String app_name)

Example:

gSTB.startApplication("com.infomir.stbemul");

Run application if it exists. app_name - full package name.

void startApplication(String app_name)

Example:

gSTB.startApplication("com.infomir.stbemul");

Install application with specified name from Google Play. app_name - full package name.

void installApplication(String app_name)

Example:

gSTB.installApplication("com.infomir.stbemul");

Install application from specified url. app_url - full address to apk-file of application.

void installApplicationByURL(String app_url)

Example:

gSTB.installApplicationByURL("http://mysite/apps/myApplication.apk");

Return stringified JSON array list of installed applications. Array contains application name, package name, and icons in available resolutions represented by base64 data.

String appsList()

Example:

var apps = JSON.parse(gSTB.appsList());
apps:
[
	{
		"name":"UHD Player",
		"packageName":"com.android.gallery3d",
		"image":{
			"120":"data:image\/png;base64,dI..CB",
			"160":"data:image\/png;base64,dI..CB",
			"213":"data:image\/png;base64,dI..CB",
			"240":"data:image\/png;base64,dI..CB",
			"320":"data:image\/png;base64,dI..CB",
			"480":"data:image\/png;base64,dI..CB"
		}
	}
]

Method to detect that current environment is emulator.

boolean isEmulator()

Example:

console.log('isEmulator' in gSTB);
Need Help

Dave is an expert on the MAG STB and the author of this article.

Was this article helpful?

Yes No

Sorry to hear that.
How can we improve this article?

We use cookies in order to optimise our website, provide you with the best possible user experience and help us promote our products. Please read our Cookie Policy to find out how we use cookies and how you can control cookies.
By using this website or closing this message, you acknowledge our Privacy Policy and agree to our use of cookies as described in our Cookie Policy.