By Olivier Brand
-
To install the plugin, move
Resources.js
to your project's www folder and include a reference to it in your html files.<script src="Resources.js"></script>
-
Create a folder called 'com/phonegap/plugin/resources' within your project's src folder.
-
And copy the java file into that new folder.
mkdir -p /src/com/phonegap/plugin/resources cp ./ResourcesPlugin.java /src/com/phonegap/plugin/resources
-
Add a plugin line to
res/xml/plugins.xml
<plugin name="Resources" value="com.phonegap.plugin.resources.ResourcesPlugin" />
res/values/strings.xml mylogin /someuri this.resources = window.plugins.resources.getStringResources({ 'resources': [ 'base_uri', 'login' ], 'package': 'com.androidapp.app' }); console.log(this.resources.base_uri);