All Projects → lampaa → Com.lampa.startapp

lampaa / Com.lampa.startapp

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

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Com.lampa.startapp

Corber
CLI for building hybrid apps with Ember/Vue/Glimmer/Cordova
Stars: ✭ 327 (+57.21%)
Mutual labels:  phonegap
Duckietv
A web application built with AngularJS to track your favorite tv-shows with semi-automagic torrent integration
Stars: ✭ 942 (+352.88%)
Mutual labels:  phonegap
Framework7 Cli
Framework7 command line utility
Stars: ✭ 76 (-63.46%)
Mutual labels:  phonegap
Cordova Plugin Googleplus
➕ Cordova plugin to login with Google Sign-In on iOS and Android
Stars: ✭ 537 (+158.17%)
Mutual labels:  phonegap
Cordova Plugin Linkedin
Cordova plugin for LinkedIn
Stars: ✭ 17 (-91.83%)
Mutual labels:  phonegap
Cordova Plugin Tensorflow
On-device image recognition via TensorFlow/Inception. For Cordova/PhoneGap.
Stars: ✭ 51 (-75.48%)
Mutual labels:  phonegap
Cordova Plugin Native Keyboard
🎹 Add a Slack / WhatsApp - style chat keyboard to your Cordova app!
Stars: ✭ 271 (+30.29%)
Mutual labels:  phonegap
Involt
Inject hardware interactions directly into HTML layout.
Stars: ✭ 128 (-38.46%)
Mutual labels:  phonegap
Starioplugin
Star Micronics printer phonegap/cordova plugin
Stars: ✭ 20 (-90.38%)
Mutual labels:  phonegap
Countly Sdk Cordova
Countly Product Analytics SDK for Cordova, Icenium and Phonegap
Stars: ✭ 69 (-66.83%)
Mutual labels:  phonegap
Cordova Template Framework7 Vue Webpack
Framework7 - Vue - Webpack Cordova Template with Webpack Dev Server and Hot Module Replacement
Stars: ✭ 630 (+202.88%)
Mutual labels:  phonegap
Hiapp
A simple and interesting hybrid app. React Native version: http://t.cn/R5LqqLz Demo:
Stars: ✭ 791 (+280.29%)
Mutual labels:  phonegap
Cordova Plugin Getuisdk
个推官方提供的推送SDK PhoneGap(Cordova) 插件(支持 Android & iOS)
Stars: ✭ 65 (-68.75%)
Mutual labels:  phonegap
Toast Phonegap Plugin
🍻 A Toast popup plugin for your fancy Cordova app
Stars: ✭ 503 (+141.83%)
Mutual labels:  phonegap
Framework7 Template Vue Simple
Deprecated! Simple Framework7 Vue starter app template in a single HTML file
Stars: ✭ 81 (-61.06%)
Mutual labels:  phonegap
Framework7
Full featured HTML framework for building iOS & Android apps
Stars: ✭ 16,560 (+7861.54%)
Mutual labels:  phonegap
Blinkid Cordova
ID scanning for cross-platform apps built with Cordova and Phonegap.
Stars: ✭ 44 (-78.85%)
Mutual labels:  phonegap
Cordova Plugin Googlemaps
Google Maps plugin for Cordova
Stars: ✭ 1,647 (+691.83%)
Mutual labels:  phonegap
Intercom Cordova
Cordova/PhoneGap plugin for Intercom
Stars: ✭ 88 (-57.69%)
Mutual labels:  phonegap
Cordovue
A sample Apache Cordova application using VueJS.
Stars: ✭ 66 (-68.27%)
Mutual labels:  phonegap

cordova plugin startapp

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

Last version 6.1.6

  • Add support java 1.6
  • Add support java 1.7
  • Add full support activityForResult, sendBroadcast and RegisterReceiver.
  • Add types of extras.

Install

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 previous 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
noParse Disable find action and category in Intent package false Boolean
matchDoubleInString Match Double type in string extras (usefull for coordinates, prices etc.) false Boolean
intent Intent(String action) null String
application Intent (Context packageContext) 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 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", // String
    "key2": "value2", // String
    "key3": 100, // Integer,
    "key4": true // Boolean
}

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":100500
});

startApp.set() return object:

sApp.start(function() { /* success */
	console.log("OK");
}, function(error) { /* fail */
	alert(error);
}, function() { // optional broadcast and forResult callback
	console.log(arguments);
});

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:

{
	"extraKey1":"extraValue1",
	"extraKey2":"extraValue2"
}

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"
}).start();

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"]
}).start();

Set application as package and activity:

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

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();

Start application with extra fields

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

Start listening broadcast

var sApp = startApp.set(["RECEIVER_NAME"]);

sApp.receiver(function(compete) { // if receiver is registered
	$messages.prepend("<div>id broadcast: " + compete + "</div>");
}, function(error) {
	$messages.prepend("<div class='err'>" + error + "</div>");
}, function(action, extras) { // receiver message
	$messages.prepend("<div>" + action + ", " + JSON.stringify(extras)  + "</div>");
});

Start application with result

var sApp = startApp.set({
	"action":"ACTION_MAIN",
	"package":"com.lampa.startapp",
	"intentstart":"startActivityForResult",
});

sApp.start(function(compete) { // if receiver is registered
	console.log(compete);
}, function(error) {
	console.error(error);
}, function(result, requestCode, resultCode) { // result message
	$messages.prepend("<div>" + JSON.stringify(result) + ", " + requestCode + ", " + resultCode + "</div>");
});

Send broadcast

var sApp = startApp.set({ /* params */
	"action":"RECEIVER_NAME",
	"intentstart":"sendBroadcast",
	"noParse": true // disable parse action value
}, {
	"extraKey1":"extraValue1",
	"extraKey2":"extraValue2"
});

sApp.start(function(compete) {
	console.log(compete);
}, function(error) {
	console.error(error);
});

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();

Example, open twitter:

startApp.set({ /* params */
	"application": "com.twitter.android"
}).start();

Example, open twitter user:

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

Example, add alarm to alarm manager:

var sApp = startApp.set({ /* params */
    "action":"android.intent.action.SET_ALARM",
    "noParse": true
}, {
    "android.intent.extra.alarm.MESSAGE":"New Alarm",
    "android.intent.extra.alarm.HOUR":17,
    "android.intent.extra.alarm.MINUTES": 30
});

sApp.start(function(success) {
    console.log(success);
}, function(error) {
    console.error(error);
});

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].