Merge remote-tracking branch 'origin/master'

This commit is contained in:
Roman 2015-01-20 12:45:38 +03:00
parent 51e1071fe6
commit bfd1908ea0
7 changed files with 94 additions and 144 deletions

View File

@ -1,14 +1,12 @@
cordova-plugin-startapp # Upd 18.12.2014 cordova-plugin-startapp # Upd 18.12.2014
=========================================================================== ===========================================================================
Phonegap 3.x.x plugin for check or launch other application in android device. Phonegap 3.x.x plugin for check or launch other application in android device.
Install: ```cordova plugin add https://github.com/lampaa/org.apache.cordova.startapp.git``` Install: ```cordova plugin add https://github.com/lampaa/com.lampa.startapp.git```
Delete: ```cordova plugin rm org.apache.cordova.startapp``` Delete: ```cordova plugin rm com.lampa.startapp```
Manually installation for Android: Manually installation for Android:
```on progress...``` ```on progress...```
@ -31,11 +29,11 @@ function(error) { /* error */
_Start application without parameters_ _Start application without parameters_
```js ```js
navigator.startApp.start("com.app.name", function(message) { /* success */ navigator.startApp.start("com.application.name", function(message) { /* success */
console.log(message); // => OK console.log(message); // => OK
}, },
function(error) { /* error */ function(error) { /* error */
console.log('47', error); console.log(error);
}); });
``` ```

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="org.apache.cordova.startapp" id="com.lampa.startapp"
version="0.3.0"> version="0.0.4">
<name>startApp</name> <name>startApp</name>
<description>Cordova startApp Plugin</description> <description>Phonegap 3 plugin for check or launch other application in android device.</description>
<license>Apache 2.0</license> <license>MIT</license>
<keywords>cordova,startapp</keywords> <keywords>cordova,startapp,lampa</keywords>
<js-module src="www/startApp.js" name="startapp"> <js-module src="www/startApp.js" name="startapp">
<merges target="navigator.startApp" /> <merges target="navigator.startApp" />
@ -17,25 +17,24 @@
<platform name="android"> <platform name="android">
<config-file target="res/xml/config.xml" parent="/*"> <config-file target="res/xml/config.xml" parent="/*">
<feature name="startApp"> <feature name="startApp">
<param name="android-package" value="org.apache.cordova.startapp.startApp"/> <param name="android-package" value="com.lampa.startapp.startApp"/>
</feature> </feature>
</config-file> </config-file>
<source-file src="src/android/startApp.java" target-dir="src/org/apache/cordova/startapp" /> <source-file src="src/android/startApp.java" target-dir="src/com/lampa/startapp" />
</platform> </platform>
<platform name="ios"> <platform name="ios">
<config-file target="config.xml" parent="/*">
<config-file target="config.xml" parent="/*"> <feature name="startApp">
<feature name="startApp"> <param name="ios-package" value="startApp"/>
<param name="ios-package" value="startApp"/> </feature>
</feature> </config-file>
</config-file>
<header-file src="src/ios/startApp.h"/>
<header-file src="src/ios/startApp.h"/> <source-file src="src/ios/startApp.m"/>
<source-file src="src/ios/startApp.m"/> </platform>
</platform>
</plugin> </plugin>

View File

@ -1,22 +1,11 @@
/* /**
Licensed to the Apache Software Foundation (ASF) under one com.lampa.startapp
or more contributor license agreements. See the NOTICE file https://github.com/lampaa/com.lampa.startapp
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file Phonegap 3 plugin for check or launch other application in android device (iOS support).
to you under the Apache License, Version 2.0 (the bug tracker: https://github.com/lampaa/org.apache.cordova.startapp/issues
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/ */
package org.apache.cordova.startapp; package com.lampa.startapp;
import org.apache.cordova.CallbackContext; import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin; import org.apache.cordova.CordovaPlugin;
@ -67,10 +56,7 @@ public class startApp extends CordovaPlugin {
* startApp * startApp
*/ */
public void start(JSONArray args, CallbackContext callback) { public void start(JSONArray args, CallbackContext callback) {
/**
* arguments
* ['com.application.name']
*/
String com_name = null; String com_name = null;
String activity = null; String activity = null;
Intent LaunchIntent; Intent LaunchIntent;

View File

@ -1,36 +1,22 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one com.lampa.startapp
or more contributor license agreements. See the NOTICE file https://github.com/lampaa/com.lampa.startapp
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file Phonegap 3 plugin for check or launch other application in android device (iOS support).
to you under the Apache License, Version 2.0 (the bug tracker: https://github.com/lampaa/org.apache.cordova.startapp/issues
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
--> -->
<html> <html>
<head> <head>
<meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0" /> <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,initial-scale=1.0" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Cordova Mobile Spec</title> <title>com.lampa.startApp test</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8"> <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script type="text/javascript" charset="utf-8" src="cordova-incl.js"></script> <script type="text/javascript" charset="utf-8" src="cordova-incl.js"></script>
<script type="text/javascript" charset="utf-8" src="startApp.js"></script> <script type="text/javascript" charset="utf-8" src="startApp.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script> <script type="text/javascript" charset="utf-8" src="main.js"></script>
</head> </head>
<body onload="init();" id="stage" class="theme"> <body onload="init();" id="stage" class="theme">
</body> </body>

View File

@ -1,25 +1,10 @@
/* /**
* com.lampa.startapp
* Licensed to the Apache Software Foundation (ASF) under one https://github.com/lampaa/com.lampa.startapp
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information Phonegap 3 plugin for check or launch other application in android device (iOS support).
* regarding copyright ownership. The ASF licenses this file bug tracker: https://github.com/lampaa/org.apache.cordova.startapp/issues
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/ */
function init() { function init() {
/** /**
* check the application is installed * check the application is installed

View File

@ -1,36 +1,33 @@
/* /**
* com.lampa.startapp
* Licensed to the Apache Software Foundation (ASF) under one https://github.com/lampaa/com.lampa.startapp
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information Phonegap 3 plugin for check or launch other application in android device (iOS support).
* regarding copyright ownership. The ASF licenses this file bug tracker: https://github.com/lampaa/org.apache.cordova.startapp/issues
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance !! THIS SCRIPT FILE TO CORDOVA 3.5.*
* with the License. You may obtain a copy of the License at If you are using a version lower than 3.5, read this theme: https://github.com/lampaa/org.apache.cordova.startapp/issues/5#issuecomment-49974214
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
* to phonegap 3.5.*
*/ */
var exec = require('cordova/exec'); var exec = require('cordova/exec');
/** Open a native alert dialog, with a customizable title and button text.
*
* @param {String} message app name
* @param {Function} completeCallback The callback that is called when open app
*/
module.exports = { module.exports = {
/**
* Check application for installed on device
*
* @param {String} message app name
* @param {Function} completeCallback The callback that is called when open app
* @param {Function} errorCallback The callback that is called when application is not installed
*/
check: function(message, completeCallback, errorCallback) { check: function(message, completeCallback, errorCallback) {
exec(completeCallback, errorCallback, "startApp", "check", [message]); exec(completeCallback, errorCallback, "startApp", "check", [message]);
}, },
/**
* Start application on device
*
* @param {Mixed} message params, view documentation https://github.com/lampaa/com.lampa.startapp
* @param {Function} completeCallback The callback that is called when open app
* @param {Function} errorCallback The callback that is called when an error occurred when the program starts.
*/
start: function(message, completeCallback, errorCallback) { start: function(message, completeCallback, errorCallback) {
exec(completeCallback, errorCallback, "startApp", "start", (typeof message === 'string') ? [message] : message); exec(completeCallback, errorCallback, "startApp", "start", (typeof message === 'string') ? [message] : message);
} }

View File

@ -1,36 +1,35 @@
cordova.define("org.apache.cordova.startapp.startapp", function(require, exports, module) { /* cordova.define("com.lampa.startapp.startApp", function(require, exports, module) {
* /**
* Licensed to the Apache Software Foundation (ASF) under one com.lampa.startapp
* or more contributor license agreements. See the NOTICE file https://github.com/lampaa/com.lampa.startapp
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file Phonegap 3 plugin for check or launch other application in android device (iOS support).
* to you under the Apache License, Version 2.0 (the bug tracker: https://github.com/lampaa/org.apache.cordova.startapp/issues
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at !! THIS SCRIPT FILE TO CORDOVA 3.0.*
* If you are using a version upper than 3.5, read this theme: https://github.com/lampaa/org.apache.cordova.startapp/issues/5#issuecomment-49974214
* http://www.apache.org/licenses/LICENSE-2.0 */
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
* to phonegap 3.0.*
*/
var exec = require('cordova/exec'); var exec = require('cordova/exec');
/** Open a native alert dialog, with a customizable title and button text.
*
* @param {String} message app name
* @param {Function} completeCallback The callback that is called when open app
*/
module.exports = { module.exports = {
/**
* Check application for installed on device
*
* @param {String} message app name
* @param {Function} completeCallback The callback that is called when open app
* @param {Function} errorCallback The callback that is called when application is not installed
*/
check: function(message, completeCallback, errorCallback) { check: function(message, completeCallback, errorCallback) {
exec(completeCallback, errorCallback, "startApp", "check", [message]); exec(completeCallback, errorCallback, "startApp", "check", [message]);
}, },
/**
* Start application on device
*
* @param {Mixed} message params, view documentation https://github.com/lampaa/com.lampa.startapp
* @param {Function} completeCallback The callback that is called when open app
* @param {Function} errorCallback The callback that is called when an error occurred when the program starts.
*/
start: function(message, completeCallback, errorCallback) { start: function(message, completeCallback, errorCallback) {
exec(completeCallback, errorCallback, "startApp", "start", (typeof message === 'string') ? [message] : message); exec(completeCallback, errorCallback, "startApp", "start", (typeof message === 'string') ? [message] : message);
} }