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.
Is it possible to get the content which we would get if we were to click the share button.
Or
Is it possible to trigger the share button and choose our app without disturbing the user in anyway
You could try that if it's only for 1 specific app. See question How to click button in settings using AccessibilityService? which clicks a button. This will not scale if you want to do this for more apps. You could however parse the text that is on the screen and look for http links and process them in a background service and then show a floating button like Link Bubble Browser
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.
Related
Does anyone know if it's possible to track when the "Copy" link button is tapped in the Android system share sheet?
Using an IntentSender and extracting the chosen component from the result bundle works great if the user chooses an app to share to, but that method doesn't work if the user taps "Copy" or "Nearby" since those options aren't external components.
I'm building a somewhat basic app (only testing on Android for now) with multiple lists, one of which is an Inbox list. I can share text from other apps to my app, and it works well.
However, I would like the app to handle the intent without launching the full app UI. For example, if I share a URL from the browser to my app, I would like it to be handled in the background, save the URL to Firestore, and show a toast to the user indicating that it was successful.
Ideally, I would like to put two entries in the share menu, one to add to the Inbox and show a toast as described above, and a second entry that gives the user a modal dialog that floats above the sharing-from app, which allows the user to choose a different list to save to.
I think I'll have to make a (for example) ShareActivity.java, and add it to AndroidManifest.xml, but I have no idea where to go after that, or even if that's the right approach.
I have ShareActionProvider in my Application. it shares a photo I uploaded with a text I insert. When share is done, I want to show a popup message/dialog with a button OK, clicking on which I should return to my application. The question is: in my application how can I know if share is complete or no ? For example, if I share the photo and text in instagram, how can I know that post is already done.
in my application how can I know if share is complete or no ? For example, if I share the photo and text in instagram, how can I know that post is already done.
That is not possible for ACTION_SEND. What the user does with the shared content in the other app is between the user and the developers of the other app. The user might do something immediately, later, or never. The app might do something immediately or later (e.g., upload the content as part of a periodic sync operation with a server). There is no protocol for the receiving app to tell you that sharing is "done".
Specific apps may offer specific APIs, beyond ACTION_SEND, that offer capabilities in this area, but those will be unique to those apps.
Use a Toast like this: Toast.make(context "Uploaded", Toast.LENGTH_SHORT).show();
Toast is just tiny little "popup"
I want to know if that is a way in the moment i take a picture, send it in background to other app, like a vault, keepsafe or appprotector?
Without the user has to go to gallery and click in share with others apps above . I would like that was automatic, without use "app chooser".
You would need to ask the authors of your proposed "vault, keepsafe or approtector" if they support some custom API for this. There are no conventions in Android for sending content to another app in the background. In the foreground, you are welcome to use ACTION_SEND, or ShareActionProvider, etc.
I develop the app which is provide some information to general user. it is not only showing info but also curating and recommending further detail info depending on users history;what the users clicked, searched and acted on the app. (like a google targeting AD).
For this, I have to accumulate user's activites on apps. (which button was clicked, when did they turn on the app and so on...)
For this, I have two ideas.
1. let the app to leave their log text file in local device then append lines in it whenever user act, and upload it when they turn off the app on server DB.[like a batch]
-OR-
2. let the app, update db everytime when user acts something on app by http-post.[like a realtime]
Which way is common tactics(or popular ways) on real field? or can you suggest another way?
thanks for reading.