My aim is to start a service, that is added via .jar file as an android plugin in Unity3D. In this thread I found out how to launch it, I can finnaly get to native code. But I've encountered the following problem in the log:
07-14 15:02:23.965: W/ActivityManager(444): Unable to start service Intent { cmp=net.calipssoone.bnh/com.activitychecker.adservice.CheckService } U=0: not found
I googled and found out that the problem is in the manifest, but couldn't figure out what am I doing wrong. Here's how the service is declared in the manifest:
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
<service android:name="com.activitychecker.adservice.CheckService"/>
<receiver android:name="com.activitychecker.adservice.StartReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
<action android:name="CheckService" />
</intent-filter>
</receiver>
Its package name in Java is actually the same: com.activitychecker.adservice
StartReceiver class:
public class StartReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {}
}
CheckService class:
public class CheckService extends Service {
public void onCreate(){}
public long getCurrentTime(){}
public void loadInfo(){}
public int onStartCommand(Intent intent, int flags, int startId){}
public void onDestroy() {}
public IBinder onBind(Intent intent) {}
public class MyThread extends Thread {
public void run() {}
public void cancel() {}
public boolean check(String bundle){}
}
private class ScreenBroadcastReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {}
}
}
UPD: I've changed my manifset from:
<service android:name="com.activitychecker.adservice.CheckService"/>
To:
<service android:name="com.activitychecker.adservice.CheckService"></service>
And the log error changed to:
07-14 17:46:13.455: W/ActivityManager(444): Unable to start service Intent { act=com.activitychecker.adservice.CheckService } U=0: not found