| | |
| | | package com.moral.yunfushao; |
| | | |
| | | import android.app.Application; |
| | | import android.bluetooth.BluetoothGattService; |
| | | |
| | | import com.baidu.location.BDLocation; |
| | |
| | | import com.lzy.okgo.OkGo; |
| | | import com.lzy.okgo.cookie.store.PersistentCookieStore; |
| | | import com.moral.andbrickslib.utils.log.XLog; |
| | | import com.moral.yunfushao.activity.VoiceSetActivity; |
| | | import com.moral.yunfushao.common.AppConfig; |
| | | import com.moral.yunfushao.utils.SharedPreferencesUtil; |
| | | |
| | |
| | | * Created by haijiang on 2017/5/2. |
| | | */ |
| | | |
| | | public class MainApp extends Application { |
| | | public class MainApp extends SampleApplication { |
| | | public static MainApp theApp; |
| | | //用户id |
| | | public static String userId; |
| | |
| | | */ |
| | | LocationClient mLocClient; |
| | | public MyLocationListenner myListener; |
| | | public static double mLat,mLon; |
| | | public static double mLat, mLon; |
| | | public static String address; |
| | | |
| | | @Override |
| | | public void onCreate() { |
| | | super.onCreate(); |
| | |
| | | OkGo.init(this); |
| | | OkGo.getInstance().setCookieStore(new PersistentCookieStore()); |
| | | |
| | | if(sharedPreferencesUtil == null){ |
| | | sharedPreferencesUtil = new SharedPreferencesUtil(this); |
| | | if (sharedPreferencesUtil == null) { |
| | | sharedPreferencesUtil = SharedPreferencesUtil.getUtil(this); |
| | | } |
| | | userId = sharedPreferencesUtil.getUserid(); |
| | | |
| | | |
| | | |
| | | if (MainApp.theApp.sharedPreferencesUtil.getVoiceType() == 0) { |
| | | AppConfig.voideUrl1 = "http://yfsapi.7drlb.com/video/boy/music.mp3"; |
| | |
| | | AppConfig.voideUrl1 = "http://yfsapi.7drlb.com/video/girl/music.mp3"; |
| | | AppConfig.voideUrl2 = "http://yfsapi.7drlb.com/video/girl/music1.mp3"; |
| | | AppConfig.voideUrl3 = "http://yfsapi.7drlb.com/video/girl/music2.mp3"; |
| | | } else if (MainApp.theApp.sharedPreferencesUtil.getVoiceType() == 2) { |
| | | AppConfig.voideUrl1 = null; |
| | | AppConfig.voideUrl2 = null; |
| | | AppConfig.voideUrl3 = null; |
| | | } |
| | | bleManager = new BleManager(this); |
| | | |
| | |
| | | option.setOpenGps(true); // 打开gps |
| | | option.setCoorType("bd09ll"); // 设置坐标类型 |
| | | option.setIsNeedAddress(true); |
| | | option.setScanSpan(1000*60); |
| | | option.setScanSpan(1000 * 60); |
| | | mLocClient.setLocOption(option); |
| | | mLocClient.start(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定位SDK监听函数 |
| | |
| | | mLat = location.getLatitude(); |
| | | mLon = location.getLongitude(); |
| | | address = location.getAddrStr(); |
| | | XLog.d(mLat+"|"+mLon+"|"+address); |
| | | XLog.d(mLat + "|" + mLon + "|" + address); |
| | | } |
| | | } |
| | | } |