Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.asmjs.phoneinfo;
- import android.app.Activity;
- import android.graphics.Point;
- import android.os.Build;
- import android.os.Environment;
- import android.os.StatFs;
- import java.io.IOException;
- public class Device
- {
- public static String Model()
- {
- return Build.MODEL;
- }
- public static class OS
- {
- public String AndroidRelease()
- {
- return Build.VERSION.RELEASE;
- }
- public String LinuxKernelRelease()
- {
- return System.getProperty("os.version");
- }
- }
- public static class CPU
- {
- public int CoreCount()
- {
- return Runtime.getRuntime().availableProcessors();
- }
- public float Frequency() throws IOException
- {
- String filename = "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq";
- float freq = Float.parseFloat(FileIO.ReadFile(filename));
- return freq / 1000000;
- }
- }
- public static class Display
- {
- public Point Size(Activity activity)
- {
- android.view.Display display = activity.getWindowManager().getDefaultDisplay();
- Point size = new Point();
- display.getSize(size);
- return size;
- }
- }
- public static class Camera
- {
- public int Resolution()
- {
- android.hardware.Camera camera = android.hardware.Camera.open();
- android.hardware.Camera.Parameters params = camera.getParameters();
- android.hardware.Camera.Size size = params.getPictureSize();
- return (size.width * size.height) / 1000000;
- }
- }
- public static class Storage
- {
- public static float SDCardGBSize()
- {
- StatFs stats = new StatFs(Environment.getExternalStorageDirectory().getPath());
- long bytes = stats.getTotalBytes();
- int divider = 1073741824;
- float result = bytes / divider;
- return result;
- }
- public static float PhoneStorageGBSize()
- {
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement