目标:想在PC的浏览器上观看我的Android手机屏幕
设计:Android应用程序捕获屏幕(如int []数组),Server将屏幕数据处理到浏览器
问题:如何将int数组更改为流并在浏览器上播放(我可以在Android中捕获屏幕,并将其传递给SpringBoot服务器并在浏览器上使用String作为String打印SpringMVC)请提供一些建议。我可以在Android和JavaEE服务器上编码。如果对我来说很难,简单吧,每个UrL请求都会返回一张AndroidScreen的图片。
更多信息:
//on AndroidApp
public synchronized static int[] getScreenMatrix() {
try {
graphics = new FileInputStream(fbFile);
DataInputStream dStream = new DataInputStream(graphics);
dStream.readFully(piex);
dStream.close();
int[] colors = new int[screenHeight * screenWidth];
// all is 32bit = 8bit * 4,high 8bit is alpha, then 8bit is red,then green,low 8bit is blue
for (int m = 0; m < colors.length; m++) {
int r = (piex[m * 4] & 0xFF);
int g = (piex[m * 4 + 1] & 0xFF);
int b = (piex[m * 4 + 2] & 0xFF);
int a = (piex[m * 4 + 3] & 0xFF);
colors[m] = (a << 24) + (r << 16) + (g << 8) + b;
}
return colors;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}