如何覆盖在Android的桌面应用的信息? [英] How to overlay information on Android's launcher app?

查看:399
本文介绍了如何覆盖在Android的桌面应用的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在这里暗示,只要出现一个人presses或长期presses上的应用程序图标来创建针对Android的辅助功能。要做到,这一点,我有几个问题:

I want to create an accessibility feature for Android where a hint appears whenever a person presses or long-presses on an app icon. To do, this I have a few questions:


  1. 当用户点击应用程序的图标如何识别
    主屏幕或应用程序启动器?

  2. 如何利用这一事件来再
    拉适当的信息和present它给用户?

我是否需要开发自定义的桌面应用能够识别用户presses等?或者,我可以采用某种检索任何发射器用户使用该信息,并给予提示?

Do I need to develop a custom launcher app to be able to identify user presses etc.? Or can I somehow retrieve this information from whatever launcher a user uses and give the hint?

推荐答案

有几个不同的方式,你正在寻找的信息后得到的。

There are a couple of different ways to get after the information you are looking for.

第一种方案是创建一个自定义启动,如你所说。这有明显的缺陷。最明显的是,不必重新创建一个完整的发射应用显然是困难的,而且可能比修正,以创造更多的问题。你可以搜索出一个开源的启动应用程序,并尝试将功能添加到这一点,但是你会然后就依赖于这个codeBase类的传播者接受你的特色。

The first option is to create a custom launcher, as you suggested. This has obvious drawbacks. Most obviously, having to re-create an entire launcher applications is obviously difficult, and likely to create more issues than fixes. You could search out an open source launcher application, and attempt to add your feature to this, however you'd then be reliant on the purveyors of this codebase to accept your feature.

第二,我建议你,访问此信息的方式是通过可访问服务。此信息可像话语提示服务。这是它们如何运作至关重要。您将在这里面临的困难与众多可发射出有正常的互动。然而,大多数这些发射器都基于类似的起点,这是Android基开源发射的。因此,发射器,你关心与之交互的部分应该是codeD非常相似大部分发射的例子。

The second, and the way I'd recommend, to access this information is through accessibility services. This information is available to services like TalkBack. It is essential to how they function. The difficulties you'll face here are interacting properly with the numerous launchers available out there. However, most of these launchers are based off of a similar starting point, which is the Android base open source launcher. As such, the portions of the launcher that you care to interact with should be coded very similarly in most launcher examples.

这样做的缺点的方法是,只有一个无障碍服务可以同时有效的设备上。因此,用户谁是部分盲,谁可能希望使用功能和话语提示的同时,将不能够。当然你确定哪些设置困难/福利你preFER来处理,但这些是你的选择。

The downside to this approach is that only one accessibility service can be active on a device at a time. So, users who are partially blind, who may want to use your feature and TalkBack at the same time, won't be able to. It is of course to you to determine which set of difficulties/benefits you'd prefer to deal with, but these are your options.

这篇关于如何覆盖在Android的桌面应用的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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