| | |
| | | package cn.com.basic.face.base; |
| | | |
| | | import android.app.Application; |
| | | import android.content.ComponentName; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.ServiceConnection; |
| | | import android.os.IBinder; |
| | | |
| | | import cn.com.basic.face.discern.common.CommonVariables; |
| | | import cn.com.basic.face.discern.entity.Device; |
| | | import cn.com.basic.face.discern.query.item.DeviceQueryItem; |
| | | import cn.com.basic.face.service.InternetAccessThread; |
| | | import cn.com.basic.face.service.DictionaryMng; |
| | | 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; |
| | |
| | | } |
| | | |
| | | private Device androidDevice; |
| | | private Device camera1; |
| | | private Device camera2; |
| | | private DeviceQueryItem camera1; |
| | | private DeviceQueryItem camera2; |
| | | |
| | | |
| | | public static boolean deviceAvailable = false; |
| | |
| | | } |
| | | } |
| | | |
| | | public void setCamera1(Device camera1) { |
| | | public void setCamera1(DeviceQueryItem camera1) { |
| | | this.camera1 = camera1; |
| | | if (camera1 != null && camera1.getDeviceId() != null && !"".equals(camera1.getDeviceId())) { |
| | | DictionaryMng.getInstance().loadAllDictionaryData(); |
| | | } |
| | | } |
| | | |
| | | public void setCamera2(Device camera2) { |
| | | public void setCamera2(DeviceQueryItem camera2) { |
| | | this.camera2 = camera2; |
| | | if (camera2 != null && camera2.getDeviceId() != null && !"".equals(camera2.getDeviceId())) { |
| | | DictionaryMng.getInstance().loadAllDictionaryData(); |
| | |
| | | Fresco.initialize(this); |
| | | initOkHttpUtils(); |
| | | application = this; |
| | | DeviceMng.getInstance().findDevice(); |
| | | |
| | | } |
| | | |
| | | private void initOkHttpUtils() { |
| | |
| | | } |
| | | |
| | | |
| | | public boolean networkAvailable() { |
| | | // return false; |
| | | return MainActivity.getInstance().getInternetAccessible() == CommonVariables.InternetAccess.INTERNET_ACCESSIBLE; |
| | | } |
| | | } |