npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-startapp

v0.1.6

Published

Phonegap plugin for check or launch other application in android device.

Downloads

68

Readme

cordova plugin startapp

Phonegap plugin for check or launch other application, get extras in phonegap app.

Install: cordova plugin add com.lampa.startapp

Install: cordova plugin add https://github.com/lampaa/com.lampa.startapp.git

Delete: cordova plugin rm com.lampa.startapp

Delete previos version: cordova plugin rm org.apache.cordova.startapp

Manually installation for Android.

NEW! Script builder. Create script with UI builder.

ANDROID

To run other application, you need to build data:

var sApp = startApp.set({} params [, {} extras]);

| Param | Description | Default | Values | | --- | --- | --- | --- | | intent | Intent(String action)) | null | String | | application | Intent (Context packageContext) | null | String | | action | Intent setAction | null | String | | action | Intent setAction | null | String | | category | Intent addCategory | null | String | | type | Intent setType | null | String | | package | Intent setPackage | null | String | | uri | [Intent Uri](http://developer.android.com/intl/ru/reference/android/content/Intent.html#Intent(java.lang.String, android.net.Uri)) | null | String | | flags | Intent setFlags | null | String | | component | Intent setComponent | null | String | | intentstart | set type of start intent | startActivity | startActivity, startActivityForResult, sendBroadcast |

Extras as a set of key-value:

{
	"key1":"value1",
    "key2":"value2"
}

Example

var sApp = startApp.set({ /* params */
	"action":"ACTION_MAIN",
	"category":"CATEGORY_DEFAULT",
	"type":"text/css",
	"package":"com.lampa.startapp",
	"uri":"file://data/index.html",
	"flags":["FLAG_ACTIVITY_CLEAR_TOP","FLAG_ACTIVITY_CLEAR_TASK"],
	"component": ["com.app.name","com.app.name.Activity"],
	"intentstart":"startActivity",
}, { /* extras */
	"EXTRA_STREAM":"extraValue1",
	"extraKey2":"extraValue2"
});

startApp.set() return object:

sApp.start(function() { /* success */
	console.log("OK");
}, function(error) { /* fail */
	alert(error);
});

or

sApp.check(function(values) { /* success */
	console.log(values);
}, function(error) { /* fail */
	alert(error);
});

If success, values contains data: versionName, packageName, versionCode and applicationInfo.

To get all extra fields use method extraFiels:

startApp.extraFields(function(fields) { /* success */
	console.log(fields);
}, function() { /* fail */

});

Variable fields contains object array, example:

{
	"key1":"value1",
    "key2":"value2"
}

To get one extra field use method getExtra:

startApp.getExtra(field, function(value) { /* success */
	console.log(fields);
}, function() { /* fail */

});

Variable field is a String. Variable value contains String value.

To has one extra field use method extraField:

startApp.hasExtra(field, function() { /* success */
	console.log(fields);
}, function() { /* fail */

});

Variable field is a String.

Samples

Set application as only package name:

var sApp = startApp.set({
	"application":"com.application.name"
});

Set application as intent value and flag (issue):

var sApp = startApp.set({
	"intent": "com.shazam.android.intent.actions.START_TAGGING",
	"flags": ["FLAG_ACTIVITY_NEW_TASK"]
}); 

Set application as package and activity:

var sApp = startApp.set({
	"component": ["com.app.name","com.app.name.Activity"]
});

Set application as action, package, type and Uri:

var sApp = startApp.set({ /* params */
	"action":"ACTION_MAIN",
	"type":"text/css",
	"package":"com.lampa.startapp",
	"uri":"file://data/index.html"
});

Start application with extra fields

var sApp = startApp.set({ /* params */
	"component": ["com.app.name","com.app.name.Activity"]
}, { /* extras */
	"extraKey1":"extraValue1",
	"extraKey2":"extraValue2"
});

Example, call skype:

startApp.set({ /* params */
	"action": "ACTION_VIEW",
	"uri": "skype:+79109999999"
}).start();

Example, call phone:

startApp.set({ /* params */
	"action": "ACTION_CALL",
	"uri": "tel:+79109999999"
}).start();

Example, call browser:

startApp.set({ /* params */
	"action": "ACTION_VIEW",
	"uri": "https://github.com/lampaa"
}).start();

Example, call facebook:

startApp.set({ /* params */
	"action": "ACTION_VIEW",
	"uri": "fb://facewebmodal/f?href=https://www.facebook.com/GitHub"
}).start();

Example, call whatsapp:

startApp.set({ /* params */
	"action": "ACTION_SEND",
	"package": "com.whatsapp",
	"type": "text/plain"
}, {
	"android.intent.extra.TEXT":"Text..."
}).start();

Example, call whatsapp chat:

startApp.set({ /* params */
	"action": "ACTION_SEND",
	"package": "com.whatsapp",
	"type": "text/plain",
	"uri": "+79123456789"
}, {
	"EXTRA_TEXT":"Text...",
	"chat": true
}).start();

Example, call sms:

startApp.set({ /* params */
	"action": "ACTION_MAIN",
	"category": "CATEGORY_DEFAULT",
	"type": "vnd.android-dir/mms-sms"
}).start();

Example, play mp4 video:

startApp.set({ /* params */
	"action": "ACTION_VIEW",
	"uri": "http://domain.com/videofile.mp4",
	"type": "video/mp4"
}).start();

Example, open contacts book:

startApp.set({ /* params */
	"action": "ACTION_PICK",
	"uri": "ContactsContract.Contacts.CONTENT_URI",
	"intentstart":"startActivityForResult"
}).start();

Use iOS

Set iOS application

var sApp = startApp.set("twitter://");

return startApp object:

sApp.start(function() { /* success */
	console.log("OK");
}, function(error) { /* fail */
	alert(error);
});

or

sApp.check(function(values) { /* success */
	console.log(values);
}, function(error) { /* fail */
	alert(error);
});

=========================================== Tags:

Cordova start external application. Android open an external application. Phonegap start external application. Launching External Intents Works on Cordova. Android launch external activities. Android check app availability. Android launch application with parameters.

Prose