标签:android c class blog code java
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 |
private
static String newUUID() { return
UUID.randomUUID().toString(); } private
static String getLocaleCountry() { return
java.util.Locale.getDefault().getCountry(); } private
static String getLocaleLanguage() { return
java.util.Locale.getDefault().getLanguage(); } private
static long getTimeZoneOffset( long
time) { // TimeZone.getOffset() returns milliseconds. We want seconds. return
java.util.TimeZone.getDefault().getOffset(time) / 1000 ; } private
static String getTimeZoneName() { return
java.util.TimeZone.getDefault().getDisplayName( false , java.util.TimeZone.SHORT, java.util.Locale.getDefault()); } private
static long getFreeDiskSpace() { android.os.StatFs s = new
android.os.StatFs( android.os.Environment.getDataDirectory().getAbsolutePath()); return
( long )s.getAvailableBlocks() * ( long )s.getBlockSize(); } private
static long getTotalDiskSpace() { android.os.StatFs s = new
android.os.StatFs( android.os.Environment.getDataDirectory().getAbsolutePath()); return
( long )s.getBlockCount() * ( long )s.getBlockSize(); } private
String getPhoneNumberCountryCode() { try
{ android.telephony.TelephonyManager tm = (android.telephony.TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); try
{ return
tm.getNetworkCountryIso(); } catch
(Exception e) { return
tm.getSimCountryIso(); } } catch
(Exception e) { return
java.util.Locale.getDefault().getCountry(); } } |
android取国家,语言,存储大小等,布布扣,bubuko.com
标签:android c class blog code java
原文地址:http://www.cnblogs.com/profession/p/3763511.html