accessibilityservice

how to simulate key press in Android with AccessibilityService

最后都变了- 提交于 2019-12-13 07:15:20
问题 I am writing an accessibility service. I've been trying to do some auto search on an app. I uses the accessibilityservice action_paste to fill in the EditText. Then I need to simulate the key press on the soft keyboard. But I didn't find out how to. Can you guys help me out? 回答1: You could try Activity.dispatchKeyEvent(KeyEvent) There are also functions in Instrumentation But those are mostly for testing. 来源: https://stackoverflow.com/questions/36285587/how-to-simulate-key-press-in-android

How to detect all Views and text inside a system dialog?

微笑、不失礼 提交于 2019-12-13 02:36:32
问题 Let's say I have a similar scenario: I'm using an accessibility service in order to my TTS engine talk when this dialog appears, but the only thing I was able to detect were the selectable views (those pointed by the arrow). Is there any way to detect the title and (more importantly) whole text inside the dialog? 回答1: Yes. I think it is likely that you're grabbing these items off of accessibility events, which focus on a single node. What you want to do instead is look at the entire view

AccessibilityNodeInfo nodeInfo = event.getSource() always returns null

北战南征 提交于 2019-12-12 10:05:37
问题 I'm trying to use AccessibilityNodeInfo but when I use event.getSource() it always returns null, I try to read the editbox of the browsers here is my codes: public class MainActivity extends Activity { static final String TAG = "RecorderService"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent i = new Intent(this, RecorderService.class); startService(i); }} accessibilityServicecode which acts as a

Get the Name of the App using Accessibility Service in Android

余生长醉 提交于 2019-12-12 06:21:01
问题 I'm working in Accessibility Service . i need to get the app name using Accessibility Service. i have studied the documentation of the Accessibility Service in developer's of Android website. but there is no mention about getting the app name using Accessibility. Is this possible to get the name of the application? i think its possible because talk back getting name of the application. So if there is any way to get name of the application, Please give your suggestion. 回答1: You can't get the

Is it possible to enable/disable an accessibility service after the user has enabled it?

隐身守侯 提交于 2019-12-12 03:34:28
问题 Background Suppose you have an app that has an accessibility service, and the user has enabled it after you've used the correct intent : startActivity(new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS)); You can also check if the user has enabled it or not, using this code. The problem Sometimes, even if the user has enabled it, because it calls many times to onAccessibilityEvent, waking the app, it would be nice to be able to disable it temporarily. What I've tried I tried

Cannot access notification through Android AccessibilityService

非 Y 不嫁゛ 提交于 2019-12-12 03:34:11
问题 I am trying to access the notifications on my android phone using the AccessibilityService. I tried making a service and calling it from the main activity. I've also added meta for the service. It's not working. I cannot see the triggering of the service. I'm using Android L for testing. In accessibility settings I've added my app 'Notify' as on. Thanks in advance. My main Activity package com.example.tony.notify; import android.content.Intent; import android.provider.Settings; import android

Are UiAutomator and AccessibilityServices not compatible?

早过忘川 提交于 2019-12-11 12:38:55
问题 I have an AccessibilityService (AS) running to programatically get information about what's currently displayed on the screen. Now I want to set some UiAutomator test cases. However, if I have the AS running the UiAutomator gives the following error: INSTRUMENTATION_RESULT: shortMsg=java.lang.SecurityException INSTRUMENTATION_RESULT: longMsg=Permission Denial: getIntentSender() from pid=9700, uid=2000, (need uid=1000) is not allowed to send as package android I've searched the web and I've

Was AccessibilityService changed in Android Pie?

给你一囗甜甜゛ 提交于 2019-12-11 08:27:43
问题 I have this AccessibilityService class working in Android Oreo (API 27) and before: AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.test.testaccessibility"> <application android:icon="@mipmap/ic_launcher" android:label="TestAccessibility"> <service android:name=".TestAccessibility" android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"> <intent-filter> <action android:name="android.accessibilityservice

AccessibilityService not geting key event on softkey back,home button

痴心易碎 提交于 2019-12-11 05:49:02
问题 My AccessibilityService work fine for physical back ,home. but if user have device with soft navigation key (like nexus 4 ) it will not return key event here is my code : my goal is to block back and home button action, any idea how i can do it? Accessibility_Service.java public class Accessibility_Service extends AccessibilityService { private SharedPreferences prefs; private String TAG = "Accessibility_Service"; @Override public void onAccessibilityEvent(AccessibilityEvent event) { Log.d

How to add the custom button on google's(device) native application in android?

天大地大妈咪最大 提交于 2019-12-11 02:49:39
问题 I want to add one button on google(device)'s native application Like(Google Map),Using this button I want to open my application. I have do some work regarding that. Using AccessibilityService I find the which application still running using this service I open the stand alone dialog using SYSTEM_ALERT_WINDOW permission. But the dialog cover whole screen , I manage to display this dialog in screen bottom side, but still I can't do anything in device native application like (google map),