Skip to content

Appcelerator Titanium Android module to access the native PackageManager and check whether a package is installed or an intent is available

License

Notifications You must be signed in to change notification settings

timanrebel/PackageManager

Repository files navigation

PaclageManager Module

Appcelerator Titanium module to check whether or not a package is install or an intent is available on Android

The module is licensed under the MIT license.

Referencing the module in your Titanium Mobile application

Simply add the following lines to your tiapp.xml file:

    <modules>
        <module platform="android">nl.rebelic.packagemanager</module> 
    </modules>

Example

Check whether a package is installed:

	var packageManager = require('nl.rebelic.packagemanager');
	Ti.API.info("module is => " + packageManager);

	var packageName = 'com.snowciety.app';
	Ti.API.info('Is '+packageName+' installed? ' + packageManager.isPackageInstalled(packageName));

Check whether an intent is available:

	var packageManager = require('nl.rebelic.packagemanager');
	Ti.API.info("module is => " + packageManager);

	var twitterIntent = Ti.Android.createIntent({
		action: Ti.Android.ACTION_SEND,
		type: 'application/twitter'
	});
	twitterIntent.putExtra(Ti.Android.EXTRA_TEXT, 'What a great module! http://github.com/Rebelic/PackageManager');

	Ti.API.info('Is Twitter intent available? ' + packageManager.isIntentAvailable(twitterIntent));

About

Appcelerator Titanium Android module to access the native PackageManager and check whether a package is installed or an intent is available

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published