Taking Screenshot on Android Smartphones Locally via Python (Without a second smartphone or PC connection via Wifi or USB)

emregun

New member
May 10, 2023
1
0
1
Visit site
Hi All,
I want to take screenshots of my Android smartphone screen(not only screenshot of my app but whole screen) locally in background (without a second smartphone or PC via Wifi or USB ) in my application via Python, but unfortunately I could not find a proper way to do it. I tried following methods but none of them is the right way in my case:

Android Screen Buffer: I guess this is used for screenshot, but I could not achieve to install it. I get following error:
The conflict is caused by: ash 0.3, 0.2 and 0.1 depends on opencv-python==4.1.2.30
but this version does not support any arm base platform. So I cannot install it. Moreover it has also dependencies with ADB tool,
so it looks like wifi or serial connection required.

ADB(Android Debug Bridge Tool): It requires either USB Cable or Wifi connection. The problem is that I do not want that my app users
requires necessary the same Wifi connection(I know internet connection not required but they need to be somewhere around a modem) to be able to use my app.

LADB: This requires also USB Cable or Wifi connection

scrcpy: It has also ADB dependencies. I get no devices/emulators found if I do not start any server from a PC.

Note: I want to implement it necessarily via Python with the reason that the implementation is already done for Windows and MacOS via Cross Platform Python. But if it is impossible with Python is there any other way? if it is so, then which language and library would you recommend? I found some examples via Java but all of them were screen capturing the window within the application not whole smartphone screen.

Thanks a lot in advance.

Environment: Android 11
Prog Language: Python 3.7
Smartphone:Samsung Galaxy A8
 

Trending Posts

Forum statistics

Threads
943,186
Messages
6,917,692
Members
3,158,867
Latest member
Non