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. creating a canvas based on OpenGL

Hi

I am writing an application that uses both 2D and 3D.

For the 3D part I use OpenGL, and for the 2D part, I do: Drawable.draw
(myCanvas);

There is a desynchronization between them
I have heard that you can create a Canvas based on OpenGL, and then
when I draw into that canvas, it is redirected to the opengl
surface...


something like this:

if (GL != null)
   myCanvasGL=new Canvas(GL);

and then, when I use Drawable.draw(myCanvasGL);
that drawable should be drawn into the opengl surface...

I must be missing something, because all I can see is a frustrating
black screen...

any ideas, please...
--~--~---------~--~----~------------~-------~--~----~

2. Error with Linear Layout

Hi Everyone,

Eclipse doesn't seem to like the constant VERTICAL in the
LinearLayout. Can you tell me what the problem might be.

Here is a snippet of the code I have. I am using the latest Android
SDK.

Thanks,
Vikram


import android.widget.LinearLayout;

public class HelloViews extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout ll = new LinearLayout(this);
        ll.setOrientation(VERTICAL);
        //setContentView(R.layout.main);
    }
--~--~---------~--~----~------------~-------~--~----~

3. SSLv2 not supported?

4. Checkout source code

5. Sound Recorder App

6. how to distinguish Button and EditTex -------about EditorInfo in IMF

7. Problem with sound on Notifications on Emulator