• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to run app in background with other apps

I am an Android beginner (but experienced Java programmer) and I would like to know if it is possible on Android to write an app that can do something similar to what a "normal" windowed program in the following respects:

1) Place an application access button with very simple features "always on top", that allows the user to open the application, or paste data from other running applications that has been copied to the clipboard into my app and other simple functions. The button could be a simple circle that is always on top, and certain gestures on the button invoke certain commands in my app.

2) When other apps are running (e.g a browser or a PDF viewer), allow the user to "drag and drop" information (e.g. copied text, URLs from a browser, text copied from a PDF being viewed) into my app which is sleeping (since the other app is currently running). I'm guessing that if my app is "always on top", focusing on its "access button" will make it active?

I know all this can be done in Java Swing, but with Android I anticipate problems. My app will be running in its own protected space (as will all the other apps), so when another app is running, like the browser, I am not clear on how my app can access data from other apps. Would this be a case of requesting permissions to access the data of all the standard apps I would like to access in my app (e.g. browser, PDF viewer, word, excel viewers etc)?

Many thanks for your help,

-Blue
 
For copied text the obvious way is to use the system "clipboard". That's what it's for, to copy text strings from one app and paste them into another. I'm sure you can make your app automatically access the clipboard when you switch focus to it(*), you'd anyway have to use the normal select and copy features to put things into the clipboard, so the thing that's missing is your preferred UI of "dragging" the selected text onto your button. That however I can't help with, since I don't actually develop for Android.

(*) Of course whether I'd want an app that automatically accesses anything that's in the clipboard whenever I open it, without any interaction from me, is a different question. There are potential privacy issues there, e.g. if someone uses the clipboard to copy a password or bank account number it probably won't occur to them that your app could grab those data if they haven't cleared the clipboard or replaced its contents before they next opened your app. But you would probably not be unique in doing this, as I believe I've read that clipboard security in Android is less than stellar.
 
Back
Top Bottom