| | |
| | | import android.os.IBinder; |
| | | |
| | | import cn.com.basic.face.discern.entity.Device; |
| | | import cn.com.basic.face.service.ConnetedService; |
| | | import cn.com.basic.face.service.DictionaryMng; |
| | | import cn.com.basic.face.service.DeviceMng; |
| | | import cn.com.basic.face.util.WindowsUtil; |
| | |
| | | OkHttpUtils.init(this); |
| | | } |
| | | |
| | | boolean isConnect = false; |
| | | boolean flag = false; |
| | | |
| | | // |
| | | private ConnetedService.MyBinder myBinder; |
| | | |
| | | |
| | | private ServiceConnection conn=new ServiceConnection() { |
| | | |
| | | @Override |
| | | public void onServiceDisconnected(ComponentName arg0) { |
| | | myBinder=null; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onServiceConnected(ComponentName arg0, IBinder service) { |
| | | myBinder=(ConnetedService.MyBinder) service; |
| | | } |
| | | }; |
| | | |
| | | public void bindService(){ |
| | | isConnect = true; |
| | | flag=true; |
| | | Intent intent=new Intent(application,ConnetedService.class); |
| | | application.bindService(intent, conn, Context.BIND_AUTO_CREATE); |
| | | } |
| | | |
| | | } |