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. can't download ADT Eclipse plugin

Hi guys, i've just installed Eclipse classic 3.5.1 and i've troubles
downloading the Android ADT Plugin...
When i put the address https://dl-ssl.google.com/android/eclipse/
(with or without "s" in http) nothing is seem to happen...it seems to
loading something (maybe it connects with google server) but nothing
appear in the list of available software below...

Any ideas? I'm using Ubuntu 9.10...

-- 

2. make error

Hi all,
      I want to add one class at framework and for that I followed the
procedure given in one document which I found from net. According to
that if I want to add module called "abc" ,I have to add this
directory to the franework base directory and I need to add name of
this directory to android/build/core/pathmap.mk ,which I did.

Old content of pathmap.mk
         ......
         ......
FRAMEWORKS_BASE_SUBDIRS := \
        $(addsuffix /java, \
            core \
            graphics \
            im \
            location \
            media \
            opengl \
            sax \
            telephony \
            wifi \
         )

#
# A version of FRAMEWORKS_BASE_SUBDIRS that is expanded to full paths
from
# the root of the tree.  This cu

After modification....

        ..............
FRAMEWORKS_BASE_SUBDIRS := \
        $(addsuffix /java, \
            core \
            graphics \
            im \
            location \
            media \
            opengl \
            sax \
            telephony \
            wifi \
            abc \
         )
   ...................

After saving this I gave make command and got following error.


*** unterminated call to function `addsuffix': missing `)'.  Stop.

How to remove this error ?
Where m I making mistake?

Thanks in advance....

-- 

3. getApplicationContext() & AlertDialog.Builder

4. disable SMS threading in Android 2.0

5. Can I use an old Android phone for development purposes?

6. Best and fastest way to load data?

7. raw mic data range