Skip to content

Commit

Permalink
Multiple updates to plugin structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrayner committed May 25, 2016
1 parent 2225109 commit 84ed8d1
Show file tree
Hide file tree
Showing 21 changed files with 108 additions and 91 deletions.
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
language: node_js
node_js:
- '0.10'
deploy:
provider: npm
email: [email protected]
api_key:
secure: deAgwv+1XdbzaGALIC8NY8gVX0+kb6hptcv7+FaWMEXQignoLJkICAi+BBOo5eFF+s4RkwX93Jiyw/jQ689eSNwZmb/kE7SiE39150fNIHemMNM8gRwYsS68jalnNDwBupZ4F5pSJDrEuyEE9cCV5tXRZasKImxXJ3XmO568ZwTYCuQdnM0YnP0/Qu39oAue19zng7bIcdq8u64zmsIIzu6FcZ/GsCDaJasNdCpgVaPwUC/q6Mk2Nux869Pz4BzxZFYXyWCLevbMcmUpwZOQAS33AAJl5F8ik/TQhXvMrEgvbGNAlCwmEhYe3042fVoL3YZgDrYXCO+vtqzY3ucN57FRacZnwbnWBJ/UxGP6t47eULCmbo0O0m32JnM4BSszVYCv4x51On4fAh6Yj2irWJTMSYGql7wVS2xpOP9Xxrw4hB2FvLfFb6w8AQV6aObyaY2n6vR4jyjAJUSfXBvw2uoZj7SsaCvhf5ckhpeIuK9X+q/JxTCZmLzaSIEhqkgA4iqS7D+9THOcX3ScfxnMb05ZPWbxgkT0JRzMAF7dX7VTh4U/9Esz2bKaugQGRtuaTmx2B5Ca8vu7qmjlHqvoodDLjOLU/28O1f49bF7U2LWH00gpOA5i+xSQO25alB2CkLwK0Wqykokc1A5dOkluwWtsvUWa0/959bS/ACYu/4I=
on:
repo: thisisbd/cordova-plugin-vuforia
notifications:
slack:
secure: LyCP//iisSxh/3v9urN/DIzC80LMekzYEe86mIhlq7tV0FChayGHf0skdZSA5o4FqQaR9NpQQ/aWjSJS5vAkZYbOeYIlrD9KrnljYAUAYEsh35RCu813NHv3hQCS3BGFdYiH5bc804ZN5zsUJ7FlsXrpKhrpxpyGdIFJZEbCpFdqoxPjq0jBTZdlXMuHty1a8sYFjB8kbxkyWcBuPYJjmk4JOYfiOys0oJO+MfD9uj5j7+XpyS79nfiLHEpRzwhjKmpSVIk+mKy1R5WY49klz8De2pTzlwN0kH6lvn03wOvT+GUnd5vSOqgTqzAbztZUYK/Ee6oUnnQxqE57xBq8RzhJHAr3h+bqFbxdnPjA1ZknJKy3XCcD0RSG2dYC+fLC6rReNI8TIvwBoxidIMSRPr8acIGRoVuo7laTWXAz3zonPVnS8TiiyHGe2jyHHyvTMgB4vTPYgD91ODEjgiPBRd0oV4aSoFjiKGuFIn6AD1hB+00fUYBFR9dL87VCGR5l9j7Hz3C/chkozwo4pSebpVawCewgskuDY3u3aaDrHBkoNcgdCndOj3I0m50SFhHb7kWuQyLd+myxmgoRtOIjgPMIikMWm75h2Esj0TYd8Rj43tIozQtdKFMKz+TjAOu3/OKHCaa9pbpZmmOHEFZ5WT3YQf8RjjTk0TjPRkiuKlA=
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016 BD Network LTD
Copyright (c) 2016 Matthew Rayner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
52 changes: 37 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ cordova plugin add cordova-plugin-vuforia
From within your Javascript file, add the following to launch the [Vuforia][vuforia] plugin.
```javascript
navigator.VuforiaPlugin.startVuforia(
'StonesAndChips.xml',
[ 'stones', 'chips' ],
'Point your camera at either the stones or the chips image...',
'PluginTest.xml',
[ 'logo', 'iceland', 'canterbury-grass', 'brick-lane' ],
'Point your camera at a test image...',
'YOUR_VUFORIA_KEY',
function(data){
console.log(data);
Expand All @@ -49,9 +49,31 @@ navigator.VuforiaPlugin.startVuforia(

**NOTE**: You will need to replace `YOUR_VUFORIA_KEY` with a valid license key for the plugin to launch correctly.

You will also need to replace the `StonesAndChips.xml` and `[ 'stones', 'chips' ]` array with specific information for your application. These are here for initial setup and demo purposes.
For testing you can use the `targets/PluginTest_Targets.pdf` file, it contains all four testing targets.

For testing you can use the `targets/imagetargets_targets.pdf` file, it contains the stones and chips targets.

#### Using your own data
##### Cordova `config.xml`
We know that eventually you're going to want to use your own data. You should place your .xml and .dat files inside a `targets` folder at the root of your project, then add the following to your config.xml file:

```xml
<platform name="android">
<resource-file src="targets/CustomData.dat" target="assets/CustomData.dat" />
<resource-file src="targets/CustomData.xml" target="assets/CustomData.xml" />
</platform>

