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 cordova-plugin-startapp-zzz
Install:
cordova plugin add https://github.com/zhaozhanzhan/cordova-plugin-startapp-zzz.git
Delete:
cordova plugin rm cordova-plugin-startapp-zzz
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 = cordova"plugins""startApp";
Param | Description | Default | Values |
---|---|---|---|
noParse | Disable find action and category in Intent package | 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 = cordova"plugins""startApp";
cordova["plugins"]["startApp"].set()
return object:
sAppstart { /* success */ console;} { /* fail */ ;} { // optional broadcast and forResult callback console;};
or
sApp;
If success, values
contains data: versionName
, packageName
, versionCode
and applicationInfo
.
To get all extra fields use method extraFiels
:
cordova"plugins""startApp";
Variable fields
contains object array, example:
"extraKey1":"extraValue1" "extraKey2":"extraValue2"
To get one extra field use method getExtra
:
cordova"plugins""startApp";
Variable field
is a String.
Variable value
contains String value.
To has one extra field use method extraField
:
cordova"plugins""startApp";
Variable field
is a String.
Samples
Set application as only package name:
var sApp = cordova"plugins""startApp"start;
Set application as intent value and flag (issue):
var sApp = cordova"plugins""startApp"start;
Set application as package and activity:
var sApp = cordova"plugins""startApp"start;
Set application as action, package, type and Uri:
var sApp = cordova"plugins""startApp"start;
Start application with extra fields
var sApp = cordova"plugins""startApp"start;
Start listening broadcast
var sApp = cordova"plugins""startApp"; sApp;
Start application with result
var sApp = cordova"plugins""startApp"; sAppstart { // if receiver is registered console;} { console;} { // result message $messages;};
Send broadcast
var sApp = cordova"plugins""startApp"; sAppstart { console;} { console;};
Example, call skype:
cordova"plugins""startApp"start;
Example, call phone:
cordova"plugins""startApp"start;
Example, call browser:
cordova"plugins""startApp"start;
Example, call facebook:
cordova"plugins""startApp"start;
Example, call whatsapp:
cordova"plugins""startApp"start;
Example, call whatsapp chat:
cordova"plugins""startApp"start;
Example, call sms:
cordova"plugins""startApp"start;
Example, play mp4 video:
cordova"plugins""startApp"start;
Example, open contacts book:
cordova"plugins""startApp"start;
Example, open twitter:
cordova"plugins""startApp"start;
Example, open twitter user:
cordova"plugins""startApp"start;
Example, add alarm to alarm manager:
var sApp = cordova"plugins""startApp"; sAppstart { console;} { console;};
Use iOS
Set iOS application
var sApp = cordova"plugins""startApp";
return startApp
object:
sAppstart { /* success */ console;} { /* fail */ ;};
or
sApp;
=========================================== 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.