Acessing Data in AndroidManifest

by Damien » Mon, 13 Apr 2009 12:12:40 GMT


Sponsored Links
 I'm trying to access "android:versionName" in another XML resource
file. I tried to use @android/versionName and @android:versionName,
but neither work. Can anyone help me out?

--~--~---------~--~----~------------~-------~--~----~



Acessing Data in AndroidManifest

by Ralf » Mon, 13 Apr 2009 12:57:23 GMT


 Afaik, the versionName attribute is not a string you can reference
from other resources.

However you can programatically retrieve it like this:
  PackageManager pm = getPackageManager();
  PackageInfo pi = pm.getPackageInfo(getPackageName(), 0);
  mVersion = pi.versionName;

For example I do that to dynamically inject it in my html about page.
R/




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Problems with the new ContactsContract API when picking a contact

You need to first resolve the URI like this:
uri = ContactsContract.lookupContact(getContentResolver(), uri);


On Thu, Nov 12, 2009 at 3:07 AM, code_android_festival_way <



> 

2. is Android app qualified for LBS Challenge?

does anyone know whether android apps designed for ADC or for HTC Hero
are qualified for the challenge below without modification? thanks.

NAVTEQ Global LBS Challenge
http://www.nn4d.com/site/global/market/lbs_challenge/p_lbs_home.jsp

--

3. A touch-screen netbook to port Android and/or Chrome OS to it?

4. Fwd: Oi, preciso de um favor

5. How to get the AID for application in android.

6. Scrolling large image - working good but slow

7. How to switch off Anti-aliasing