`

android-screenshot-library - Library for taking screenshots on Android platform.

阅读更多

http://code.google.com/p/android-screenshot-library/

 

 

What is this?

Android Screenshot Library (ASL) provides means for taking snapshots of phone's screen without the need for signing your application or having privileged (root) access to the Android system. It is intended primarly for taking screenshots used for testing, debugging and diagnostics.

How does it work?

ASL utilizes background native service which performs screen capturing on demand from an application that uses the library. This service has to be started using Android Debug Bridge (ADB), which is an utility program bundled with Android SDK. The service provides screenshot-taking functionality for any application that uses ASL for as long as the phone isn't rebooted, regardless of whether or not it is connected to the PC.

Contents of package

Android Screenshot Library consists of the following files:

  • Java-related files used by client applications:
    • ScreenshotService.java , which contains Android service class communicating with the native service
    • IScreenshotProvider.aidl , which contains definition of interface used by client application
  • asl-native - Native service binary which has to be installed on the phone & ran by ADB
  • Scripts for various shells that install and start the native service:
    • run.sh - /bin/bash script for Unix-like operating systems
    • run.ps1 - PowerShell script recommended for Windows systems
    • run.bat - Batch script for Windows systems
  • demo folder, containing a sample Android application which uses the Android Screenshot Library

Using the API

Refer to DeveloperGuide for details about embedding ASL in your own application and using the programming interface it exposes.

Starting the native service

Refer to UserGuide for details about using the screenshot capturing features of ASL in applications.

分享到:
评论
6 楼 selftension 2013-08-18  
七蚊二 写道
好吧 .这么迟回复你.我已经参照DDMLIB.jar的源码 用c#写了里面部份功能.截图功能和基本Socket IO操作.当然很不规范了. 至于本文的那个ASL软件源码里面一些小Bug我也修复过来了.如果你有兴趣可以跟我联系.827286446@qq.com


兄弟,你修复了asl里面具体的什么bug?现在手机截屏出来都是只有一半或者1/10,还有些手机截屏出来是混乱的,你遇到这个问题了吗
5 楼 七蚊二 2011-11-27  
好吧 .这么迟回复你.我已经参照DDMLIB.jar的源码 用c#写了里面部份功能.截图功能和基本Socket IO操作.当然很不规范了. 至于本文的那个ASL软件源码里面一些小Bug我也修复过来了.如果你有兴趣可以跟我联系.827286446@qq.com
4 楼 laiyangdeli 2011-11-10  
七蚊二 写道
这東西很多人用了都說get black image.我看是不是因为不同android版本和硬件的区别导致这样.起码我的G10用不了.我同学的LG就可以用. 至今还没有找到比较好的解决方案.用自带的ddmlib当然可以很容易截图.但是我要写一个无须JRE的程序. 自己得到的framebuffer用ffmpeg转换出来是一幅偏色的图. 郁闷死. 请问你有什么好的解决方案吗.第一无root.第二用PC显示


你看能否将ddmlib用C++/C#语言实现呢?
3 楼 七蚊二 2011-11-09  
这東西很多人用了都說get black image.我看是不是因为不同android版本和硬件的区别导致这样.起码我的G10用不了.我同学的LG就可以用. 至今还没有找到比较好的解决方案.用自带的ddmlib当然可以很容易截图.但是我要写一个无须JRE的程序. 自己得到的framebuffer用ffmpeg转换出来是一幅偏色的图. 郁闷死. 请问你有什么好的解决方案吗.第一无root.第二用PC显示
2 楼 laiyangdeli 2011-10-30  
shencaifeixia 写道
老大,拷贝的东西,你用过吗,我的怎能运行不了呢


不好意思,我还未来得及试。不过,在Android ICS,已经原生支持抓取screenshot了,所以,未来这个库其实用不到了。
1 楼 shencaifeixia 2011-10-29  
老大,拷贝的东西,你用过吗,我的怎能运行不了呢

相关推荐

Global site tag (gtag.js) - Google Analytics