To help me in debugging problems that users encounter in my PhoneGap
Android app, I currently log device information using the phonegap
API. I would also like to log what version they are using (per what's
in AndroidManifest.xml). Is this something that can be exposed to my
JavaScript from PhoneGap?
Otherwise I'll do some sort of make script that writes the version
number programmatically to the XML and the JS. Thanks!
- pamela
http://docs.phonegap.com/en/1.2.0/phonegap_device_device.md.html#Device
take a look at http://www.practicaldeveloper.net/2011/09/creating-plugin-with-phonegap-10.html
then create a plugin class that returns version from:
import android.content.pm.PackageManager.NameNotFoundException;
try {
//recall in the manifest version number is simply a sequential
integer identifying versions. Version name is a string like "1.0" or
"2.1", etc that is more
//commonly associated with a version identifier.
String version =
getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
} catch (NameNotFoundException e) {
Log.e("tag", e.getMessage());
}
On Dec 13, 5:18 pm, pamela fox <pamela...@everyday.io> wrote: