• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to get BIOS Information

Android phones don't have a bios - they have a bootloader.

If your device has a fastboot mode, then you have to go into that, and with the appropriate Android SDK tools, say in a command window with the phone connected -

fastboot getvar all

Then to get a picture of the storage layout and memory use, install Terminal Emulator and command, as you would in Linux,

df

And

cat /proc/meminfo
 
Okay, but what practical information are you after? Or, more specifically, why?

Android is not a PC operating system, it doesn't have a BIOS like you might be familiar with. One of the functions of a PC BIOS is to provide basic support for all the various hardware that might get connected to it - how can the PC boot from the harddrive if it doesn't know how to access it? Android doesn't have that - each device's build of Android is tailored specifically for that device; it already has ALL of the necessary drivers loaded up. Android doesn't have to do any probing at boot time to figure out what kind of display or touch input device is connected - it already knows that.

Edit: See EM's post above for info on the Android bootloader :thumbsupdroid:
 
Hi :)
In my linux machine I am getting the following BIOS parameters,
Vendor
Release Date
Address
Runtime Size
ROM Size

Hmmm that's a lot of code to post. I'll post some code from one of my apps, though I'm not exactly sure what you want. Hopefully this will help some...

The following code is self explanatory and will provide some of what you asked. Will open in a textview with a space between each line. I have this in my oncreate which fills one activity...
Code:
 TextView list = (TextView) findViewById(R.id.textView);
        String  details =  "VERSION.RELEASE : "+Build.VERSION.RELEASE
                +"\n\nVERSION.INCREMENTAL : "+Build.VERSION.INCREMENTAL
                +"\n\nVERSION.SDK.NUMBER : "+Build.VERSION.SDK_INT
                +"\n\nBOARD : "+Build.BOARD
                +"\n\nBRAND : "+Build.BRAND
                +"\n\nDISPLAY : "+Build.DISPLAY
                +"\n\nFINGERPRINT : "+Build.FINGERPRINT
                +"\n\nHARDWARE : "+Build.HARDWARE
                +"\n\nHOST : "+Build.HOST
                +"\n\nID : "+Build.ID
                +"\n\nMANUFACTURER : "+Build.MANUFACTURER
                +"\n\nMODEL : "+Build.MODEL
                +"\n\nPRODUCT : "+Build.PRODUCT
                +"\n\nSERIAL : "+Build.SERIAL
                +"\n\nTAGS : "+Build.TAGS
                +"\n\nTIME : "+Build.TIME
                +"\n\nTYPE : "+Build.TYPE
                +"\n\nUSER : "+ Build.USER;
        list.setText(details);

The following will get you the internal and external size. I suppressed deprecation because I'm using code compatible with android pryor to api 16, but also works up to lollipop. If your developing for 16+ then I believe you just change to ".getBlockCountLong();". Also you asked for ROM size, well I suppose you can change the path to "/system", just look at the code below and it'll make sense...
Code:
TextView datasz = (TextView) findViewById(R.id.dataSize); // these 2 lines in oncreate
datasz.setText(internalSize("/data"));

    @SuppressWarnings("deprecation")
    private String internalSize(String path){
        StatFs stat = new StatFs(path);
        long blockSize = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks();
        long countBlocks = stat.getBlockCount();
        String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);
        String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);
        return "Internal sd:  " + maxSize + " total  /  " + fileSize + " remain";
    }


TextView extsz = (TextView) findViewById(R.id.extSize); // these 2 lines in oncreate
extsz.setText(externalSize("/mnt/external_sd")); // device specific so adjust path

    @SuppressWarnings("deprecation")
    private String externalSize(String path){
        StatFs stat = new StatFs(path);
        long blockSize = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks();
        long countBlocks = stat.getBlockCount();
        String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);
        String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);
        return "External sd: " + maxSize + " total  /  " + fileSize + " remain"; // you can adjust return line to however you want it displayed
    }

Finally this next bit of code will get the kernel version...
Code:
TextView kernel = (TextView) findViewById(R.id.kernelV);
kernel.setText("Kernel version: " + System.getProperty("os.version"));

There's a whole lot more, but like I said it's just too much code to write. Hope this is of any help to ya or anyone else.

Good luck. ;)
 
Also this can be helpful too. You can use this method in different iterations depending on whether you're getting a string or integer for example...

