I would like my B4A app to be able to kill another app running on the same device.
I came across this java code that would allow my app to interface with the ADB shell on the same device as my app (as if a different computer was sending an ADB command to the device):
So it seems my app would be able to send the device an ADB command, such as "adb shell am force-stop <PACKAGE>" to kill another app running on the same device.
Being able to kill the app this way seems to be a better way than these other methods because these other methods may not work on newer versions of android:
So, what is involved to use these java files in a B4A project?
I came across this java code that would allow my app to interface with the ADB shell on the same device as my app (as if a different computer was sending an ADB command to the device):
GitHub - cgutman/AdbLib: A Java library implementation of the ADB network protocol
A Java library implementation of the ADB network protocol - cgutman/AdbLib
github.com
So it seems my app would be able to send the device an ADB command, such as "adb shell am force-stop <PACKAGE>" to kill another app running on the same device.
Being able to kill the app this way seems to be a better way than these other methods because these other methods may not work on newer versions of android:
B4X:
android.os.Process.killProcess(pid)
activityManager.forceStopPackage(packageName)
So, what is involved to use these java files in a B4A project?
Last edited: