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


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) 
_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.



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.



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.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+"}");



Other Threads

1. everything in gen folder deleted

I opened Eclipse to continue working on a project and found that
everything inside my gen folder was deleted.

I've already tried cleaning my project and saw on another discussion
to use ctrl+shift+o to re-import the information. Neither of
these fixed the problem.

Is there any way I can regenerate these files without having to copy
everything into a new project? I did not delete these files, is there
a reason they disappeared?


2. Two controls on a line?

Right, first things first. I'm no numpty. I'm a developer with over 15
years experience of developing in the Windows platform including
mobile apps.

I've figured out that Windows Mobile 7 is not the way I want to go as
I'll have to redevelop my apps into Silverlight and I'd rather learn
Android and get a decent phone.

So, while no numpty, I am new to Android development.

I'm having a few problems with Eclipse at the moment but I have been
able to get started with one of my most useful apps, a shopping list.
So, here's what I want. A view with two EditText controls on the same
line at the top with a listview beneath (with checkboxes).

So far I've only done samples with a LinearView and perhaps getting
over confident I tried creating a RelativeLayout. Not only did it not
work, the screen didn't show any controls!

What I want is a quick tutorial on achieving this and maybe some of
the events I need to be handling.

Many thanks in advance.


3. best place to get android ROMs ?

4. help me please...

5. OOT makasih bwt om lucky

6. Simulating an actual keyboard.

7. Ask legend g detec memory car