1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to run app in background with other apps

Discussion in 'Android Development' started by bluejazzshark, Feb 27, 2021.

  1. bluejazzshark

    bluejazzshark Lurker
    Thread Starter

    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
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Hadron

    Hadron Smoke me a kipper...
    VIP Member

    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.
     
    bluejazzshark likes this.
Loading...
Similar Threads - run app background
  1. App Update
    Replies:
    0
    Views:
    253
  2. user_2014
    Replies:
    0
    Views:
    338
  3. BlessedAtBest
    Replies:
    3
    Views:
    974
  4. Selenay8927
    Replies:
    3
    Views:
    479
  5. Ronald Scholten
    Replies:
    0
    Views:
    2,160
  6. eishiba
    Replies:
    6
    Views:
    914
  7. anushasubin
    Replies:
    1
    Views:
    430
  8. Ranjeet Dahiwade
    Replies:
    1
    Views:
    687
  9. First version
    Replies:
    3
    Views:
    835
  10. Marc Henry Saad
    Replies:
    1
    Views:
    577

Share This Page

Loading...