Android在其他设备上共享显示
我正在与多个通过WiFi连接的表(均为根目录)共享平板电脑显示屏,我使用以下方法(均在一个线程内): 我拍了一张屏幕截图Android在其他设备上共享显示,android,screen,screenshot,Android,Screen,Screenshot,我正在与多个通过WiFi连接的表(均为根目录)共享平板电脑显示屏,我使用以下方法(均在一个线程内): 我拍了一张屏幕截图 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.
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-压缩屏幕快照图像
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-打开插座并将压缩图像发送到其他平板电脑
这是可行的,但我的问题是另一台平板电脑的观看延迟刷新新显示器需要4-5秒,有没有更好的方法让它实时显示 不幸的是,此功能将花费很长时间。它与流程生命周期、IPC和慢速文件系统相关联。您需要查看或重新使用源代码中的本机(c语言)函数,这不是一项简单的任务。我猜您的要求有点高,您仅限于Wi-Fi,从SD读取图像,压缩并发送图像。另一方面,我也在做很多的工作,我想,即使你选择了这个,它也不会给你多出一个sec@Rigotti好啊有没有其他方法可以满足我的需求?