Code:
public static String ReadGPU() {
        int cur = 0;
        try {
            RandomAccessFile reader = new RandomAccessFile("/sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/gpuclk", "r");
            String gpufreq = reader.readLine();
            cur = Integer.parseInt(gpufreq);
            cur = cur/1000000;
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "GPU clock: " + String.valueOf(cur) + " mhz"; // adjust to your liking
    }

Just call ReadGPU() wherever you need.

I divided the int by a million to get a normal value like "400 mhz". Now some people say to use a BufferedReader instead of RandomAccessFile, but in my experience i find that you can get memory leaks with the BR in certain situations. That's never happened to me with RAF and performance has been good with it. Mileage varies of course.
 
Hmmm that's a lot of code to post. I'll post some code from one of my apps, though I'm not exactly sure what you want. Hopefully this will help some...

The following code is self explanatory and will provide some of what you asked. Will open in a textview with a space between each line. I have this in my oncreate which fills one activity...
Code:
 TextView list = (TextView) findViewById(R.id.textView);
        String  details =  "VERSION.RELEASE : "+Build.VERSION.RELEASE
                +"\n\nVERSION.INCREMENTAL : "+Build.VERSION.INCREMENTAL
                +"\n\nVERSION.SDK.NUMBER : "+Build.VERSION.SDK_INT
                +"\n\nBOARD : "+Build.BOARD
                +"\n\nBRAND : "+Build.BRAND
                +"\n\nDISPLAY : "+Build.DISPLAY
                +"\n\nFINGERPRINT : "+Build.FINGERPRINT
                +"\n\nHARDWARE : "+Build.HARDWARE
                +"\n\nHOST : "+Build.HOST
                +"\n\nID : "+Build.ID
                +"\n\nMANUFACTURER : "+Build.MANUFACTURER
                +"\n\nMODEL : "+Build.MODEL
                +"\n\nPRODUCT : "+Build.PRODUCT
                +"\n\nSERIAL : "+Build.SERIAL
                +"\n\nTAGS : "+Build.TAGS
                +"\n\nTIME : "+Build.TIME
                +"\n\nTYPE : "+Build.TYPE
                +"\n\nUSER : "+ Build.USER;
        list.setText(details);

The following will get you the internal and external size. I suppressed deprecation because I'm using code compatible with android pryor to api 16, but also works up to lollipop. If your developing for 16+ then I believe you just change to ".getBlockCountLong();". Also you asked for ROM size, well I suppose you can change the path to "/system", just look at the code below and it'll make sense...
Code:
TextView datasz = (TextView) findViewById(R.id.dataSize); // these 2 lines in oncreate
datasz.setText(internalSize("/data"));

    @SuppressWarnings("deprecation")
    private String internalSize(String path){
        StatFs stat = new StatFs(path);
        long blockSize = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks();
        long countBlocks = stat.getBlockCount();
        String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);
        String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);
        return "Internal sd:  " + maxSize + " total  /  " + fileSize + " remain";
    }


TextView extsz = (TextView) findViewById(R.id.extSize); // these 2 lines in oncreate
extsz.setText(externalSize("/mnt/external_sd")); // device specific so adjust path

    @SuppressWarnings("deprecation")
    private String externalSize(String path){
        StatFs stat = new StatFs(path);
        long blockSize = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks();
        long countBlocks = stat.getBlockCount();
        String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);
        String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);
        return "External sd: " + maxSize + " total  /  " + fileSize + " remain"; // you can adjust return line to however you want it displayed
    }

Finally this next bit of code will get the kernel version...
Code:
TextView kernel = (TextView) findViewById(R.id.kernelV);
kernel.setText("Kernel version: " + System.getProperty("os.version"));

There's a whole lot more, but like I said it's just too much code to write. Hope this is of any help to ya or anyone else.

Good luck. ;)



Thanks a lot for the code :). I am trying to get as many hardware as well as software parameters, as possible. The more the number of parameters the better it will be.
 
Okay, but what practical information are you after? Or, more specifically, why?

Android is not a PC operating system, it doesn't have a BIOS like you might be familiar with. One of the functions of a PC BIOS is to provide basic support for all the various hardware that might get connected to it - how can the PC boot from the harddrive if it doesn't know how to access it? Android doesn't have that - each device's build of Android is tailored specifically for that device; it already has ALL of the necessary drivers loaded up. Android doesn't have to do any probing at boot time to figure out what kind of display or touch input device is connected - it already knows that.

Edit: See EM's post above for info on the Android bootloader :thumbsupdroid:
Thanks a lot for the information. I am trying to find as many hardware and software parameters, as possible.
 
