获取应用程序的Andr​​oid中使用辅助服务的名称

编程入门 行业动态 更新时间:2024-10-22 09:37:56
本文介绍了获取应用程序的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中使用辅助服务的名称

本文发布于:2023-11-09 05:47:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571541.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   名称   Andr   oid

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!