-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c4e9fa4
Showing
6 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Cordova Plugin Template | ||
====== | ||
|
||
This is a simple starting point for building a Cordova plugin on iOS and Android. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "cordova-plugin-androidapkinfo", | ||
"version": "1.0.0", | ||
"author": { | ||
"name" : "Arthur Breton", | ||
"email" : "[email protected]", | ||
"url" : "http://siteed.net/" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url" : "https://github.com/deeeed/cordova-plugin-fixioskeyboard" | ||
}, | ||
"cordova": { | ||
"id": "cordova-plugin-template", | ||
"platforms": [ | ||
"android" | ||
] | ||
}, | ||
"description": "Extract APK infos" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" | ||
id="cordova-plugin-androidapkinfo" | ||
version="1.0.0"> | ||
<name>Cordova Plugin To Extract infos from APK</name> | ||
<description></description> | ||
<license>MIT</license> | ||
<author>Arthur Breton</author> | ||
<keywords>IOS Keyboard Slow</keywords> | ||
<repo>https://github.com/deeeed/cordova-plugin-fixioskeyboard</repo> | ||
<issue>https://github.com/deeeed/cordova-plugin-fixioskeyboard/issues</issue> | ||
|
||
<!-- android --> | ||
<platform name="android"> | ||
<js-module src="www/plugin.js" name="plugin"> | ||
<runs/> | ||
|
||
<!-- This is the window variable name you want, like window.MyCordovaPlugin --> | ||
<clobbers target="AndroidAPKInfo" /> | ||
</js-module> | ||
<config-file target="res/xml/config.xml" parent="/*"> | ||
<feature name="MyCordovaPlugin"> | ||
<param name="android-package" value="net.siteed.AndroidAPKInfoPlugin" /> | ||
<param name="onload" value="true" /> | ||
</feature> | ||
</config-file> | ||
|
||
<source-file src="src/android/com/example/MyCordovaPlugin.java" target-dir="src/com/example/" /> | ||
</platform> | ||
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
*/ | ||
package com.example; | ||
|
||
import org.apache.cordova.CallbackContext; | ||
import org.apache.cordova.CordovaInterface; | ||
import org.apache.cordova.CordovaPlugin; | ||
import org.apache.cordova.CordovaWebView; | ||
import org.apache.cordova.PluginResult; | ||
import org.apache.cordova.PluginResult.Status; | ||
import org.json.JSONObject; | ||
import org.json.JSONArray; | ||
import org.json.JSONException; | ||
|
||
import android.util.Log; | ||
|
||
import java.util.Date; | ||
|
||
public class MyCordovaPlugin extends CordovaPlugin { | ||
private static final String TAG = "MyCordovaPlugin"; | ||
|
||
public void initialize(CordovaInterface cordova, CordovaWebView webView) { | ||
super.initialize(cordova, webView); | ||
|
||
Log.d(TAG, "Initializing MyCordovaPlugin"); | ||
} | ||
|
||
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException { | ||
if(action.equals("echo")) { | ||
String phrase = args.getString(0); | ||
// Echo back the first argument | ||
Log.d(TAG, phrase); | ||
} else if(action.equals("getDate")) { | ||
// An example of returning data back to the web layer | ||
final PluginResult result = new PluginResult(PluginResult.Status.OK, (new Date()).toString()); | ||
callbackContext.sendPluginResult(result); | ||
} | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
var exec = require('cordova/exec'); | ||
|
||
var PLUGIN_NAME = 'AndroidAPKInfo'; | ||
|
||
var AndroidAPKInfo = { | ||
echo: function(phrase, cb) { | ||
exec(cb, null, PLUGIN_NAME, 'echo', [phrase]); | ||
}, | ||
getDate: function(cb) { | ||
exec(cb, null, PLUGIN_NAME, 'getDate', []); | ||
} | ||
}; | ||
|
||
module.exports = AndroidAPKInfo; |