Android デバイスで 12 時間連続で実行する必要がある Android アプリケーションを開発しています。デバイスはこのアプリを使用する以外は何もしないので、常にフォアグラウンドにあります。さまざまな遅延の後、私のアプリは次のメッセージで OS によって強制終了されました。
I/ActivityManager( 360): No longer want com.my.app (pid 1234): empty for 10292s
I/qtaguid ( 360): Failed write_ctrl(s 0 10066) res=-1 errno=1
W/NetworkManagementSocketTagger( 360): setKernelCountSet(10066, 0) failed with errno -1
I/WindowState( 360): WIN DEATH: Window{415f9718 u0 SurfaceView}
I/WindowState( 360): WIN DEATH: Window{415b8f08 u0 com.my.app/com.my.app.MainActivity}
W/WindowManager( 360): Force-removing child win Window{415cc938 u0 SurfaceView} from container Window{415b8f08 u0 com.my.app/com.my.app.MainActivity}
私のアプリは、VideoView を使用してローカルの html ファイルを表示し、サービスを使用してサーバーとのリアルタイム接続を維持しています。サービスに関連している可能性があると思いますが、その手がかりは見つかりませんでした。この種のエラーで何が起こっているかのスタックを取得する方法はありますか?
編集:
サービスなしでアプリを実行しようとしましたが、それでも問題が発生するため、サービスとは関係ありません。
編集2:
これがサービスを起動するための私のコードです。
アクティビティ
private ServiceConnection mConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName className,IBinder binder) {
Log.d("ServiceConnection", "Service connected");
SocketClientBinder rmBinder = (SocketClientBinder) binder;
socketService = rmBinder.getService();
isBound = true;
}
public void onServiceDisconnected(ComponentName className) {
isBound = false;
}
};
public void onDestroy() {
//we unbind our service to avoid keeping the connection
if (isBound) {
unbindService(mConnection);
isBound = false;
}
super.onDestroy();
}
public void onStart() {
super.onStart();
if( ! isBound) {
//We bind our activity with our service
Intent intent = new Intent(this, SocketClientService.class);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE | Context.BIND_WAIVE_PRIORITY | Context.BIND_ADJUST_WITH_ACTIVITY | Context.BIND_IMPORTANT);
}
}