package com.secondworld.universalsdk.utils;
|
|
import android.app.ActivityManager;
|
import android.content.Context;
|
|
import com.secondworld.universalsdk.GameApp;
|
|
public class DeviceUtil {
|
|
|
/**
|
* 获取当前设备总运行内存
|
* 单位为 byte
|
* @return
|
*/
|
public static long GetTotalRAMSize() {
|
ActivityManager manager = (ActivityManager) GameApp.APP.getSystemService(Context.ACTIVITY_SERVICE);
|
ActivityManager.MemoryInfo info = new ActivityManager.MemoryInfo();
|
manager.getMemoryInfo(info);
|
return info.totalMem;
|
}
|
|
}
|