通过可及Android应用程序获取共享内容 [英] Get share content through accessibility in android app

查看:249
本文介绍了通过可及Android应用程序获取共享内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用程序,它可以让人们从其他应用程序将其共享内容。当它接收到的共享数据,它看起来在共享文本中的网址,并获取页面并不会在数据获取处理。这种设计有特定的目的,而不是一个通用的所有的应用程序。

它工作正常,但人们必须点击共享图标,然后选择我们的应用程序名称。可访问性,我们可以减少这种工作,为用户。我们都能够得到在应用程序中显示的文本。


  1. 是否有可能得到它如果我们点击分享按钮,我们将获得的内容。

  2. 是否有可能触发分享按钮并选择我们的应用程序,而不在反正打扰用户


解决方案

您可以简单地触发您的应用程序的份额活动时,你发现从其他应用程序的文本;但问题是,你怎么会知道,当用户完成输入文字?!

一种方法是你可以把类似Facebook的Messenger的全系统的浮动按钮,用户点击后,该文本可以共享。这将减少点击用户所要做的数量。

因此​​,

1)是的,其可能通过AccessibilityService获得文本内容。

2)不,你不能自动执行此操作。

I have an android app, which lets people share content from other apps to it. When it receives the shared data, it looks for the URL in the shared text and fetches the page and does processing on the data fetched. This is designed with specific purpose and not a generic for all apps.

It works fine, except that people have to click the share icon and then choose our app name. With accessibility we can reduce this work for the users. We are able to get the text displayed in the app.

  1. Is it possible to get the content which we would get if we were to click the share button. Or
  2. Is it possible to trigger the share button and choose our app without disturbing the user in anyway

解决方案

You can simply trigger the share activity of your app when you detect the text from the other app; but the question is how will you know when user is done typing the text?!

One way is you can place a system-wide floating button similar to Facebook Messenger and after user clicks it, the text can be shared. This will reduce number of clicks user has to do.

So,

1) Yes, its possible to get text content via AccessibilityService.

2) No, you cannot automate this action.

这篇关于通过可及Android应用程序获取共享内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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