Ok let's summarize :
I can launch IPWebCam with an intent
I can monitor if a client is connectied or not with the above code
Now I would like to stop the Webcam server as I don't want to have to webcam opened all the time...
I asked to the developper (Pavel -thanks to him-) and he replied this :
Alternatively, use a command line: you can start IP Webcam using
- am broadcast -a com.pas.webcam.CONTROL -e action start
And stop it like this:
- am broadcast -a com.pas.webcam.CONTROL -e action stop
So I installed Terminal emulator on the phone and tried to launch the IPWebcam with the command line.
Here is what I got :
broadcast -a com.pas.webcam.CONTROL -e action start <
Broadcasting: Intent { act=com.pas.webcam.CONTROL launchParam=MultiScreenLaunchParams { mDisplayId=0 mFlags=0 } (has extras) }
java.lang.SecurityException: Permission Denial: broadcast asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS
at android.os.Parcel.readException(Parcel.java:1693) at android.os.Parcel.readException(Parcel.java:1646) at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:4012)
at com.android.commands.am.Am.sendBroadcast(Am.java:800)
at com.android.commands.am.Am.onRun(Am.java:408)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
at com.android.commands.am.Am.main(Am.java:125)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
So obviously a security problem...
Any idea how to send this on line command without being rooted and from my App ?
Thanks to gurus