Back to project page SmartTools.
The source code is released under:
GNU General Public License
If you think the Android project SmartTools listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nj.simba; //from w w w. java2 s .c om import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class DaemonController extends BroadcastReceiver { public static String ACTION_START_SERVER="com.nj.simba.action.START_SERVER"; public static String ACTION_RELEASE_SERVER="com.nj.simba.action.RELEASE_SERVER"; @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d("Simba", action); if (action.equalsIgnoreCase(ACTION_START_SERVER)) { context.startService(new Intent("com.nj.simba.service")); } else if (action.equalsIgnoreCase(ACTION_RELEASE_SERVER)){ context.stopService(new Intent("com.nj.simba.service")); } else { Log.d("Simba", "Not support now!"); } } }