B4A Library Accessibility Services (assisting users with disabilities, automation etc)

moster67

Expert
Licensed User
Longtime User
i need to send text + image is possible?
Do you mean for WhatsApp? As I already mentioned, the WhatsApp demo was just a way to show how you can use AccessibilityServices - it is not limited to WhatsApp.

But yes, you can do that. I have written some custom-versions for other users which include that functionality but I cannot release it since they paid for it and that would not be correct by me. Sorry.

But basically, you need to find the intent required and then look up the button(s) that should be triggered by the service.
 

fifiddu70

Well-Known Member
Licensed User
Longtime User
ok ...thanks moster67,
I do some tests to understand how to be able to send an image on whatsapp using your demo code.
 

moster67

Expert
Licensed User
Longtime User
But yes, you can do that. I have written some custom-versions for other users which include that functionality but I cannot release it since they paid for it and that would not be correct by me. Sorry.

Here is an example of sending images with a modified version of the sample app I posted in the first post of this thread....

 

molder26

Member
Licensed User
Longtime User
Funciona perfectamente.
pero trate de utilizarla para enviar mensajes multiples. ahi lastimosamente no funciona ya que envia el mensaje al primer usuario y nada mas..
Hola Americo
Tienes algun codigo de ejemplo funcionando para probarlo?
Desde ya muchas gracias
Saludos
 

zhousongke

Member
Licensed User
Longtime User


Hi, moster67.


Hi, moster67.

I am learning your AccessibilityEventsListenerWrapper Java source code. Referring to the 'performGlobalAction' method, I added the 'dispatchGesture' method. The 'dispatchGesture' method returned true, but the expected Gesture did not occur. Why? How to solve it?

Here This is the added code snippets:

public boolean dispatchGestureClick() {
GestureDescription.Builder gestureBuilder = new GestureDescription.Builder();
Path path= new Path();
path.moveTo(300, 300);
gestureBuilder.addStroke(new GestureDescription.StrokeDescription(path, 0, 50));
return owner.dispatchGesture(gestureBuilder.build(), null, null);
}


Attached is the Java source code.
 

Attachments

  • B4AAccessibilityServices-JavaSourceCode.zip
    6.1 KB · Views: 353

mkf

New Member

Hi, I use this sample to send consecutively in WhatsApp
Sometimes it gives the following error:

B4X:
Error occurred on line: 35 (accservice)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List android.view.accessibility.AccessibilityNodeInfo.findAccessibilityNodeInfosByViewId(java.lang.String)' on a null object reference
    at com.tillekesoft.accessibilityservices.AccessibilityEventsListenerWrapper$AccessibilityEventsListener.PerformNodeActionOnViewWithArgs(SourceFile:272)
    at sndr.w.ir.accservice._acs_onaccessibilityevent(accservice.java:209)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at com.tillekesoft.accessibilityservices.AccessibilityEventsListenerWrapper.onAccessibilityEvent(SourceFile:161)
    at android.accessibilityservice.AccessibilityService$2.onAccessibilityEvent(AccessibilityService.java:1524)
    at android.accessibilityservice.AccessibilityService$IAccessibilityServiceClientWrapper.executeMessage(AccessibilityService.java:1710)
    at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6543)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)



Error line:
B4X:
success = acs.PerformNodeActionOnViewWithArgs(True,"com.whatsapp:id/send",AccServConstants.ACTION_CLICK, Null)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…