안녕하세요.
BLE 통신 앱을 실행하는데 다음과 같은 현상이 발생해서 글 올립니다.
1.정상적으로 시작/종료가 될 때가 있음.
2.전체적으로 10에 1,2번은 이상현상이 발생.
3.앱이 극단적으로 느려지거나 멈춰버림.
doKeyCodeBack로 종료하려고 해도 종료되지 않습니다.
이런 경우 홈버튼-강제종료를 해야합니다.
앱을 중간에 넘겨받은지라 전체 구조를 파악하기 위해 LOG를 찍어보았는데,
3번의 현상이 나타나는 시점 이후로 LOG가 엄청 느리게 찍히거나 멈춥니다.
여러번 테스트를 해서 느려지는 시점으로 파악되는 곳을 찾았는데,
조언 좀 해주시면 감사하겠습니다.
맨 처음 onCreate에서 service에 바인드 하기 위해 아래의 service_init()함수로 이동합니다.
private void service_init() {
Intent bindIntent = new Intent(this, UartService.class);
bindService(bindIntent, mServiceConnection, Context.BIND_AUTO_CREATE);
LocalBroadcastManager.getInstance(this).registerReceiver(UARTStatusChangeReceiver,
makeGattUpdateIntentFilter());
}
bindService() 호출 후,
UartService.class 의
@Override
public IBinder onBind(Intent intent) {
return mBinder;
}
public class LocalBinder extends Binder {
public UartService getService()
{
return UartService.this;
}
}
를 통해 service 값을 가져오는 것이라 알고있는데..
로그를 확인해보니 bindService->onbind간 시간이 오래 걸립니다.
bindService를 실행할 때 이런 지체되는 현상이 발생할 수 도 있나요?..
긴 글 읽어주셔서 감사합니다.