| | |
| | | |
| | | import android.app.Application; |
| | | |
| | | import cn.com.basic.face.discern.entity.Device; |
| | | import cn.com.basic.face.service.DictionaryMng; |
| | | import cn.com.basic.face.service.PlaceMng; |
| | | import cn.com.basic.face.service.VisitorTypeMng; |
| | | import cn.com.basic.face.service.DeviceMng; |
| | | import cn.com.basic.face.util.WindowsUtil; |
| | | |
| | | import com.facebook.drawee.backends.pipeline.Fresco; |
| | | import com.lzy.okhttputils.OkHttpUtils; |
| | | import com.lzy.okhttputils.model.HttpHeaders; |
| | | import com.lzy.okhttputils.model.HttpParams; |
| | | |
| | | import org.xutils.x; |
| | | |
| | | import cn.com.basic.face.discern.entity.Place; |
| | | |
| | | /** |
| | | * Created by zhangbo on 2017/2/15. |
| | | */ |
| | | |
| | | public class BaseApplication extends Application{ |
| | | |
| | |
| | | return application; |
| | | } |
| | | |
| | | private Place place; |
| | | private Device device; |
| | | |
| | | public void setPlace(Place place) { |
| | | this.place = place; |
| | | public static boolean deviceAvailable = false; |
| | | |
| | | public void setDevice(Device device) { |
| | | this.device = device; |
| | | if (device != null && device.getDeviceId() != null && !"".equals(device.getDeviceId())) { |
| | | deviceAvailable = true; |
| | | DictionaryMng.getInstance().loadAllDictionaryData(); |
| | | } |
| | | } |
| | | |
| | | public Place getPlace() { |
| | | if (place == null) { |
| | | place = new Place(); |
| | | public Device getDevice() { |
| | | if (device == null) { |
| | | device = new Device(); |
| | | } |
| | | return place; |
| | | return device; |
| | | } |
| | | |
| | | @Override |
| | |
| | | Fresco.initialize(this); |
| | | initOkHttpUtils(); |
| | | application = this; |
| | | PlaceMng.getInstance().findPlace(); |
| | | DictionaryMng.getInstance().loadAllDictionaryData(); |
| | | VisitorTypeMng.getInstance().loadAll(); |
| | | DeviceMng.getInstance().findDevice(); |
| | | |
| | | } |
| | | |
| | | private void initOkHttpUtils() { |