Page 1 of 1

org.apache.cordova.plugin

Posted: Thu Mar 26, 2015 5:26 am
by M&M

I have a plugin and the java file of the plugin looks like this

package org.apache.cordova.plugin;

import org.apache.cordova.api.CallbackContext;
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.PluginResult;
import org.json.JSONArray;
import org.json.JSONException;

import android.util.Log;

So where do I upload the .java file?


org.apache.cordova.plugin

Posted: Thu Mar 26, 2015 3:52 pm
by Egor Kotov6832188

Hello,

Based on your package name in
src-org-apache-cordova-plugin


org.apache.cordova.plugin

Posted: Thu Mar 26, 2015 5:34 pm
by M&M

hi,

Ok so i created a folder in plugins folders. Attached is the screenshot
Image

Also added the following to the cordova_plugins.js
code
{
"file": "plugins/org.apache.cordova.plugin/www/FeatureDetector.js",
"id": "org.apache.cordova.plugin",
"clobbers": [
"plugins.FeatureDetector", "window.featureDetector", "FeatureDetector"
]
}
/code

And in res-config.xml I added the following
code
<feature name="FeatureDetector">
<param name="android-package" value="org&#46;apache&#46;cordova&#46;plugin&#46;FeatureDetector"/>
</feature>
/code

then copied src/android/FeatureDetector.java" TO "src/org/apache/cordova/plugin"

Also changed app settings min sdk to 4.0 and target sdk to 4.1x

Also modified the pom.xml and changed to version 4.1.1.4
code
<groupId>com&#46;google&#46;android</groupId>
<artifactId>android</artifactId>
<version>4&#46;1&#46;1&#46;4</version>
<scope>provided</scope>
</dependency>
/code

I am trying to use a device feature detection plugin. I have shared the App with the support and it is called "DeviceFeatureDetection"

Thanks,
M&M


org.apache.cordova.plugin

Posted: Sat Mar 28, 2015 2:55 am
by M&M

Is there any update on this? This should not have been difficult


org.apache.cordova.plugin

Posted: Sat Mar 28, 2015 4:23 am
by M&M

I sorted this out...thanks.