A third-party Phonegap plugin that implements the Moodstocks v4 SDK for Android. It is developed by Thomas Forth at imactivate and tested on Phonegap v3.1, on Windows and Mac, in Eclipse. Small changes in installation procedure may be required with newer version of Phonegap but we foresee no major compatibility issues.
Until I have a complete installation guide watch this video.
Installation is via the Phonegap CLI as with the v3.7 plugin but requires slightly different steps later in the installation.
- The native-code portion of the Moodstocks v4.x SDK (Eclipse) needs downloading and adding to the project.
- The MainActivity.java class needs moving to the
your.package.name
package you chose when creating your project using the Phonegap CLI. - Replace the
_yourKey_
and_yourSecret_
placedholders in MainActivity.java with your Moodstocks key and secret. - All references to
com.imactivate.MS4TOM
need changing toyour.package.name
. This includes in theAndroidManifest.xml
and in each Java file includingimport com.imactivate.MS4TOM.R
. - In
AndroidManifest.xml
theandroid:name="<name>"
property of the main activity toandroid:name="MainActivity"
. - (Depending on the phonegap version you use some or all of these changes to
AndroidManifest.xml
may not be required). Theandroid:debuggable="true"
property needs removing. Theandroid:minSdkVersion="10"
property needs changing toandroid:minSdkVersion="11"
. Optionally, replaceandroid:theme="@android:style/Theme.Black.NoTitleBar"
withandroid:theme="@android:style/Theme.Holo.NoActionBar"
.
Your project should now compile and install. Additionally you may want to install the Phonegap v4 Demo App.
In assets/www/
replace index.html
with the index.html
in the Moodstocks v4 Phonegap Demo and add the content of the Demo's img
folder to assets/www/img
.
At the Phonegap level the API is largely unchanged from the Moodstocks v3.7 phonegap plugin and porting should be straightforward.
The scanOptions
object now requires a scanType
to be defined. This can be either auto
or manual
. Both use cases are included in the demo app. Bundle loading is supported but not required. A partial implementation is included in the demo app but not activated. Camera roll recognition is supported by a completely new function and demonstrated in the demo app.
This release drops support for Android 2.x. Users who require this should use the Moodstocks v3.7 phonegap plugin. Developed with Phonegap 3.1, in Eclipse, on Windows 8.1. Android Studio is not supported; Phonegap is the barrier to this.
Separate tasks for scanning and the main UI have been replaced with a single task containing multiple fragments -- one for Manual Scanning, one for Automatic Scanning, and one for the phonegap webview. The main task contains the Moodstocks Scanner object and handles synchronisation. The phonegap webview is loaded on application launch and scanner fragments are loaded when required and destroyed when closed.
A new callback system has been implemented which does not rely on the startActivityForResult
method typical in Phonegap plugins. This is necessary because of the move from Tasks to Fragments.
For now the v4 plugin works on Android. If you’re a confident iOS developer and you’d like to team up on an iOS version of the plugin let's talk!
Copyright (c) 2015 Moodstocks SAS and imactivate