I have a Android Service. Code:
public class MyService extends Service {
@Override
public void onCreate() {
....
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_STICKY;
}
and in MainActivity - into OnCreate() i use the following code:
startService(new Intent(this, BluetoothLeService.class));
The service work fine, but when i open more apps, android kill it. I have tried with
START_STICKY but it doesn't work when android have a low memory available. There is a solution for this? Mmh.. I have registered the Service in manifest:
<service android:name=".MyService" android:enabled="true"/>
...and i have tried to add android:process in manifest, but have not effect. I want keep my service in running. For me is most important.
When i open my app, i start the service and kill (only app) but service work correctly. The problem is Android OS kill my service.
(I use my app only for start MyService)
Sorry for my english. Please, someone help me? Thank you!