Runt
2026-04-28 d04b89a739078d36060b4a3af0779470327b40ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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 + '}';
    }
}