-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAndroidVersion.cs
More file actions
94 lines (81 loc) · 1.87 KB
/
AndroidVersion.cs
File metadata and controls
94 lines (81 loc) · 1.87 KB
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
using System;
using UnityEngine;
public class AndroidVersion
{
static AndroidJavaClass versionInfo;
static AndroidVersion()
{
versionInfo = new AndroidJavaClass("android.os.Build$VERSION");
}
public static string BASE_OS
{
get
{
return versionInfo.GetStatic<string>("BASE_OS");
}
}
public static string CODENAME
{
get
{
return versionInfo.GetStatic<string>("CODENAME");
}
}
public static string INCREMENTAL
{
get
{
return versionInfo.GetStatic<string>("INCREMENTAL");
}
}
public static int PREVIEW_SDK_INT
{
get
{
return versionInfo.GetStatic<int>("PREVIEW_SDK_INT");
}
}
public static string RELEASE
{
get
{
return versionInfo.GetStatic<string>("RELEASE");
}
}
public static string SDK
{
get
{
return versionInfo.GetStatic<string>("SDK");
}
}
public static int SDK_INT
{
get
{
return versionInfo.GetStatic<int>("SDK_INT");
}
}
public static string SECURITY_PATCH
{
get
{
return versionInfo.GetStatic<string>("SECURITY_PATCH");
}
}
public static string ALL_VERSION
{
get
{
string version = "BASE_OS: " + BASE_OS + "\n";
version += "CODENAME: " + CODENAME + "\n";
version += "INCREMENTAL: " + INCREMENTAL + "\n";
version += "PREVIEW_SDK_INT: " + PREVIEW_SDK_INT + "\n";
version += "RELEASE: " + RELEASE + "\n";
version += "SDK: " + SDK + "\n";
version += "SDK_INT: " + SDK_INT + "\n";
version += "SECURITY_PATCH: " + SECURITY_PATCH;
return version;
}
}
}