<platform name="ios">
<resource-file src="targets/CustomData.dat" target-dir="com.mattrayner.vuforia" />
<resource-file src="targets/CustomData.xml" target-dir="com.mattrayner.vuforia" />
</platform>
```

##### JS Change
You will need to replace the `PluginTest.xml` and `[ 'logo', 'iceland', 'canterbury-grass', 'brick-lane' ]` lines with specific information for your application. These are here for initial setup and demo purposes only.


#### Android Steps
That's it... As far as setup goes... You're done! Android is nice and flexible, the plugin **should** have done everything for you!


#### iOS Steps
Expand Down Expand Up @@ -162,25 +184,25 @@ If you wish to submit a bug fix or feature, you can create a pull request and it
## License
Cordova-Plugin-Vuforia is licensed under the [MIT License][info-license].

[logo]: https://cdn.rawgit.com/thisisbd/cordova-plugin-vuforia/d14d00720569fea02d29cded4de3c6e617c87537/images/logo.svg
[stage-3]: https://raw.githubusercontent.com/thisisbd/cordova-plugin-vuforia/master/images/stage-3.gif
[stage-4]: https://raw.githubusercontent.com/thisisbd/cordova-plugin-vuforia/master/images/stage-4.gif
[stage-5-2]: https://raw.githubusercontent.com/thisisbd/cordova-plugin-vuforia/master/images/stage-5-2.gif
[stage-6-2]: https://raw.githubusercontent.com/thisisbd/cordova-plugin-vuforia/master/images/stage-6-2.gif
[logo]: https://cdn.rawgit.com/mattrayner/cordova-plugin-vuforia/d14d00720569fea02d29cded4de3c6e617c87537/images/logo.svg
[stage-3]: https://raw.githubusercontent.com/mattrayner/cordova-plugin-vuforia/master/images/stage-3.gif
[stage-4]: https://raw.githubusercontent.com/mattrayner/cordova-plugin-vuforia/master/images/stage-4.gif
[stage-5-2]: https://raw.githubusercontent.com/mattrayner/cordova-plugin-vuforia/master/images/stage-5-2.gif
[stage-6-2]: https://raw.githubusercontent.com/mattrayner/cordova-plugin-vuforia/master/images/stage-6-2.gif

[cordova]: https://cordova.apache.org/
[vuforia]: https://www.vuforia.com/
[npm]: https://www.npmjs.com
[issue-16]: https://github.com/thisisbd/cordova-plugin-vuforia/issues/16
[issue-16]: https://github.com/mattrayner/cordova-plugin-vuforia/issues/16
[cordova-orientation-issue]: https://github.com/apache/cordova-lib/pull/260
[peugeot]: https://itunes.apple.com/gb/app/new-peugeot-208/id1020630968?mt=8

[info-npm]: https://www.npmjs.com/package/cordova-plugin-vuforia
[info-travis]: https://travis-ci.org/thisisbd/cordova-plugin-vuforia
[info-travis]: https://travis-ci.org/mattrayner/cordova-plugin-vuforia
[info-license]: LICENSE
[info-bithound]: https://www.bithound.io/github/thisisbd/cordova-plugin-vuforia
[info-bithound]: https://www.bithound.io/github/mattrayner/cordova-plugin-vuforia
[shield-npm]: https://img.shields.io/npm/v/cordova-plugin-vuforia.svg
[shield-travis]: https://img.shields.io/travis/thisisbd/cordova-plugin-vuforia.svg
[shield-travis]: https://img.shields.io/travis/mattrayner/cordova-plugin-vuforia.svg
[shield-license]: https://img.shields.io/badge/license-MIT-blue.svg
[shield-bithound]: https://www.bithound.io/github/thisisbd/cordova-plugin-vuforia/badges/score.svg
[shield-bithound]: https://www.bithound.io/github/mattrayner/cordova-plugin-vuforia/badges/score.svg
[shield-cordova]: https://img.shields.io/badge/cordova%20support-5.*%20--%206.*-blue.svg
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "cordova-plugin-vuforia",
"description": "Cordova Vuforia Plugin",
"version": "1.0.2",
"homepage": "https://github.com/thisisbd/cordova-plugin-vuforia",
"version": "1.1.0",
"homepage": "https://github.com/mattrayner/cordova-plugin-vuforia",
"repository": {
"type": "git",
"url": "[email protected]:thisisbd/cordova-plugin-vuforia.git"
"url": "[email protected]:mattrayner/cordova-plugin-vuforia.git"
},
"bugs": {
"url": "https://github.com/thisisbd/cordova-plugin-vuforia/issues"
"url": "https://github.com/mattrayner/cordova-plugin-vuforia/issues"
},
"cordova": {
"id": "cordova-plugin-vuforia",
Expand All @@ -25,14 +25,14 @@
"cordova-ios",
"image",
"recognition",
"thisisbd"
"mattrayner"
],
"engines": [
{
"name": "cordova",
"version": ">=5.0.0"
}
],
"author": "BD Network (Matt Rayner)",
"author": "Matthew Rayner",
"license": "MIT"
}
70 changes: 35 additions & 35 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-vuforia"
version="1.0.2">
version="1.1.0">
<name>Vuforia</name>
<description>Cordova Vuforia Plugin</description>
<license>MIT</license>
<keywords>cordova,vuforia,image,recognition,augmented,reality</keywords>
<repo>[email protected]:thisisbd/cordova-plugin-vuforia.git</repo>
<issue>https://github.com/thisisbd/cordova-plugin-vuforia/issues</issue>
<repo>[email protected]:mattrayner/cordova-plugin-vuforia.git</repo>
<issue>https://github.com/mattrayner/cordova-plugin-vuforia/issues</issue>

<author>Matthew Rayner</author>

<info>
Cordova Vuforia Plugin version 1.0.2, Copyright (C) 2016 BD Network
Cordova Vuforia Plugin version 1.1.0, Copyright (C) 2016 Matthew Rayner
Cordova Vuforia Plugin comes with ABSOLUTELY NO WARRANTY; see the
LICENSE file for more information.
This is free software, and you are welcome to redistribute it
Expand All @@ -31,7 +31,7 @@
<!-- Plugin Config -->
<config-file target="res/xml/config.xml" parent="/*">
<feature name="VuforiaPlugin" >
<param name="android-package" value="com.bdnetwork.vuforia.VuforiaPlugin"/>
<param name="android-package" value="com.mattrayner.vuforia.VuforiaPlugin"/>
</feature>
</config-file>

Expand All @@ -52,7 +52,7 @@
<!-- Add our activities to the Android Manifest -->
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity
android:name="com.bdnetwork.vuforia.app.ImageTargets"
android:name="com.mattrayner.vuforia.app.ImageTargets"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize"
android:screenOrientation="landscape"
android:noHistory="true">
Expand All @@ -65,7 +65,7 @@
</config-file>

<!-- Plugin Source -->
<source-file src="src/android/VuforiaPlugin.java" target-dir="src/com/bdnetwork/vuforia" />
<source-file src="src/android/VuforiaPlugin.java" target-dir="src/com/mattrayner/vuforia" />

<!-- Libraries -->
<source-file src="src/vuforia/jniLibs/armeabi/libVuforia.so" target-dir="libs/armeabi-v7a" />
Expand All @@ -77,30 +77,30 @@
<resource-file src="src/android/res/drawable-xxhdpi/devices.png" target="res/drawable-xxhdpi/devices.png" />
<resource-file src="src/android/res/layout/camera_overlay.xml" target="res/layout/camera_overlay.xml" />

<source-file src="src/android/java/com/bdnetwork/vuforia/app/ImageTargets.java"
target-dir="src/java/com/bdnetwork/vuforia/app" />
<source-file src="src/android/java/com/bdnetwork/vuforia/app/ImageTargetRenderer.java"
target-dir="src/java/com/bdnetwork/vuforia/app" />
<source-file src="src/android/java/com/bdnetwork/vuforia/app/ApplicationControl.java"
target-dir="src/java/com/bdnetwork/vuforia/app" />
<source-file src="src/android/java/com/bdnetwork/vuforia/app/ApplicationException.java"
target-dir="src/java/com/bdnetwork/vuforia/app" />
<source-file src="src/android/java/com/bdnetwork/vuforia/app/ApplicationSession.java"
target-dir="src/java/com/bdnetwork/vuforia/app" />
<source-file src="src/android/java/com/bdnetwork/vuforia/app/utils/LoadingDialogHandler.java"
target-dir="src/java/com/bdnetwork/vuforia/app/utils" />
<source-file src="src/android/java/com/bdnetwork/vuforia/app/utils/MeshObject.java"
target-dir="src/java/com/bdnetwork/vuforia/app/utils" />
<source-file src="src/android/java/com/bdnetwork/vuforia/app/utils/ApplicationGLView.java"
target-dir="src/java/com/bdnetwork/vuforia/app/utils" />
<source-file src="src/android/java/com/bdnetwork/vuforia/app/utils/Texture.java"
target-dir="src/java/com/bdnetwork/vuforia/app/utils" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/ImageTargets.java"
target-dir="src/java/com/mattrayner/vuforia/app" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/ImageTargetRenderer.java"
target-dir="src/java/com/mattrayner/vuforia/app" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/ApplicationControl.java"
target-dir="src/java/com/mattrayner/vuforia/app" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/ApplicationException.java"
target-dir="src/java/com/mattrayner/vuforia/app" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/ApplicationSession.java"
target-dir="src/java/com/mattrayner/vuforia/app" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/utils/LoadingDialogHandler.java"
target-dir="src/java/com/mattrayner/vuforia/app/utils" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/utils/MeshObject.java"
target-dir="src/java/com/mattrayner/vuforia/app/utils" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/utils/ApplicationGLView.java"
target-dir="src/java/com/mattrayner/vuforia/app/utils" />
<source-file src="src/android/java/com/mattrayner/vuforia/app/utils/Texture.java"
target-dir="src/java/com/mattrayner/vuforia/app/utils" />

<!-- Include our resources -->
<resource-file src="targets/StonesAndChips.dat"
target="assets/StonesAndChips.dat" />
<resource-file src="targets/StonesAndChips.xml"
target="assets/StonesAndChips.xml" />
<resource-file src="targets/PluginTest.dat"
target="assets/PluginTest.dat" />
<resource-file src="targets/PluginTest.xml"
target="assets/PluginTest.xml" />
</platform>

<!-- ios -->
Expand Down Expand Up @@ -144,14 +144,14 @@


<resource-file src="src/ios/VuforiaPlugin.bundle" />
<resource-file src="src/ios/Utils/shaders/Line.fragsh" target-dir="com.bdnetwork.vuforia/shader" />
<resource-file src="src/ios/Utils/shaders/Line.vertsh" target-dir="com.bdnetwork.vuforia/shader" />
<resource-file src="src/ios/Utils/shaders/Simple.fragsh" target-dir="com.bdnetwork.vuforia" />
<resource-file src="src/ios/Utils/shaders/Simple.vertsh" target-dir="com.bdnetwork.vuforia" />
<resource-file src="src/ios/Utils/shaders/Line.fragsh" target-dir="com.mattrayner.vuforia/shader" />
<resource-file src="src/ios/Utils/shaders/Line.vertsh" target-dir="com.mattrayner.vuforia/shader" />
<resource-file src="src/ios/Utils/shaders/Simple.fragsh" target-dir="com.mattrayner.vuforia" />
<resource-file src="src/ios/Utils/shaders/Simple.vertsh" target-dir="com.mattrayner.vuforia" />


<resource-file src="targets/StonesAndChips.dat" target-dir="com.bdnetwork.vuforia" />
<resource-file src="targets/StonesAndChips.xml" target-dir="com.bdnetwork.vuforia" />
<resource-file src="targets/PluginTest.dat" target-dir="com.mattrayner.vuforia" />
<resource-file src="targets/PluginTest.xml" target-dir="com.mattrayner.vuforia" />

<resource-file src="src/ios/Assets/ImageTargets/close-button.png" target-dir="Resources" />
<resource-file src="src/ios/Assets/ImageTargets/iOSDevices.png" target-dir="Resources" />
Expand Down
4 changes: 2 additions & 2 deletions src/android/VuforiaPlugin.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bdnetwork.vuforia;
package com.mattrayner.vuforia;

import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CordovaInterface;
Expand All @@ -15,7 +15,7 @@
import android.content.Context;
import android.util.Log;

import com.bdnetwork.vuforia.app.ImageTargets;
import com.mattrayner.vuforia.app.ImageTargets;

public class VuforiaPlugin extends CordovaPlugin {
static final String LOGTAG = "Cordova Vuforia Plugin";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
===============================================================================*/

package com.bdnetwork.vuforia.app;
package com.mattrayner.vuforia.app;

import com.qualcomm.vuforia.State;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
===============================================================================*/

package com.bdnetwork.vuforia.app;
package com.mattrayner.vuforia.app;

// Used to send back to the activity any error during vuforia processes
public class ApplicationException extends Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
===============================================================================*/


package com.bdnetwork.vuforia.app;
package com.mattrayner.vuforia.app;

import android.app.Activity;
import android.content.pm.ActivityInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
===============================================================================*/

package com.bdnetwork.vuforia.app;
package com.mattrayner.vuforia.app;

import java.util.Vector;

Expand All @@ -26,9 +26,9 @@
import com.qualcomm.vuforia.TrackableResult;
import com.qualcomm.vuforia.VIDEO_BACKGROUND_REFLECTION;
import com.qualcomm.vuforia.Vuforia;
import com.bdnetwork.vuforia.app.ApplicationSession;
import com.bdnetwork.vuforia.app.utils.LoadingDialogHandler;
import com.bdnetwork.vuforia.app.utils.Texture;
import com.mattrayner.vuforia.app.ApplicationSession;
import com.mattrayner.vuforia.app.utils.LoadingDialogHandler;
import com.mattrayner.vuforia.app.utils.Texture;


// The renderer class for the ImageTargets sample.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
===============================================================================*/

package com.bdnetwork.vuforia.app;
package com.mattrayner.vuforia.app;

import java.util.ArrayList;
import java.util.Vector;
Expand Down Expand Up @@ -47,12 +47,12 @@
import com.qualcomm.vuforia.Tracker;
import com.qualcomm.vuforia.TrackerManager;
import com.qualcomm.vuforia.Vuforia;
import com.bdnetwork.vuforia.app.ApplicationControl;
import com.bdnetwork.vuforia.app.ApplicationException;
import com.bdnetwork.vuforia.app.ApplicationSession;
import com.bdnetwork.vuforia.app.utils.LoadingDialogHandler;
import com.bdnetwork.vuforia.app.utils.ApplicationGLView;
import com.bdnetwork.vuforia.app.utils.Texture;
import com.mattrayner.vuforia.app.ApplicationControl;
import com.mattrayner.vuforia.app.ApplicationException;
import com.mattrayner.vuforia.app.ApplicationSession;
import com.mattrayner.vuforia.app.utils.LoadingDialogHandler;
import com.mattrayner.vuforia.app.utils.ApplicationGLView;
import com.mattrayner.vuforia.app.utils.Texture;

public class ImageTargets extends Activity implements ApplicationControl
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
===============================================================================*/

package com.bdnetwork.vuforia.app.utils;
package com.mattrayner.vuforia.app.utils;

import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
===============================================================================*/

package com.bdnetwork.vuforia.app.utils;
package com.mattrayner.vuforia.app.utils;

import java.lang.ref.WeakReference;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
===============================================================================*/

package com.bdnetwork.vuforia.app.utils;
package com.mattrayner.vuforia.app.utils;

import java.nio.Buffer;
import java.nio.ByteBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other countries. Trademarks of QUALCOMM Incorporated are used with permission.
===============================================================================*/

package com.bdnetwork.vuforia.app.utils;
package com.mattrayner.vuforia.app.utils;

import java.io.BufferedInputStream;
import java.io.IOException;
Expand Down
Binary file added targets/PluginTest.dat
Binary file not shown.
Loading

0 comments on commit 84ed8d1

Please sign in to comment.