1. Are you ready for the Galaxy S20? Here is everything we know so far!

Service and the Broadcast

Discussion in 'Android Development' started by xracerx, Jun 3, 2019.

  1. xracerx

    xracerx Lurker
    Thread Starter

    Hi there,

    I have issues with android services and broadcast activity when doing some development.

    I am using Android 8.0 as a test device btw.

    Code (Text):
    2. serviceIntent.setComponent(new ComponentName("com.service.sillyservice", "com.service.sillyservice.SillyService"));
    3. serviceIntent.putExtra("COMMAND","ls");
    4. startService(serviceIntent);
    Assuming it will invoke the start service from another activity:
    public int onStartCommand(Intent var1, int var2, int var3) {

    its return value is "1", how do I get the value of "1" and store it some where.

    Code (Text):
    1.         broadcastIntent.setComponent(new ComponentName("com.broadcast.vulnerablereceiver", "com.elearnsecurity.vulnerablereceiver.VulnerableReceiver"));
    2.                     broadcastIntent.setAction("com.broadcast.vulnerablereceiver.CHANGEPW");
    3.                     broadcastIntent.putExtra("PASSWORD",1);
    I am trying to mirror the same here:
    run app.broadcast.send --action com.broadcast.vulnerablereceiver.CHANGEPW" --component com.broadcast.vulnerablereceiver com.broadcast.vulnerablereceiver.VulnerableReceiver --extra string PASSWORD 1

    However, for some it show something like:
    Unable to start receiver com.broadcast.vulnerablereceiver.VulnerableReceiver: java.lang.NullPointerException: println needs a message


Share This Page