Getting build number/version programatically

by Mark K » Sat, 28 Feb 2009 05:19:04 GMT


Sponsored Links
 Does anyone know of a way to get the version/build number
programatically? I dug into Settings source code, it indicated that
this info could be read from the file /proc/socinfo, but this file
doesn't seem to exists on any of the devices I'm working with?!
Wondering where else I might be able to get this info. Thanks

                       mark
--~--~---------~--~----~------------~-------~--~----~



Getting build number/version programatically

by Mark Murphy » Sat, 28 Feb 2009 05:22:05 GMT


 


Check out android.os.Build and android.os.Build.VERSION.

Note that some of these values may be unusual in the emulator (e.g.,
null brand).

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

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


Sponsored Links


Getting build number/version programatically

by sm1 » Sat, 28 Feb 2009 07:50:04 GMT


 You could use *Device Internals for r1* which is free in Tools, and
scroll to section *android.os.Build*, it will list you the fields and
values that you can obtain from this class and you can pick the one
that suits your requirements. You can also see other classes that give
you other similar values.

serge





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



Getting build number/version programatically

by mark . kahrl » Sat, 28 Feb 2009 08:16:07 GMT


 Thanks for  that info, I guess that should have been intuitively
obvious to the casual observer........





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



Getting build number/version programatically

by mark . kahrl » Sat, 28 Feb 2009 08:17:01 GMT


 I need to do it programmatically, but thanks.

                               M





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



Getting build number/version programatically

by sm1 » Sat, 07 Mar 2009 07:54:21 GMT


 Here's a hint with some code:

    StringBuffer buf = new StringBuffer();
    buf.append("VERSION.RELEASE {"+Build.VERSION.RELEASE+"}");
    buf.append("\nVERSION.INCREMENTAL {"+Build.VERSION.INCREMENTAL
+"}");
    buf.append("\nVERSION.SDK {"+Build.VERSION.SDK+"}");
    buf.append("\nBOARD {"+Build.BOARD+"}");
    buf.append("\nBRAND {"+Build.BRAND+"}");
    buf.append("\nDEVICE {"+Build.DEVICE+"}");
    buf.append("\nFINGERPRINT {"+Build.FINGERPRINT+"}");
    buf.append("\nHOST {"+Build.HOST+"}");
    buf.append("\nID {"+Build.ID+"}");
    Log.d("build",buf);

serge






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



Other Threads

1. Context

How to use Intent funtion in OnClickListener()...



ImageButton button = (ImageButton) findViewById(R.id.appointment);
        button.setOnClickListener(new OnClickListener() {
                public void onClick(View v) {
Intent i = new Intent(this, NoteEdit.class);
startActivityForResult(i, ACTIVITY_CREATE);
--~--~---------~--~----~------------~-------~--~----~

2. memory leak when closing and restarting appliction several times

You need a tearDown() method, and for each activity you start, keep a handle
to it.. which depends on which Test package you are using. Looks like you
are using a single activity, in which case you can use getActivity() for
your current activity.

So an example would be:

@Override
protected void tearDown() throws Exception{
    getActivity().finish;
    randomVariable = null;
    if(otherRandomActivity() != null)
        otherRandomActivity().finish()
    ....
    ....
   super.tearDown();

}

See if that helps!





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

3. Pre-Loading apps from SD Card? Possible?

4. Getting the ID of a ListView row item from a button click

5. Elan sues Apple for multitouch patent infringment... and guess what....

6. 1.5 SDK Media Question: why doesn't android.media.AudioFormat have option for AMR-NB?

7. Null pointer exception while using setOnClickListener