获取应用程序的Andr​​oid中使用辅助服务的名称 [英] Get the Name of the App using Accessibility Service in Android

查看:337
本文介绍了获取应用程序的Andr​​oid中使用辅助服务的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在无障碍服务工作。我需要得到使用辅助服务的应用程序名称。我研究的辅助服务在Android的网站的开发者文档。但目前还没有得到关于使用辅助应用程序名称提及。

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.

推荐答案

您无法获得应用程序的应用程序名。至少不可靠。该应用程序读取的字符串的东西之类的标题标题栏或应用程序图标下方的字符串。它从来没有真正直接要求它连接到应用程序的标题的框架。

You can't get the "app name" of the application. At least not reliably. The strings that the app reads out are things like the title of the Title Bar, or the string underneath the apps icon. It never actually directly asks the framework for the title of the app it is attached to.

您这样做,不过,可以访问应用程序包。

You do, however, have access to the application package.

someAccessibilityNodeInfo.getPackageName();

这唯一标识一个给定的AccessibilityNodeInfo被发送应用程序。

This uniquely identifies the application that a given AccessibilityNodeInfo was sent from.

您还可以考虑使用这样的:

You could also consider using this:

someAccessibilityService.getRootInActiveWindow();

和抓取下来寻找一个标题栏视图层次结构。

And crawl down the view hierarchy looking for a title bar.

这篇关于获取应用程序的Andr​​oid中使用辅助服务的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