Saturday, March 4, 2017

Screenshot and Screen Recording in android

                               please like & Subscribe our youtube channel


         https://www.youtube.com/playlist?list=PLQzJncZC8PUwCTcniu_akzp0N0oDx7l1n







In the early days of Android taking a screenshot on a phone or tablet was a painful activity, but now the ability to take a screenshot is built into the OS. In this Blog, we show you how to take a screenshot on an Android smartphone or tablet, including the Samsung Galaxy S7, HTC 10, Sony Xperia XZ, LG G5, Google Pixel and other Android phones and tablets.

There are lots of new features in android. The main important features Screenshot,  in android kit-kat. Screenshot available in all versions of android but screen recording feature is available on kit-kat or higher level versions. 


To make the Android phone screen video capture easy. There are lots of android application have been build for android Screen capture and-and screen Recording or we can capture and recording using and command too.



Screenshot 

We can take the screenshot of many types in android like using the hard button or using android ADB command android programming and it is saved in screenshot directory in sd card. To take the screenshot using the hard button we will have to press and hold home power and volume button at same time.
Screenshot file in the android device located in /system/bin directory.


In below picture, we can see screencap and screenshot files in the device.




Screenshot using ADB command


Note: Here, we'll complete the task with the Windows version. As a Mac user, you can take the similar steps as well.

We can take the screenshot with ADB command.



Ex: adb shell screencap –p <path to storage>




We can pull this screenshot image

Ex: adb pull/sdcard/screen.png
We can also delete this screen shot using this command


Ex: adb shell rm /sdcard/screen.png



Screen Recording






There are lots of improvements done in KitKat and one of the features is screen recording. Screen recording is the shell command use to record device screen in video presentation form. We get screen record achieved in form of MPEG. Screen recording feature available in KitKat (API level 19) or higher version.

Screen Recording using command

Ex: adb shell screenrecord  <path of file>



We can stop screen recording by press ctrl+c otherwise recording will be stopped in 3 minutes automatically.
There are some limitations of screen recording.
1) in some screen recording may be not work in the high-resolution device so always use the low-resolution device for screen recording.
2) screen rotations do not support by screen recording.

3) audio does not support.

Set size of screen recording

We can set the size of the screen but default screen size is 1280*780.


Ex: screenrecord  size<width*height> /sdcard/screen.mp4



Set bit rate of screen recording

As well as we can set bit rate of screen recording. The bit rate of screen record is set in form of megabit per second and the default value is 4Mbps.
Bit rate=1/video quality
It means if we increase bit rate then video quality will be decreased.



Ex: screenrecord  --bit-rate<rate> /sdcard/screen.mp4



Set time limit of screen recording

As well we can also set the time limit of screen recording. The recording time is set in form of second and the default time is 180(3 seconds).


Ex: screen record  --time-limit<time> /sdcard/screen.mp4


Set rotation of screen recording

We can also set screen rotation of recording 

Ex: screenrecord --rotation <degree> /sdcard/record.mp4



Verbose

Verbose display log information on display .if you does not set any option in command utility it does not display any information

Ex: screen record –verbose /sdcard/screen.mp4






Other android commands

There are lots of other commands in android like monkey testing, SQL database commands, log cat commands and server commands.





UI/Application Exerciser Monkey command


This is also shell command use to testing purpose of any device and application or in another word we can say that use to debug app or device. This application test system event like click, volume, touch, gestures.
Ex: adb shell monkey  –v  -p <app package name> 500


Where v is verbosity and p represent package name.



Sqlite database command

With SQLite database command we can manage a database which creates by an application. There are lots of ADB commands like .dump which show the output of the table and .schema create a table.


Ex: adb shell squlite3 data/data/<package name>/database/<database name>



Other ADB Commands

Restart USB:
ADB USB restarts USB mode.
Ex: adb usb
List of device 
We can show all device which attached with USB.
Ex: adb devices
Restart host
We can start host with ADB commands.

Ex: adb tcpip 5555


Other shell Commands

All shell programs are located in the bin directory in the system directory and the help of this program we can run all commands.


Ex: adb shell ls /system/bin



You can see in the picture there are lots of programs.
1)dumpsys
2)dump state
3)dmesg
4)start

5)stop


No comments:

Post a Comment