Commit 933baf7c53a1c79002ecfd05ea7479328003fd73
1 优化安装包体积
2 格式化代码
| @@ -9,7 +9,7 @@ android { | @@ -9,7 +9,7 @@ android { | ||
| 9 | compileSdkVersion 28 | 9 | compileSdkVersion 28 |
| 10 | defaultConfig { | 10 | defaultConfig { |
| 11 | applicationId "com.cnlive.strike" | 11 | applicationId "com.cnlive.strike" |
| 12 | - minSdkVersion 16 | 12 | + minSdkVersion 18 |
| 13 | targetSdkVersion 27 | 13 | targetSdkVersion 27 |
| 14 | versionCode 1 | 14 | versionCode 1 |
| 15 | versionName "1.0" | 15 | versionName "1.0" |
| @@ -9,6 +9,7 @@ import com.cnlive.moudle.collectionTrace.ui.activity.CollRunRaceDetailActivity; | @@ -9,6 +9,7 @@ import com.cnlive.moudle.collectionTrace.ui.activity.CollRunRaceDetailActivity; | ||
| 9 | import com.cnlive.moudle.collectionTrace.ui.activity.CollRunningFinishActivity; | 9 | import com.cnlive.moudle.collectionTrace.ui.activity.CollRunningFinishActivity; |
| 10 | import com.cnlive.moudle.collectionTrace.ui.activity.RaceListActivity; | 10 | import com.cnlive.moudle.collectionTrace.ui.activity.RaceListActivity; |
| 11 | import com.cnlive.moudle.collectionTrace.ui.activity.RaceNameListActivity; | 11 | import com.cnlive.moudle.collectionTrace.ui.activity.RaceNameListActivity; |
| 12 | +import com.cnlive.moudle.pedometer.model.Constant; | ||
| 12 | import com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity; | 13 | import com.cnlive.moudle.pedometer.ui.activity.MyRecordActivity; |
| 13 | import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity; | 14 | import com.cnlive.moudle.pedometer.ui.activity.RunLineActivity; |
| 14 | import com.cnlive.moudle.pedometer.ui.activity.SelfRecordActivity; | 15 | import com.cnlive.moudle.pedometer.ui.activity.SelfRecordActivity; |
| @@ -20,6 +21,7 @@ public class MainActivity extends AppCompatActivity { | @@ -20,6 +21,7 @@ public class MainActivity extends AppCompatActivity { | ||
| 20 | protected void onCreate(Bundle savedInstanceState) { | 21 | protected void onCreate(Bundle savedInstanceState) { |
| 21 | super.onCreate(savedInstanceState); | 22 | super.onCreate(savedInstanceState); |
| 22 | setContentView(R.layout.activity_main); | 23 | setContentView(R.layout.activity_main); |
| 24 | + | ||
| 23 | String uid = "358916"; | 25 | String uid = "358916"; |
| 24 | findViewById(R.id.recordd).setOnClickListener(new View.OnClickListener() { | 26 | findViewById(R.id.recordd).setOnClickListener(new View.OnClickListener() { |
| 25 | @Override | 27 | @Override |
| @@ -6,6 +6,7 @@ import com.alibaba.android.arouter.launcher.ARouter; | @@ -6,6 +6,7 @@ import com.alibaba.android.arouter.launcher.ARouter; | ||
| 6 | import com.baidu.mapapi.CoordType; | 6 | import com.baidu.mapapi.CoordType; |
| 7 | import com.baidu.mapapi.SDKInitializer; | 7 | import com.baidu.mapapi.SDKInitializer; |
| 8 | import com.cnlive.libs.base.application.AppConfig; | 8 | import com.cnlive.libs.base.application.AppConfig; |
| 9 | +import com.cnlive.moudle.pedometer.model.Constant; | ||
| 9 | 10 | ||
| 10 | public class MyApp extends Application { | 11 | public class MyApp extends Application { |
| 11 | @Override | 12 | @Override |
| @@ -15,6 +16,11 @@ public class MyApp extends Application { | @@ -15,6 +16,11 @@ public class MyApp extends Application { | ||
| 15 | AppConfig.init(getApplicationContext(), BuildConfig.APP_ID, BuildConfig.APP_KEY, BuildConfig.APP_SCERET, | 16 | AppConfig.init(getApplicationContext(), BuildConfig.APP_ID, BuildConfig.APP_KEY, BuildConfig.APP_SCERET, |
| 16 | 0, BuildConfig.DEBUG, "", "", | 17 | 0, BuildConfig.DEBUG, "", "", |
| 17 | userId, "", "", "", "", "", "", "", BuildConfig.BAIDU_MAP_APP_KEY); | 18 | userId, "", "", "", "", "", "", "", BuildConfig.BAIDU_MAP_APP_KEY); |
| 19 | + if (AppConfig.isDebug()) { | ||
| 20 | + Constant.SERVICE_ID = 213511; | ||
| 21 | + } else { | ||
| 22 | + Constant.SERVICE_ID = 214690; | ||
| 23 | + } | ||
| 18 | initARouter(); | 24 | initARouter(); |
| 19 | //在使用SDK各组件之前初始化context信息,传入ApplicationContext | 25 | //在使用SDK各组件之前初始化context信息,传入ApplicationContext |
| 20 | SDKInitializer.initialize(getApplicationContext()); | 26 | SDKInitializer.initialize(getApplicationContext()); |
| @@ -53,7 +53,7 @@ ext { | @@ -53,7 +53,7 @@ ext { | ||
| 53 | 53 | ||
| 54 | compileSdkVersion = 28 | 54 | compileSdkVersion = 28 |
| 55 | buildToolsVersion = "28.0.3" | 55 | buildToolsVersion = "28.0.3" |
| 56 | - minSdkVersion = 16 | 56 | + minSdkVersion = 18 |
| 57 | targetSdkVersion = 27 | 57 | targetSdkVersion = 27 |
| 58 | 58 | ||
| 59 | //support 相关 | 59 | //support 相关 |
| @@ -5,6 +5,19 @@ import android.content.Context; | @@ -5,6 +5,19 @@ import android.content.Context; | ||
| 5 | import com.cnlive.moudle.pedometer.utils.MySpHelper; | 5 | import com.cnlive.moudle.pedometer.utils.MySpHelper; |
| 6 | 6 | ||
| 7 | public class CollCommonInfo { | 7 | public class CollCommonInfo { |
| 8 | + private static final String KEY_USER_ID = "collUserId";//用户ID | ||
| 9 | + private static final String KEY_STEP_START_TIME = "collStepStartTime";//服务启动时间 | ||
| 10 | + private static final String KEY_WRITE_USER_STEP = "collWriteUserStep";//是否向数据库写入数据 | ||
| 11 | + private static final String KEY_IS_RUN_STEP_SERVICE = "collRunStepService";//是否运行计步服务 | ||
| 12 | + private static final String KEY_IS_RUN_KEEP_ALIVE_SERVICE = "collKeepAliveService";//是否运行保活服务 | ||
| 13 | + private static final String KEY_STREET_ID = "collStreetId";//赛事ID | ||
| 14 | + private static final String KEY_IS_RUN_BAIDU_TRACE_SERVICE = "collRunBaiduTraceService";//是否运行百度鹰眼服务 | ||
| 15 | + private static final String KEY_IS_FIRST_STEP_SEND_TRACE_TIP = "collFirstStepSendTraceTip";//是否第一次启动鹰眼服务 | ||
| 16 | + private static final String KEY_USER_NICK_NAME = "collRunUserNickName";//用户昵称 | ||
| 17 | + private static final String KEY_USER_NICK_ICON = "collRunUserNickIcon";//用户头像 | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + | ||
| 8 | 21 | ||
| 9 | /** | 22 | /** |
| 10 | * 设置计步时间 | 23 | * 设置计步时间 |
| @@ -12,7 +25,7 @@ public class CollCommonInfo { | @@ -12,7 +25,7 @@ public class CollCommonInfo { | ||
| 12 | * @param context | 25 | * @param context |
| 13 | */ | 26 | */ |
| 14 | public static void setStepStartTime(Context context, long currentTime) { | 27 | public static void setStepStartTime(Context context, long currentTime) { |
| 15 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putLong("CollstepStartTime", currentTime); | 28 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putLong(KEY_STEP_START_TIME, currentTime); |
| 16 | } | 29 | } |
| 17 | 30 | ||
| 18 | /** | 31 | /** |
| @@ -21,7 +34,7 @@ public class CollCommonInfo { | @@ -21,7 +34,7 @@ public class CollCommonInfo { | ||
| 21 | * @param context | 34 | * @param context |
| 22 | */ | 35 | */ |
| 23 | public static long getStepStartTime(Context context) { | 36 | public static long getStepStartTime(Context context) { |
| 24 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getLong("CollstepStartTime", 0); | 37 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getLong(KEY_STEP_START_TIME, 0); |
| 25 | } | 38 | } |
| 26 | 39 | ||
| 27 | /** | 40 | /** |
| @@ -30,7 +43,7 @@ public class CollCommonInfo { | @@ -30,7 +43,7 @@ public class CollCommonInfo { | ||
| 30 | * @param context | 43 | * @param context |
| 31 | */ | 44 | */ |
| 32 | public static void setIsWriteUserStep(Context context, boolean isAllow) { | 45 | public static void setIsWriteUserStep(Context context, boolean isAllow) { |
| 33 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("CollwriteUserStep:", isAllow); | 46 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_WRITE_USER_STEP, isAllow); |
| 34 | } | 47 | } |
| 35 | 48 | ||
| 36 | /** | 49 | /** |
| @@ -39,7 +52,7 @@ public class CollCommonInfo { | @@ -39,7 +52,7 @@ public class CollCommonInfo { | ||
| 39 | * @param context | 52 | * @param context |
| 40 | */ | 53 | */ |
| 41 | public static boolean getIsWriteUserStep(Context context) { | 54 | public static boolean getIsWriteUserStep(Context context) { |
| 42 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("CollwriteUserStep", true); | 55 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_WRITE_USER_STEP, true); |
| 43 | } | 56 | } |
| 44 | 57 | ||
| 45 | /** | 58 | /** |
| @@ -47,14 +60,14 @@ public class CollCommonInfo { | @@ -47,14 +60,14 @@ public class CollCommonInfo { | ||
| 47 | * @param uid | 60 | * @param uid |
| 48 | */ | 61 | */ |
| 49 | public static void setUserId(Context context, String uid) { | 62 | public static void setUserId(Context context, String uid) { |
| 50 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("ColluserId", uid); | 63 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_USER_ID, uid); |
| 51 | } | 64 | } |
| 52 | 65 | ||
| 53 | /** | 66 | /** |
| 54 | * @param context | 67 | * @param context |
| 55 | */ | 68 | */ |
| 56 | public static String getUserId(Context context) { | 69 | public static String getUserId(Context context) { |
| 57 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("ColluserId", ""); | 70 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_USER_ID, ""); |
| 58 | } | 71 | } |
| 59 | 72 | ||
| 60 | /** | 73 | /** |
| @@ -64,7 +77,7 @@ public class CollCommonInfo { | @@ -64,7 +77,7 @@ public class CollCommonInfo { | ||
| 64 | * @param isAllow | 77 | * @param isAllow |
| 65 | */ | 78 | */ |
| 66 | public static void setIsRunStepService(Context context, boolean isAllow) { | 79 | public static void setIsRunStepService(Context context, boolean isAllow) { |
| 67 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("CollrunStepService", isAllow); | 80 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_IS_RUN_STEP_SERVICE, isAllow); |
| 68 | 81 | ||
| 69 | } | 82 | } |
| 70 | 83 | ||
| @@ -75,7 +88,7 @@ public class CollCommonInfo { | @@ -75,7 +88,7 @@ public class CollCommonInfo { | ||
| 75 | * @param isAllow | 88 | * @param isAllow |
| 76 | */ | 89 | */ |
| 77 | public static void setIsRunKeepAliveService(Context context, boolean isAllow) { | 90 | public static void setIsRunKeepAliveService(Context context, boolean isAllow) { |
| 78 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("CollKeepAliveService", isAllow); | 91 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_IS_RUN_KEEP_ALIVE_SERVICE, isAllow); |
| 79 | 92 | ||
| 80 | } | 93 | } |
| 81 | 94 | ||
| @@ -85,7 +98,7 @@ public class CollCommonInfo { | @@ -85,7 +98,7 @@ public class CollCommonInfo { | ||
| 85 | * @param context | 98 | * @param context |
| 86 | */ | 99 | */ |
| 87 | public static boolean getIsRunKeepAliveService(Context context) { | 100 | public static boolean getIsRunKeepAliveService(Context context) { |
| 88 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("CollKeepAliveService", false); | 101 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_IS_RUN_KEEP_ALIVE_SERVICE, false); |
| 89 | } | 102 | } |
| 90 | 103 | ||
| 91 | /** | 104 | /** |
| @@ -94,7 +107,7 @@ public class CollCommonInfo { | @@ -94,7 +107,7 @@ public class CollCommonInfo { | ||
| 94 | * @param context | 107 | * @param context |
| 95 | */ | 108 | */ |
| 96 | public static boolean getIsRunStepService(Context context) { | 109 | public static boolean getIsRunStepService(Context context) { |
| 97 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("CollrunStepService", false); | 110 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_IS_RUN_STEP_SERVICE, false); |
| 98 | } | 111 | } |
| 99 | 112 | ||
| 100 | /** | 113 | /** |
| @@ -104,7 +117,7 @@ public class CollCommonInfo { | @@ -104,7 +117,7 @@ public class CollCommonInfo { | ||
| 104 | * @param streetId | 117 | * @param streetId |
| 105 | */ | 118 | */ |
| 106 | public static void setStreetId(Context context, String streetId) { | 119 | public static void setStreetId(Context context, String streetId) { |
| 107 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("CollstreetId", streetId); | 120 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_STREET_ID, streetId); |
| 108 | } | 121 | } |
| 109 | 122 | ||
| 110 | /** | 123 | /** |
| @@ -113,7 +126,7 @@ public class CollCommonInfo { | @@ -113,7 +126,7 @@ public class CollCommonInfo { | ||
| 113 | * @param context | 126 | * @param context |
| 114 | */ | 127 | */ |
| 115 | public static String getStreetId(Context context) { | 128 | public static String getStreetId(Context context) { |
| 116 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("CollstreetId", ""); | 129 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_STREET_ID, ""); |
| 117 | } | 130 | } |
| 118 | 131 | ||
| 119 | /** | 132 | /** |
| @@ -123,7 +136,7 @@ public class CollCommonInfo { | @@ -123,7 +136,7 @@ public class CollCommonInfo { | ||
| 123 | * @param isRun | 136 | * @param isRun |
| 124 | */ | 137 | */ |
| 125 | public static void setTsRunBaiduTraceService(Context context, boolean isRun) { | 138 | public static void setTsRunBaiduTraceService(Context context, boolean isRun) { |
| 126 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("CollRunBaiduTraceService", isRun); | 139 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_IS_RUN_BAIDU_TRACE_SERVICE, isRun); |
| 127 | } | 140 | } |
| 128 | 141 | ||
| 129 | /** | 142 | /** |
| @@ -132,7 +145,7 @@ public class CollCommonInfo { | @@ -132,7 +145,7 @@ public class CollCommonInfo { | ||
| 132 | * @param context | 145 | * @param context |
| 133 | */ | 146 | */ |
| 134 | public static boolean getIsRunBaiduTraceService(Context context) { | 147 | public static boolean getIsRunBaiduTraceService(Context context) { |
| 135 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("CollRunBaiduTraceService", true); | 148 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_IS_RUN_BAIDU_TRACE_SERVICE, true); |
| 136 | } | 149 | } |
| 137 | 150 | ||
| 138 | /** | 151 | /** |
| @@ -142,7 +155,7 @@ public class CollCommonInfo { | @@ -142,7 +155,7 @@ public class CollCommonInfo { | ||
| 142 | * @param isAllow | 155 | * @param isAllow |
| 143 | */ | 156 | */ |
| 144 | public static void setIsFirstStepSendTraceTip(Context context, boolean isAllow) { | 157 | public static void setIsFirstStepSendTraceTip(Context context, boolean isAllow) { |
| 145 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("CollFirstStepSendTraceTip", isAllow); | 158 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_IS_FIRST_STEP_SEND_TRACE_TIP, isAllow); |
| 146 | } | 159 | } |
| 147 | 160 | ||
| 148 | /** | 161 | /** |
| @@ -152,7 +165,7 @@ public class CollCommonInfo { | @@ -152,7 +165,7 @@ public class CollCommonInfo { | ||
| 152 | * @param context | 165 | * @param context |
| 153 | */ | 166 | */ |
| 154 | public static boolean getIsFirstStepSendTraceTip(Context context) { | 167 | public static boolean getIsFirstStepSendTraceTip(Context context) { |
| 155 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("CollFirstStepSendTraceTip", true); | 168 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_IS_FIRST_STEP_SEND_TRACE_TIP, true); |
| 156 | } | 169 | } |
| 157 | 170 | ||
| 158 | /** | 171 | /** |
| @@ -162,7 +175,7 @@ public class CollCommonInfo { | @@ -162,7 +175,7 @@ public class CollCommonInfo { | ||
| 162 | * @param nickName | 175 | * @param nickName |
| 163 | */ | 176 | */ |
| 164 | public static void setUserNickName(Context context, String nickName) { | 177 | public static void setUserNickName(Context context, String nickName) { |
| 165 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("CollRunUserNickName", nickName); | 178 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_USER_NICK_NAME, nickName); |
| 166 | 179 | ||
| 167 | } | 180 | } |
| 168 | 181 | ||
| @@ -172,7 +185,7 @@ public class CollCommonInfo { | @@ -172,7 +185,7 @@ public class CollCommonInfo { | ||
| 172 | * @param context | 185 | * @param context |
| 173 | */ | 186 | */ |
| 174 | public static String getUserNickName(Context context) { | 187 | public static String getUserNickName(Context context) { |
| 175 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("CollRunUserNickName", ""); | 188 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_USER_NICK_NAME, ""); |
| 176 | 189 | ||
| 177 | } | 190 | } |
| 178 | 191 | ||
| @@ -183,7 +196,7 @@ public class CollCommonInfo { | @@ -183,7 +196,7 @@ public class CollCommonInfo { | ||
| 183 | * @param userIcon | 196 | * @param userIcon |
| 184 | */ | 197 | */ |
| 185 | public static void setUserIcon(Context context, String userIcon) { | 198 | public static void setUserIcon(Context context, String userIcon) { |
| 186 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("CollRunUserNickIcon", userIcon); | 199 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_USER_NICK_ICON, userIcon); |
| 187 | 200 | ||
| 188 | } | 201 | } |
| 189 | 202 | ||
| @@ -193,7 +206,7 @@ public class CollCommonInfo { | @@ -193,7 +206,7 @@ public class CollCommonInfo { | ||
| 193 | * @param context | 206 | * @param context |
| 194 | */ | 207 | */ |
| 195 | public static String getUserIcon(Context context) { | 208 | public static String getUserIcon(Context context) { |
| 196 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("CollRunUserNickIcon", ""); | 209 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_USER_NICK_ICON, ""); |
| 197 | 210 | ||
| 198 | } | 211 | } |
| 199 | 212 | ||
| @@ -202,13 +215,13 @@ public class CollCommonInfo { | @@ -202,13 +215,13 @@ public class CollCommonInfo { | ||
| 202 | * @param context | 215 | * @param context |
| 203 | */ | 216 | */ |
| 204 | public static void reset(Context context) { | 217 | public static void reset(Context context) { |
| 205 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("CollwriteUserStep"); | ||
| 206 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("CollstepStartTime"); | ||
| 207 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("CollrunStepService"); | ||
| 208 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("CollstepStartTime"); | ||
| 209 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("CollKeepAliveService"); | ||
| 210 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("CollRunBaiduTraceService"); | ||
| 211 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("CollFirstStepSendTraceTip"); | 218 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_WRITE_USER_STEP); |
| 219 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_STEP_START_TIME); | ||
| 220 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_IS_RUN_STEP_SERVICE); | ||
| 221 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_STEP_START_TIME); | ||
| 222 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_IS_RUN_KEEP_ALIVE_SERVICE); | ||
| 223 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_IS_RUN_BAIDU_TRACE_SERVICE); | ||
| 224 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_IS_FIRST_STEP_SEND_TRACE_TIP); | ||
| 212 | } | 225 | } |
| 213 | 226 | ||
| 214 | 227 |
| @@ -6,24 +6,19 @@ import com.cnlive.moudle.pedometer.utils.MySpHelper; | @@ -6,24 +6,19 @@ import com.cnlive.moudle.pedometer.utils.MySpHelper; | ||
| 6 | import com.cnlive.moudle.pedometer.utils.TimeUtil; | 6 | import com.cnlive.moudle.pedometer.utils.TimeUtil; |
| 7 | 7 | ||
| 8 | public class CommonInfo { | 8 | public class CommonInfo { |
| 9 | - | ||
| 10 | -// /** | ||
| 11 | -// * 设置计步时间 | ||
| 12 | -// * | ||
| 13 | -// * @param context | ||
| 14 | -// */ | ||
| 15 | -// public static void setStepStartTime(Context context, long currentTime) { | ||
| 16 | -// MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putLong("stepStartTime", currentTime); | ||
| 17 | -// } | ||
| 18 | -// | ||
| 19 | -// /** | ||
| 20 | -// * 获取计步时间 | ||
| 21 | -// * | ||
| 22 | -// * @param context | ||
| 23 | -// */ | ||
| 24 | -// public static long getStepStartTime(Context context) { | ||
| 25 | -// return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getLong("stepStartTime", 0); | ||
| 26 | -// } | 9 | + private static final String KEY_USER_ID = "runUserId";//用户ID |
| 10 | + private static final String KEY_WRITE_USER_STEP = "runWriteUserStep";//是否允许写入步数 | ||
| 11 | + private static final String KEY_RUN_WRITE_USER_STEP = "runStepService";//是否运行计步服务 | ||
| 12 | + private static final String KEY_KEEP_ALIVE_SERVICE = "runKeepAliveService";//是否运行保活服务 | ||
| 13 | + private static final String KEY_EVENT_ID = "runStreetId";//赛事id | ||
| 14 | + private static final String KEY_RUN_BAIDU_TRACE_SERVICE = "runBaiduTraceService";//是否运行百度服务 | ||
| 15 | + private static final String KEY_FIRST_STEP_SEND_TIP = "runFirstStepSendTraceTip";//是否是第一次启动鹰眼服务 | ||
| 16 | + private static final String KEY_FENCE_ID = "runFenceId";//围栏ID | ||
| 17 | + private static final String KEY_USER_NICK_NAME = "runUserNickName";//用户昵称 | ||
| 18 | + private static final String KEY_USER_NICK_ICON = "runUserNickIcon";//用户头像 | ||
| 19 | + private static final String KEY_USER_PHONE = "runUserPhone";//用户电话 | ||
| 20 | + private static final String KEY_IS_FIRST_SHOW_TIME_TIP = "runIsFirstShowTimeTip";//是否是第一次显示倒计时 | ||
| 21 | + private static final String KEY_IS_PAUSE_STATE = "runIsPauseState";//是否点击暂停按钮 | ||
| 27 | 22 | ||
| 28 | 23 | ||
| 29 | /** | 24 | /** |
| @@ -32,7 +27,7 @@ public class CommonInfo { | @@ -32,7 +27,7 @@ public class CommonInfo { | ||
| 32 | * @param context | 27 | * @param context |
| 33 | */ | 28 | */ |
| 34 | public static void setIsWriteUserStep(Context context, boolean isAllow) { | 29 | public static void setIsWriteUserStep(Context context, boolean isAllow) { |
| 35 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("writeUserStep:", isAllow); | 30 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_WRITE_USER_STEP, isAllow); |
| 36 | } | 31 | } |
| 37 | 32 | ||
| 38 | /** | 33 | /** |
| @@ -41,7 +36,7 @@ public class CommonInfo { | @@ -41,7 +36,7 @@ public class CommonInfo { | ||
| 41 | * @param context | 36 | * @param context |
| 42 | */ | 37 | */ |
| 43 | public static boolean getIsWriteUserStep(Context context) { | 38 | public static boolean getIsWriteUserStep(Context context) { |
| 44 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("writeUserStep", true); | 39 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_WRITE_USER_STEP, true); |
| 45 | } | 40 | } |
| 46 | 41 | ||
| 47 | /** | 42 | /** |
| @@ -49,14 +44,14 @@ public class CommonInfo { | @@ -49,14 +44,14 @@ public class CommonInfo { | ||
| 49 | * @param uid | 44 | * @param uid |
| 50 | */ | 45 | */ |
| 51 | public static void setUserId(Context context, String uid) { | 46 | public static void setUserId(Context context, String uid) { |
| 52 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("userId", uid); | 47 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_USER_ID, uid); |
| 53 | } | 48 | } |
| 54 | 49 | ||
| 55 | /** | 50 | /** |
| 56 | * @param context | 51 | * @param context |
| 57 | */ | 52 | */ |
| 58 | public static String getUserId(Context context) { | 53 | public static String getUserId(Context context) { |
| 59 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("userId", ""); | 54 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_USER_ID, ""); |
| 60 | } | 55 | } |
| 61 | 56 | ||
| 62 | /** | 57 | /** |
| @@ -66,7 +61,7 @@ public class CommonInfo { | @@ -66,7 +61,7 @@ public class CommonInfo { | ||
| 66 | * @param isAllow | 61 | * @param isAllow |
| 67 | */ | 62 | */ |
| 68 | public static void setIsRunStepService(Context context, boolean isAllow) { | 63 | public static void setIsRunStepService(Context context, boolean isAllow) { |
| 69 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("runStepService", isAllow); | 64 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_RUN_WRITE_USER_STEP, isAllow); |
| 70 | 65 | ||
| 71 | } | 66 | } |
| 72 | 67 | ||
| @@ -77,7 +72,7 @@ public class CommonInfo { | @@ -77,7 +72,7 @@ public class CommonInfo { | ||
| 77 | * @param isAllow | 72 | * @param isAllow |
| 78 | */ | 73 | */ |
| 79 | public static void setIsRunKeepAliveService(Context context, boolean isAllow) { | 74 | public static void setIsRunKeepAliveService(Context context, boolean isAllow) { |
| 80 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("KeepAliveService", isAllow); | 75 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_KEEP_ALIVE_SERVICE, isAllow); |
| 81 | 76 | ||
| 82 | } | 77 | } |
| 83 | 78 | ||
| @@ -87,7 +82,7 @@ public class CommonInfo { | @@ -87,7 +82,7 @@ public class CommonInfo { | ||
| 87 | * @param context | 82 | * @param context |
| 88 | */ | 83 | */ |
| 89 | public static boolean getIsRunKeepAliveService(Context context) { | 84 | public static boolean getIsRunKeepAliveService(Context context) { |
| 90 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("KeepAliveService", false); | 85 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_KEEP_ALIVE_SERVICE, false); |
| 91 | } | 86 | } |
| 92 | 87 | ||
| 93 | /** | 88 | /** |
| @@ -96,7 +91,7 @@ public class CommonInfo { | @@ -96,7 +91,7 @@ public class CommonInfo { | ||
| 96 | * @param context | 91 | * @param context |
| 97 | */ | 92 | */ |
| 98 | public static boolean getIsRunStepService(Context context) { | 93 | public static boolean getIsRunStepService(Context context) { |
| 99 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("runStepService", false); | 94 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_RUN_WRITE_USER_STEP, false); |
| 100 | } | 95 | } |
| 101 | 96 | ||
| 102 | /** | 97 | /** |
| @@ -106,7 +101,7 @@ public class CommonInfo { | @@ -106,7 +101,7 @@ public class CommonInfo { | ||
| 106 | * @param streetId | 101 | * @param streetId |
| 107 | */ | 102 | */ |
| 108 | public static void setStreetId(Context context, String streetId) { | 103 | public static void setStreetId(Context context, String streetId) { |
| 109 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("streetId", streetId); | 104 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_EVENT_ID, streetId); |
| 110 | } | 105 | } |
| 111 | 106 | ||
| 112 | /** | 107 | /** |
| @@ -115,7 +110,7 @@ public class CommonInfo { | @@ -115,7 +110,7 @@ public class CommonInfo { | ||
| 115 | * @param context | 110 | * @param context |
| 116 | */ | 111 | */ |
| 117 | public static String getStreetId(Context context) { | 112 | public static String getStreetId(Context context) { |
| 118 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("streetId", ""); | 113 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_EVENT_ID, ""); |
| 119 | } | 114 | } |
| 120 | 115 | ||
| 121 | /** | 116 | /** |
| @@ -125,7 +120,7 @@ public class CommonInfo { | @@ -125,7 +120,7 @@ public class CommonInfo { | ||
| 125 | * @param isRun | 120 | * @param isRun |
| 126 | */ | 121 | */ |
| 127 | public static void setTsRunBaiduTraceService(Context context, boolean isRun) { | 122 | public static void setTsRunBaiduTraceService(Context context, boolean isRun) { |
| 128 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("RunBaiduTraceService", isRun); | 123 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_RUN_BAIDU_TRACE_SERVICE, isRun); |
| 129 | } | 124 | } |
| 130 | 125 | ||
| 131 | /** | 126 | /** |
| @@ -134,7 +129,7 @@ public class CommonInfo { | @@ -134,7 +129,7 @@ public class CommonInfo { | ||
| 134 | * @param context | 129 | * @param context |
| 135 | */ | 130 | */ |
| 136 | public static boolean getIsRunBaiduTraceService(Context context) { | 131 | public static boolean getIsRunBaiduTraceService(Context context) { |
| 137 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("RunBaiduTraceService", true); | 132 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_RUN_BAIDU_TRACE_SERVICE, true); |
| 138 | } | 133 | } |
| 139 | 134 | ||
| 140 | /** | 135 | /** |
| @@ -144,7 +139,7 @@ public class CommonInfo { | @@ -144,7 +139,7 @@ public class CommonInfo { | ||
| 144 | * @param isAllow | 139 | * @param isAllow |
| 145 | */ | 140 | */ |
| 146 | public static void setIsFirstStepSendTraceTip(Context context, boolean isAllow) { | 141 | public static void setIsFirstStepSendTraceTip(Context context, boolean isAllow) { |
| 147 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("FirstStepSendTraceTip", isAllow); | 142 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_FIRST_STEP_SEND_TIP, isAllow); |
| 148 | } | 143 | } |
| 149 | 144 | ||
| 150 | /** | 145 | /** |
| @@ -154,7 +149,7 @@ public class CommonInfo { | @@ -154,7 +149,7 @@ public class CommonInfo { | ||
| 154 | * @param context | 149 | * @param context |
| 155 | */ | 150 | */ |
| 156 | public static boolean getIsFirstStepSendTraceTip(Context context) { | 151 | public static boolean getIsFirstStepSendTraceTip(Context context) { |
| 157 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("FirstStepSendTraceTip", true); | 152 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_FIRST_STEP_SEND_TIP, true); |
| 158 | } | 153 | } |
| 159 | 154 | ||
| 160 | /** | 155 | /** |
| @@ -164,7 +159,7 @@ public class CommonInfo { | @@ -164,7 +159,7 @@ public class CommonInfo { | ||
| 164 | * @param id | 159 | * @param id |
| 165 | */ | 160 | */ |
| 166 | public static void setFenceId(Context context, int id) { | 161 | public static void setFenceId(Context context, int id) { |
| 167 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putInt("FenceId", id); | 162 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putInt(KEY_FENCE_ID, id); |
| 168 | } | 163 | } |
| 169 | 164 | ||
| 170 | /** | 165 | /** |
| @@ -173,7 +168,7 @@ public class CommonInfo { | @@ -173,7 +168,7 @@ public class CommonInfo { | ||
| 173 | * @param context | 168 | * @param context |
| 174 | */ | 169 | */ |
| 175 | public static int getFenceId(Context context) { | 170 | public static int getFenceId(Context context) { |
| 176 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getInt("FenceId", -1); | 171 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getInt(KEY_FENCE_ID, -1); |
| 177 | } | 172 | } |
| 178 | 173 | ||
| 179 | /** | 174 | /** |
| @@ -183,7 +178,7 @@ public class CommonInfo { | @@ -183,7 +178,7 @@ public class CommonInfo { | ||
| 183 | * @param nickName | 178 | * @param nickName |
| 184 | */ | 179 | */ |
| 185 | public static void setUserNickName(Context context, String nickName) { | 180 | public static void setUserNickName(Context context, String nickName) { |
| 186 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("RunUserNickName", nickName); | 181 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_USER_NICK_NAME, nickName); |
| 187 | 182 | ||
| 188 | } | 183 | } |
| 189 | 184 | ||
| @@ -193,7 +188,7 @@ public class CommonInfo { | @@ -193,7 +188,7 @@ public class CommonInfo { | ||
| 193 | * @param context | 188 | * @param context |
| 194 | */ | 189 | */ |
| 195 | public static String getUserNickName(Context context) { | 190 | public static String getUserNickName(Context context) { |
| 196 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("RunUserNickName", ""); | 191 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_USER_NICK_NAME, ""); |
| 197 | 192 | ||
| 198 | } | 193 | } |
| 199 | 194 | ||
| @@ -204,7 +199,7 @@ public class CommonInfo { | @@ -204,7 +199,7 @@ public class CommonInfo { | ||
| 204 | * @param userIcon | 199 | * @param userIcon |
| 205 | */ | 200 | */ |
| 206 | public static void setUserIcon(Context context, String userIcon) { | 201 | public static void setUserIcon(Context context, String userIcon) { |
| 207 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("RunUserNickIcon", userIcon); | 202 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_USER_NICK_ICON, userIcon); |
| 208 | 203 | ||
| 209 | } | 204 | } |
| 210 | 205 | ||
| @@ -214,7 +209,7 @@ public class CommonInfo { | @@ -214,7 +209,7 @@ public class CommonInfo { | ||
| 214 | * @param context | 209 | * @param context |
| 215 | */ | 210 | */ |
| 216 | public static String getUserIcon(Context context) { | 211 | public static String getUserIcon(Context context) { |
| 217 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("RunUserNickIcon", ""); | 212 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_USER_NICK_ICON, ""); |
| 218 | 213 | ||
| 219 | } | 214 | } |
| 220 | 215 | ||
| @@ -225,7 +220,7 @@ public class CommonInfo { | @@ -225,7 +220,7 @@ public class CommonInfo { | ||
| 225 | * @param userIcon | 220 | * @param userIcon |
| 226 | */ | 221 | */ |
| 227 | public static void setUserPhone(Context context, String userIcon) { | 222 | public static void setUserPhone(Context context, String userIcon) { |
| 228 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("RunUserPhone", userIcon); | 223 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString(KEY_USER_PHONE, userIcon); |
| 229 | 224 | ||
| 230 | } | 225 | } |
| 231 | 226 | ||
| @@ -235,7 +230,7 @@ public class CommonInfo { | @@ -235,7 +230,7 @@ public class CommonInfo { | ||
| 235 | * @param context | 230 | * @param context |
| 236 | */ | 231 | */ |
| 237 | public static String getUserPhone(Context context) { | 232 | public static String getUserPhone(Context context) { |
| 238 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("RunUserPhone", ""); | 233 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString(KEY_USER_PHONE, ""); |
| 239 | 234 | ||
| 240 | } | 235 | } |
| 241 | 236 | ||
| @@ -247,7 +242,7 @@ public class CommonInfo { | @@ -247,7 +242,7 @@ public class CommonInfo { | ||
| 247 | * @param isAllow | 242 | * @param isAllow |
| 248 | */ | 243 | */ |
| 249 | public static void setIsFirstShowTimeTip(Context context, boolean isAllow) { | 244 | public static void setIsFirstShowTimeTip(Context context, boolean isAllow) { |
| 250 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("IsFirstShowTimeTip", isAllow); | 245 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_IS_FIRST_SHOW_TIME_TIP, isAllow); |
| 251 | } | 246 | } |
| 252 | 247 | ||
| 253 | /** | 248 | /** |
| @@ -256,7 +251,7 @@ public class CommonInfo { | @@ -256,7 +251,7 @@ public class CommonInfo { | ||
| 256 | * @param context | 251 | * @param context |
| 257 | */ | 252 | */ |
| 258 | public static boolean getIsFirstShowTimeTip(Context context) { | 253 | public static boolean getIsFirstShowTimeTip(Context context) { |
| 259 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("IsFirstShowTimeTip", true); | 254 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_IS_FIRST_SHOW_TIME_TIP, true); |
| 260 | } | 255 | } |
| 261 | 256 | ||
| 262 | /** | 257 | /** |
| @@ -266,7 +261,7 @@ public class CommonInfo { | @@ -266,7 +261,7 @@ public class CommonInfo { | ||
| 266 | * @param isAllow | 261 | * @param isAllow |
| 267 | */ | 262 | */ |
| 268 | public static void setIsPauseState(Context context, boolean isAllow) { | 263 | public static void setIsPauseState(Context context, boolean isAllow) { |
| 269 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean("runIsPauseState", isAllow); | 264 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putBoolean(KEY_IS_PAUSE_STATE, isAllow); |
| 270 | } | 265 | } |
| 271 | 266 | ||
| 272 | /** | 267 | /** |
| @@ -275,68 +270,23 @@ public class CommonInfo { | @@ -275,68 +270,23 @@ public class CommonInfo { | ||
| 275 | * @param context | 270 | * @param context |
| 276 | */ | 271 | */ |
| 277 | public static boolean getIsPause(Context context) { | 272 | public static boolean getIsPause(Context context) { |
| 278 | - return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean("runIsPauseState", false); | 273 | + return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getBoolean(KEY_IS_PAUSE_STATE, false); |
| 279 | } | 274 | } |
| 280 | 275 | ||
| 281 | - | ||
| 282 | -// /** | ||
| 283 | -// * 设置赛事标题 | ||
| 284 | -// * | ||
| 285 | -// * @param context | ||
| 286 | -// * @param streetTitle | ||
| 287 | -// */ | ||
| 288 | -// public static void setStreetTitle(Context context, String streetTitle) { | ||
| 289 | -// MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("runStreetTitle", streetTitle); | ||
| 290 | -// | ||
| 291 | -// } | ||
| 292 | -// | ||
| 293 | -// /** | ||
| 294 | -// * 获取赛事标题 | ||
| 295 | -// * | ||
| 296 | -// * @param context | ||
| 297 | -// */ | ||
| 298 | -// public static String getStreetTitle(Context context) { | ||
| 299 | -// return MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).getString("runStreetTitle", ""); | ||
| 300 | -// | ||
| 301 | -// } | ||
| 302 | - | ||
| 303 | - // /** | ||
| 304 | -// * 设置起点经纬度 | ||
| 305 | -// * | ||
| 306 | -// * @param context | ||
| 307 | -// * @param startLatLng | ||
| 308 | -// */ | ||
| 309 | -// public static void setStartLatLng(Context context, String startLatLng) { | ||
| 310 | -// MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("runStartLatLng", startLatLng); | ||
| 311 | -// | ||
| 312 | -// } | ||
| 313 | -// | ||
| 314 | -// /** | ||
| 315 | -// * 设置终点经纬度 | ||
| 316 | -// * | ||
| 317 | -// * @param context | ||
| 318 | -// * @param endLatLng | ||
| 319 | -// */ | ||
| 320 | -// public static void setEndLatLng(Context context, String endLatLng) { | ||
| 321 | -// MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).putString("runEndLatLng", endLatLng); | ||
| 322 | -// | ||
| 323 | -// } | ||
| 324 | /*重置 | 276 | /*重置 |
| 325 | * @param context | 277 | * @param context |
| 326 | */ | 278 | */ |
| 327 | public static void reset(Context context) { | 279 | public static void reset(Context context) { |
| 328 | 280 | ||
| 329 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("IsFirstShowTimeTip"); | ||
| 330 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("writeUserStep"); | ||
| 331 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runStepService"); | ||
| 332 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("KeepAliveService"); | ||
| 333 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("RunBaiduTraceService"); | ||
| 334 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("streetId"); | ||
| 335 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("FirstStepSendTraceTip"); | ||
| 336 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("FenceId"); | ||
| 337 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("IsFirstShowTimeTip"); | ||
| 338 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runIsPauseState"); | ||
| 339 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runStreetTitle"); | 281 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_WRITE_USER_STEP); |
| 282 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_RUN_WRITE_USER_STEP); | ||
| 283 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_KEEP_ALIVE_SERVICE); | ||
| 284 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_RUN_BAIDU_TRACE_SERVICE); | ||
| 285 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_EVENT_ID); | ||
| 286 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_FIRST_STEP_SEND_TIP); | ||
| 287 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_FENCE_ID); | ||
| 288 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_IS_FIRST_SHOW_TIME_TIP); | ||
| 289 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_IS_PAUSE_STATE); | ||
| 340 | 290 | ||
| 341 | 291 | ||
| 342 | } | 292 | } |
| @@ -345,14 +295,13 @@ public class CommonInfo { | @@ -345,14 +295,13 @@ public class CommonInfo { | ||
| 345 | * @param context | 295 | * @param context |
| 346 | */ | 296 | */ |
| 347 | public static void resetRace(Context context) { | 297 | public static void resetRace(Context context) { |
| 348 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("IsFirstShowTimeTip"); | ||
| 349 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("writeUserStep"); | ||
| 350 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runStepService"); | ||
| 351 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("KeepAliveService"); | ||
| 352 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("RunBaiduTraceService"); | ||
| 353 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("FirstStepSendTraceTip"); | ||
| 354 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("IsFirstShowTimeTip"); | ||
| 355 | - MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey("runIsPauseState"); | 298 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_WRITE_USER_STEP); |
| 299 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_RUN_WRITE_USER_STEP); | ||
| 300 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_KEEP_ALIVE_SERVICE); | ||
| 301 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_RUN_BAIDU_TRACE_SERVICE); | ||
| 302 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_FIRST_STEP_SEND_TIP); | ||
| 303 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_IS_FIRST_SHOW_TIME_TIP); | ||
| 304 | + MySpHelper.getInstance(context, Context.MODE_MULTI_PROCESS).removeKey(KEY_IS_PAUSE_STATE); | ||
| 356 | 305 | ||
| 357 | } | 306 | } |
| 358 | } | 307 | } |
| @@ -25,7 +25,7 @@ public class Constant { | @@ -25,7 +25,7 @@ public class Constant { | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | /*************************************用户其他值,非标志位************************************************************/ | 27 | /*************************************用户其他值,非标志位************************************************************/ |
| 28 | - public static final long SERVICE_ID = 213511;//公司账号 | 28 | + public static long SERVICE_ID = 0;//公司账号 |
| 29 | // public static final long SERVICE_ID = 213553; | 29 | // public static final long SERVICE_ID = 213553; |
| 30 | public static final int TAG = 1; | 30 | public static final int TAG = 1; |
| 31 | public static final int GATHER_INTERVAL = 2;//位置采集周期 | 31 | public static final int GATHER_INTERVAL = 2;//位置采集周期 |
| @@ -38,7 +38,7 @@ public class Constant { | @@ -38,7 +38,7 @@ public class Constant { | ||
| 38 | public static final int CHECK_ACCURACY = 50;//判断用户是否完成的精度范围 | 38 | public static final int CHECK_ACCURACY = 50;//判断用户是否完成的精度范围 |
| 39 | public static final int LOCA_ACCURACY = 20;//定位过滤精度 | 39 | public static final int LOCA_ACCURACY = 20;//定位过滤精度 |
| 40 | public static final int LOCA_END_POINT_ACCURACY = 20;//终点位置比较精度 | 40 | public static final int LOCA_END_POINT_ACCURACY = 20;//终点位置比较精度 |
| 41 | - public static final int LOCA_START_POINT_ACCURACY = 20;//起点位置比较精度 | 41 | + public static final int LOCA_START_POINT_ACCURACY = 200;//起点位置比较精度 |
| 42 | public static final int FENCE_OFFSET = 50;//围栏偏离距离 | 42 | public static final int FENCE_OFFSET = 50;//围栏偏离距离 |
| 43 | public static final int FENCE_DENOISE = 20;//围栏去噪精度 | 43 | public static final int FENCE_DENOISE = 20;//围栏去噪精度 |
| 44 | public static final int TAKE_POINT_MAX_SIZE = 100;//最大打点数量 | 44 | public static final int TAKE_POINT_MAX_SIZE = 100;//最大打点数量 |
3.67 KB
3.49 KB
765 Bytes
14.1 KB
14.5 KB
14 KB
14.4 KB
2.73 KB
2.03 KB
915 Bytes
1.38 KB
1.62 KB
702 Bytes
2.85 KB
1.45 KB
14.5 KB
1.15 KB
974 Bytes
469 Bytes
2.97 KB
1.22 KB
414 Bytes
931 Bytes
7.73 KB
1.7 KB
252 Bytes
114 Bytes
414 Bytes
306 Bytes
440 Bytes
444 Bytes
1.38 KB
208 KB
975 Bytes
8.58 KB
818 Bytes
322 Bytes
758 Bytes
903 Bytes
1.8 KB
2.02 KB
773 Bytes
1.86 KB
652 Bytes
1014 Bytes
863 Bytes
37.1 KB
6.33 KB
2.84 KB
2.39 KB
5.84 KB
5.44 KB
5.18 KB
968 Bytes
15.7 KB
16.6 KB
15.8 KB
16.3 KB
3.11 KB
2.44 KB
1.07 KB
1.89 KB
1.99 KB
855 Bytes
3.58 KB
2.32 KB
16.6 KB
1.36 KB
705 Bytes
1.08 KB
517 Bytes
3.73 KB
1.31 KB
705 Bytes
459 Bytes
831 Bytes
7.52 KB
2.04 KB
152 Bytes
555 Bytes
130 Bytes
212 Bytes
1.38 KB
272 KB
1.07 KB
9.28 KB
917 Bytes
370 Bytes
793 Bytes
1.01 KB
1.9 KB
2.15 KB
777 Bytes
1.97 KB
747 Bytes
1.19 KB
979 Bytes
468 Bytes
119 KB
9.53 KB
2.34 KB
2.16 KB
3.96 KB
11.2 KB
10.6 KB
1.79 KB
30.6 KB
31.9 KB
31.9 KB
30.5 KB
31.4 KB
6.3 KB
4.66 KB
1.85 KB
3.54 KB
3.79 KB
1.49 KB
6.98 KB
2.32 KB
32 KB
2.61 KB
1.17 KB
2.09 KB
1002 Bytes
7.3 KB
2.81 KB
1.17 KB
776 Bytes
1.92 KB
23.2 KB
3.71 KB
427 Bytes
854 Bytes
207 Bytes
501 Bytes
384 Bytes
723 Bytes
636 Bytes
3.01 KB
633 KB
2.04 KB
23.4 KB
1.8 KB
725 Bytes
1.39 KB
1.84 KB
3.74 KB
4.42 KB
1.51 KB
3.91 KB
1.29 KB
2.33 KB
1.85 KB
877 Bytes
175 KB
18.7 KB
7.72 KB
6.58 KB
17.1 KB