1

To take the screenshot do I have to use only MediaProjection or is there another way. Saving the screenshot to the SD card is not of concern. Only obtaining the screenshot of the current activity the user is on, by clicking on the floating bubble which runs as a background service.

Having trouble implementing the floating bubble into the MediaProjection. I am able to take a screenshot of the Floating Bubble App's activity alone by clicking on the floating bubble. My goal however, is to get a screenshot of the current activity ( Homescreen, or any other app) the user is on when the floating bubble is clicked.

Yohanelly
  • 69
  • 1
  • 9
  • If anyone is confused as to what im trying to do, I can send you an apk file of the app. But in this apk the floating bubble only takes a screenshot of the Floating Bubble App's activity and not of any other app or activity. Please help coding experts. – Yohanelly Sep 24 '17 at 18:52
  • Details like this should not be in comments! All details should be in the body of the question. Edit the question and be clear about what you want to do, what you have tried, and what results you got. No one wants and APK. Show some code you have written. –  Sep 24 '17 at 20:04
  • Maybe a duplicate: https://stackoverflow.com/q/2661536/1531971 –  Sep 24 '17 at 20:05
  • @jdv I have made the changes to my question. Also, that is not a duplicate. I have reviewed that and it is from over 7 years ago. Now it runs on MediaProjection which is not mentioned there. – Yohanelly Sep 24 '17 at 20:15
  • How did you solve it then, I'm facing the same problem, @Yohanelly – Tehleel Mir Apr 12 '21 at 06:22

1 Answers1

0

To take the screenshot do I have to use only MediaProjection

Yes.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks, can you give me a suggestion/link of an easy implementation of it? I have found a few resources but I am finding it tough to integrate my floating bubble into it. – Yohanelly Sep 24 '17 at 20:00
  • @Yohanelly: [This sample project](https://github.com/commonsguy/cw-omnibus/tree/v8.7/MediaProjection/andshooter) and others are covered in [this chapter](https://commonsware.com/Android/previews/the-media-projection-apis) of [this book](https://commonsware.com/Android). – CommonsWare Sep 24 '17 at 20:02
  • @Yohanelly, did you try a search for "mediaprojection screenshot"? –  Sep 24 '17 at 20:18
  • Yes I have. They are really complex but I will try and implement them into the floating bubble. If i'm having trouble could you help me out guys? It would be really helpful, since i am self taught so far, your expert guidance would really be appreciated. – Yohanelly Sep 24 '17 at 20:25