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. backgroung setting in OpenGLES

hi,
    I am writting opengl app using GLSurgfaceView given in API demos.
I create a rectangle and added texture but then drawframe in renderer
is called in a loop i,e it is redrawing it even if there is no
changes. so what should i do to? how to set background
--~--~---------~--~----~------------~-------~--~----~

2. Drawables Galore - Optimization Question

What is the best way to store/load/handle a lot of Drawables for my
application?

Let me explain....

- Let's say I need to display a lot of small avatar images in my
application
- Let"s say each avatar image has a size of 40x40 and I need to
display 32 different sprites. Not all at the same time, but I might
have to display 10 of them on the screen at the same time. In addition
I need to draw them on a canvas were they walk around or something...

My reflex would be to create one PNG with 4x8=32 tiles (size :
320x160).
For drawing the sprites on my canvas I would allocate a bitmap for
each sprite, load it and then and draw it when I need to (case #1)
However, I also need to display the avatars in other views, e.g. in a
ListView in a different activity (case #2).

For #2, it would be very convenient if I could have them as Drawables.
So should I just have 32 pngs in my res/drawable directory ?

I feel like it would be great to have something like a SpriteDrawable
where I could specify in an xml file which part of a bigger bitmap I
want to use as a drawable on its own.

Or is it totally fine to have A LOT of small PNGs in my res/drawable
folder ? Does the packaging process optimize them anyways?

Would be great to get some input on these thoughts... Any comments
appreciated.







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

3. multi-touch?

4. How to get a region which is not a standard rect area

5. getAssets().open(file.txt)

6. WebKit and JavaScript. PLEASE HELP.

7. Has any one tried to change the existing apps code of G1, i mean calender and Camera code