AppConfig.java
3.33 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
95
96
97
98
99
100
101
102
103
104
105
package com.shunzhi.parent;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import java.io.File;
/**
* Created by Administrator on 2018/3/7 0007.
*/
public class AppConfig {
//保存键值对
public static String SCHOOL_ID = "school_id";
public static String LOGIN_NAME = "login_name";
public static String LOGIN_PWD = "login_pwd";
public static String ACCESS_TOKEN = "access_token";
public static String USER_NAME = "user_name";
public static String USER_SEX = "user_sex";
public static String USER_IMAGE = "user_image";
public static String PARENT_ID = "parent_id";
public static String NIM_CONFIG_VIBRATE = "nim_config_vibrate";//收到通知震动
public static String NIM_CONFIG_SOUND = "nim_config_sound";//收到通知响铃
public static String ISBINDING="isbinding";
public static boolean ISLOGIN = false;
// public static boolean ISBINDING = false;
public static int BINDING_SUCCESS_HEZUO = 1;
public static int BINDING_SUCCESS_NOT = 2;
public static int ORDER_CENTER = 3;
public static String USER_ID = "user_id";
public static String APP_IS_START = "app_is_start";
//http://campus.myjxt.com/
// public static String BASE_URL="http://60.190.202.57:1000/";
// public static String BASE_URL_ORDER="http://60.190.202.57:8101/";
// public static String BASE_URL_FILE="http://60.190.202.57:8196";
//正式
public static String BASE_URL="http://campus.myjxt.com/";
public static String BASE_URL_ORDER="http://parent.myjxt.com/";
public static String BASE_URL_FILE="http://manage.myjxt.com";
// public static final String url_version = BASE_URL + "api/Common/AppVersion?appType=3";
//默认日志保存的路径
public final static String DEFAULT_SAVE_LOG_PATH = Environment
.getExternalStorageDirectory()
+ File.separator
+ "Eboardmenwei"
+ File.separator
+ "logs"
+ File.separator;
private static AppConfig appConfig = null;
private static Context mContext = null;
public static String url_apk="http://update.myjxt.com/zh_parent.apk";
public static AppConfig getAppConfig(Context context) {
if (appConfig == null) {
appConfig = new AppConfig();
mContext = context;
}
return appConfig;
}
//默认下载保存的路径
public final static String DEFAULT_SAVE_DOWNLOAD_PATH = Environment
.getExternalStorageDirectory()
+ File.separator
+ "Eboard"
+ File.separator
+ "download"
+ File.separator;
//得到保存的值
public String get(String key) {
return getSharedPreferences(mContext).getString(key, null);
}
private SharedPreferences getSharedPreferences(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context);
}
//保存键值对
public void set(String key, String value) {
SharedPreferences.Editor editor = getSharedPreferences(mContext).edit();
if (TextUtils.isEmpty(value)) {
editor.putString(key, value);
} else {
editor.putString(key, value.trim());
}
editor.commit();
}
}