Phonegap: confusing config files
im trying to get a simple app running on my galaxy s3 using Eclipse with
latest Android SDK. First i downloaded the latest phonegap with the npm
command using "npm install -g phonegap". This installed me the phonegap
and cordova commands.
Using cordova, i created my test app with:
cordova create test "com.helloworld.mobile" "test"
cd test
cordova platform add android
cordova build
all of this worked fine. then i created a new android project in eclipse
using the platforms folder inside test/ as source. Then i coded the
deviceready part which gets triggered successfully. But i have no access
to the device variable to access device info, so i guess i forgot to add
the permissions into the XMLs to get access to my hardware.
Now im confused, which one of these i have to change, and each XML looks
different. I have AndroidManifest.xml in my root folder. Then a config.xml
in my assets/www folder and another config.xml in my res/xml/ folder. Both
config.xml look similar, but are not the same.
I tried different changes using uses-permission or feature or plugin. I
even created plugins.xml in res/xml, but it didnt help. Documentation
doesn't help.
How to set up these config files correctly so i get access to my device
via phonegap? I simply tried to print device.cordova or device.model or
whatever, but device remains undefined, even after deviceready fired off.
PS: Deploying this app on my phone works fine, even the debugger runs, so
i can see the error messages from javascript. so it must be a permission
problem i guess.
No comments:
Post a Comment