package com.runt.open.mvi.data;
|
|
import android.content.Context;
|
import android.os.Build;
|
import android.util.DisplayMetrics;
|
|
import com.runt.open.mvi.retrofit.utils.NetWorkUtils;
|
import com.runt.open.mvi.utils.DeviceUtil;
|
|
|
/**
|
* My father is Object, ites purpose of
|
*
|
* @purpose Created by Runt (qingingrunt2010@qq.com) on 2020-10-7.
|
*/
|
|
public class PhoneDevice {
|
|
private String brand,model,androidVersion,seriaNo,netIp;
|
private int androidCode,pixWidth,pixHeight;
|
private float density;
|
|
static PhoneDevice device;
|
|
public static void setDevice(Context context) {
|
device = new PhoneDevice(Build.BRAND,Build.MODEL,Build.VERSION.RELEASE, Build.VERSION.SDK_INT,"", NetWorkUtils.getNetIp());
|
DisplayMetrics displayPixel = DeviceUtil.getScreenPixel(context);
|
device.pixWidth = displayPixel.widthPixels;
|
device.pixHeight = displayPixel.heightPixels;
|
device.density = displayPixel.density;
|
}
|
|
public static PhoneDevice getDevice() {
|
return device;
|
}
|
|
public PhoneDevice(String brand, String model, String androidVersion, int androidCode, String seriaNo, String netIp) {
|
this.brand = brand;
|
this.model = model;
|
this.androidVersion = androidVersion;
|
this.androidCode = androidCode;
|
this.seriaNo = seriaNo;
|
this.netIp = netIp;
|
}
|
|
public String getBrand() {
|
return brand;
|
}
|
|
public void setBrand(String brand) {
|
this.brand = brand;
|
}
|
|
public String getModel() {
|
return model;
|
}
|
|
public void setModel(String model) {
|
this.model = model;
|
}
|
|
public String getAndroidVersion() {
|
return androidVersion;
|
}
|
|
public void setAndroidVersion(String androidVersion) {
|
this.androidVersion = androidVersion;
|
}
|
|
public int getAndroidCode() {
|
return androidCode;
|
}
|
|
public void setAndroidCode(int androidCode) {
|
this.androidCode = androidCode;
|
}
|
|
public String getSeriaNo() {
|
return seriaNo;
|
}
|
|
public void setSeriaNo(String seriaNo) {
|
this.seriaNo = seriaNo;
|
}
|
|
public String getNetIp() {
|
return netIp;
|
}
|
|
public void setNetIp(String netIp) {
|
this.netIp = netIp;
|
}
|
|
public int getPixWidth() {
|
return pixWidth;
|
}
|
|
public void setPixWidth(int pixWidth) {
|
this.pixWidth = pixWidth;
|
}
|
|
public int getPixHeight() {
|
return pixHeight;
|
}
|
|
public void setPixHeight(int pixHeight) {
|
this.pixHeight = pixHeight;
|
}
|
|
public float getDensity() {
|
return density;
|
}
|
|
public void setDensity(float density) {
|
this.density = density;
|
}
|
|
@Override
|
public String toString() {
|
return "PhoneDevice{" + "brand='" + brand + '\'' +
|
", model='" + model + '\'' +
|
", androidVersion='" + androidVersion + '\'' +
|
", seriaNo='" + seriaNo + '\'' +
|
", netIp='" + netIp + '\'' +
|
", androidCode=" + androidCode +
|
", pixWidth=" + pixWidth +
|
", pixHeight=" + pixHeight +
|
", density=" + density + '}';
|
}
|
}
|