Android Open Source - android-sms-rpc Boot Broadcast Receiver






From Project

Back to project page android-sms-rpc.

License

The source code is released under:

MIT License

If you think the Android project android-sms-rpc listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package tk.aquaxp.smsgate.receiver;
/*from w w  w. j  av a  2s  .c  om*/
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import tk.aquaxp.smsgate.service.RPCService;

/**
 * Created by mindworm on 11/10/14.
 */
public class BootBroadcastReceiver extends BroadcastReceiver{
    private static final String TAG = "BootBroadcastReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        boolean enabled = RPCService.isEnabled(context);

        if(!enabled) return;
           try {
               Log.i(TAG, "Starting RPCService");
               context.startService(new Intent(context, RPCService.class));
           } catch (Exception e){
               Log.e(TAG, "onReceive", e);
           }
    }
}




Java Source Code List

tk.aquaxp.smsgate.ApplicationTest.java
tk.aquaxp.smsgate.activity.MainActivity.java
tk.aquaxp.smsgate.asynctask.TransmitTask.java
tk.aquaxp.smsgate.receiver.BootBroadcastReceiver.java
tk.aquaxp.smsgate.receiver.SMSBroadcastReceiver.java
tk.aquaxp.smsgate.restapi.APIServer.java
tk.aquaxp.smsgate.restapi.NanoHTTPD.java
tk.aquaxp.smsgate.service.RPCService.java
tk.aquaxp.smsgate.util.NetUtils.java
tk.aquaxp.smsgate.util.RPC.java