在另一个设备Android份额显示器 [英] Android share display on another devices

查看:178
本文介绍了在另一个设备Android份额显示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作份额的平板显示与多个表(根源于)通过WiFi连接,我使用下面的方法(所有内部一个线程):

i'm working on share the tablet display with more than one table (all rooted) connected through WiFi , i'm using the following approach (all inside one thread) :

1 - 我采取了屏幕截图。

1- i take a screen shot.

Process sh = Runtime.getRuntime().exec("su", null,null);    
OutputStream  os = sh.getOutputStream();
os.write(("/system/bin/screencap -P " + "/sdcard/test/img.png").getBytes("ASCII"));
os.flush();          
os.close();
sh.waitFor();

2 - COM preSS屏幕拍摄的图像。

2- compress the screen shot image.

Bitmap mBitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory().getPath() + "/test/img.png");
OutputStream outputStream = null;
File file = new File(Environment.getExternalStorageDirectory().getPath() + "/test/img2.png");
outputStream = new FileOutputStream(file);
mBitmap.compress(Bitmap.CompressFormat.JPEG, 15, outputStream);
outputStream.flush();
outputStream.close();

3开插座,COM pressed图像发送到另一台平板电脑。

3- open socket and send the compressed image to another tablet.

这是工作,但我的问题是在其他平板观看延迟花了4-5秒刷新新的显示,有没有更好的方法把它实时显示?

this is working but my problem is the viewing delay in the other tablet it took 4-5 sec to refresh the new display , is there any better approach to have it real time display?

推荐答案

Unfotrtunately,此功能将需要很长时间。它与流程生命周期,IPC和缓慢的文件系统链接。你需要看看这个库或<一个HREF =htt​​ps://github.com/CyanogenMod/android_frameworks_bas​​e/search?q=screenshot&ref​​=cmdform相对=nofollow>来源$ C ​​$ /系统/斌/截图UTIL的温度。你有重用天然(C语言)的功能从源,并且它不是一个简单的任务。

Unfotrtunately, this function will take long time. It is linked with process lifecycle, IPC and the slow file system. You need to have a look at this library or the source code of /system/bin/screenshot util. You have to reuse native(c-language) functions from sources, and it is not a trivial task.

这篇关于在另一个设备Android份额显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