Android phones don't have a bios - they have a bootloader.

If your device has a fastboot mode, then you have to go into that, and with the appropriate Android SDK tools, say in a command window with the phone connected -

fastboot getvar all

Then to get a picture of the storage layout and memory use, install Terminal Emulator and command, as you would in Linux,

df

And

cat /proc/meminfo
Thanks a lot for the information
 
Thanks a lot for the code :). I am trying to get as many hardware as well as software parameters, as possible. The more the number of parameters the better it will be.
Hmmm that's a lot of code to post. I'll post some code from one of my apps, though I'm not exactly sure what you want. Hopefully this will help some...

The following code is self explanatory and will provide some of what you asked. Will open in a textview with a space between each line. I have this in my oncreate which fills one activity...
Code:
 TextView list = (TextView) findViewById(R.id.textView);
        String  details =  "VERSION.RELEASE : "+Build.VERSION.RELEASE
                +"\n\nVERSION.INCREMENTAL : "+Build.VERSION.INCREMENTAL
                +"\n\nVERSION.SDK.NUMBER : "+Build.VERSION.SDK_INT
                +"\n\nBOARD : "+Build.BOARD
                +"\n\nBRAND : "+Build.BRAND
                +"\n\nDISPLAY : "+Build.DISPLAY
                +"\n\nFINGERPRINT : "+Build.FINGERPRINT
                +"\n\nHARDWARE : "+Build.HARDWARE
                +"\n\nHOST : "+Build.HOST
                +"\n\nID : "+Build.ID
                +"\n\nMANUFACTURER : "+Build.MANUFACTURER
                +"\n\nMODEL : "+Build.MODEL
                +"\n\nPRODUCT : "+Build.PRODUCT
                +"\n\nSERIAL : "+Build.SERIAL
                +"\n\nTAGS : "+Build.TAGS
                +"\n\nTIME : "+Build.TIME
                +"\n\nTYPE : "+Build.TYPE
                +"\n\nUSER : "+ Build.USER;
        list.setText(details);

The following will get you the internal and external size. I suppressed deprecation because I'm using code compatible with android pryor to api 16, but also works up to lollipop. If your developing for 16+ then I believe you just change to ".getBlockCountLong();". Also you asked for ROM size, well I suppose you can change the path to "/system", just look at the code below and it'll make sense...
Code:
TextView datasz = (TextView) findViewById(R.id.dataSize); // these 2 lines in oncreate
datasz.setText(internalSize("/data"));

    @SuppressWarnings("deprecation")
    private String internalSize(String path){
        StatFs stat = new StatFs(path);
        long blockSize = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks();
        long countBlocks = stat.getBlockCount();
        String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);
        String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);
        return "Internal sd:  " + maxSize + " total  /  " + fileSize + " remain";
    }


TextView extsz = (TextView) findViewById(R.id.extSize); // these 2 lines in oncreate
extsz.setText(externalSize("/mnt/external_sd")); // device specific so adjust path

    @SuppressWarnings("deprecation")
    private String externalSize(String path){
        StatFs stat = new StatFs(path);
        long blockSize = stat.getBlockSize();
        long availableBlocks = stat.getAvailableBlocks();
        long countBlocks = stat.getBlockCount();
        String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);
        String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);
        return "External sd: " + maxSize + " total  /  " + fileSize + " remain"; // you can adjust return line to however you want it displayed
    }

Finally this next bit of code will get the kernel version...
Code:
TextView kernel = (TextView) findViewById(R.id.kernelV);
kernel.setText("Kernel version: " + System.getProperty("os.version"));

There's a whole lot more, but like I said it's just too much code to write. Hope this is of any help to ya or anyone else.

Good luck. ;)
 
Can you please tell me the files where this information is stored ? I have explored /proc/cpuinfo and /proc/meminfo .
 
Can you please tell me the files where this information is stored ? I have explored /proc/cpuinfo and /proc/meminfo .

Most of the files you're looking for will be in the /sys/?/? directory. Then you can use the code I posted in post #7 to read the info and add it to a textview. Make adjustment as needed for strings.

Also if you're reading things like clock speeds you can call the code I posted from a method called runOnUiThread and sleep the thread for 1 second intervals (1000). This is perfect for reading clock speeds in real-time for cpu/gpu, also battery levels, different temperatures, and ram or any info that needs to be read in real-time.

You can display any and all info as long as you can find where to read it from on the device.
 
Back
Top Bottom