How can i record the Android device screen? [close

2020-02-09 16:14发布

I want to create an application that will enable the users to Capture Screen of their Android device. like any screen recorder software we used in pc please help me out

Edit : 1

here Screen capture refers to Screen recording of device screen as video not snapshots of screen.

4条回答
地球回转人心会变
2楼-- · 2020-02-09 17:00

As per Android 5.0 (Lollipop), screen recording can be done without requiring root using the MediaProjection package. An example of a recording activity can be found here.

查看更多
Luminary・发光体
3楼-- · 2020-02-09 17:06

the only way to do that is with a rooted device.

try reading this answer: Programmatic screencapture on mobile device

EDIT 1:

screen capture as video is the same is screen capture of only one image.

EDIT 2:

there are different apps that record video from screen such as Screencast and ShootMe. you can call them from within the app using the startActivity(new Intent(String action)); with their action names.

for more read this: Open third party app

查看更多
beautiful°
4楼-- · 2020-02-09 17:06

I havn't tried this but think it can be done. Kitkat provided new features and this is one of them You can use this command to record screen as a video

adb shell screenrecord /sdcard/demo.mp4

You can find more details here

you can execute the adb command from your app. Check the answer here

查看更多
Melony?
5楼-- · 2020-02-09 17:14

Summary from longer answer:

Normal Android apps lack permission to capture the frame buffer (specifically, they aren't members of the AID_GRAPHICS group) so you CANNOT capture the screen from an Android app without some way of getting around the privilege issue. Apps do this in one of two ways: either by root or by starting a server via the ADB interface. So, it can be done without root, but you need to start you own server and connect to it from your app (and, obviously, safely handle the security implications of this)

查看更多
登录 后发表回答