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. Proxy settings in APNs

Hello,

Since I have my own Android device together with Vodafone Live!
InternetFlat I have noticed that most Android software doesn't look
for eventually configured proxies. With my Vodafone connection I am
forced to use a proxy and the android browser and google maps work
fine. But the market for example only allows browsing. The download
doesn't seem to use the http-proxy. The same is with the most
applications in the market. Most do not work. I have contacted some
developers and they weren't aware that have to look for proxy settings
manually. Would be nice to mention the use of proxies in a best
practise or so. And would be nice to fix the market app so that also
downloads of apps also works through the proxy.

Greetings,

Till

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

2. Contacts GroupU v1.18 is available - easily manage your contacts

Hi all,

Contacts GroupU is application for managing contacts group, which integrates
with built-in phonebook seamlessly.

   - Groups edited in GroupU will appear in phonebook.
   - Groups can be synced with gmail group setting.
   - User can send sms/mms to a group, or multiple group members.
   - User can send email to a group or multiple group members.
   - A contact can be associated with multiple groups.

You can download it free from MarketPlace. Enjoy it!

Best Regards,
Yao

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

3. 'Location-Based' Services in a mobile environment survey

4. spurious peaks in a simple memset application

5. How To Keep ListView Header From Scrolling With ListView Content

6. How can I get write on the Eclipse console when I am testing some app's on my G1

7. Problem opening new window on list click