lwb
2020-11-13 32a156056988885622076cb145beec3dbe889b4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
    }
 
}