get Available ROM - Android Hardware

Android examples for Hardware:Memory

Description

get Available ROM

Demo Code


//package com.java2s;

import android.app.ActivityManager;
import android.app.ActivityManager.MemoryInfo;

import android.content.Context;

public class Main {

    public static long getAvailableROM(Context context) {

        ActivityManager am = (ActivityManager) context
                .getSystemService(context.ACTIVITY_SERVICE);
        MemoryInfo outInfo = new MemoryInfo();
        am.getMemoryInfo(outInfo);// w  ww . j av  a  2s  .c  o m
        return outInfo.availMem;
    }
}

Related Tutorials