HierarchyViewer源代码理解(二)

codacy-viewer 编码查看器 为了运行此项目,请克隆并执行mvn包&& java -jar target / commit-viewer-0.0.1-SNAPSHOT.jar 转到localhost:8080 /就是这样。 立即下载

注:文章是建立在http://blog.youkuaiyun.com/liguangzhenghi/article/details/8363911的基础上理解和扩充,所以首先先表示感谢

本文主要来讲一下loadViewServerInfoAndWindows这个函数

    private void loadViewServerInfoAndWindows(final IDevice device) {

        ViewServerInfo viewServerInfo = DeviceBridge.loadViewServerInfo(device);

        if (viewServerInfo == null) {

            return;

        }

        Window[] windows = DeviceBridge.loadWindows(device);

        DeviceSelectionModel.getModel().addDevice(device, windows, viewServerInfo);

        if (viewServerInfo.protocolVersion >= 3) {

            WindowUpdater.startListenForWindowChanges(HierarchyViewerDirector.this, device);

            focusChanged(device);

        }

    }


其中ViewServerInfo viewServerInfo = DeviceBridge.loadViewServerInfo(device); 是获取ViewServer信息

StepInto一下这个函数,这个函数创建了一个DeviceConnection的类对象,这个类对象在创建时,会连接上设备,并将端口映射上去,代码如下:

 public DeviceConnection(IDevice device) throws IOException {

        mSocketChannel = SocketChannel.open();

        int port = DeviceBridge.getDeviceLocalPort(device);


        if (port == -1) {

            throw new IOException();

        }

        mSocketChannel.connect(new InetSocketAddress("127.0.0.1", port)); //$NON-NLS-1$

        mSocketChannel.socket().setSoTimeout(40000);

    }

连接上设备后,通过DeviceConnection.sendCommand(String command); 向viewServer发送命令

通过DeviceConnection.getInputStream();来获得返回的值


由于刚接触不就,竟然天真的以为发送的命令是直接发送给adb客户端,那些指令,诸如LIST,CAPTURE,竟然天真的以为adb中可以直接使用,然后兴冲冲的去学习了adb的使用方法,后来才发现自己大错特错了。所以接下来将会研究这些指令的具体实现原理



Viewer 立即下载

相关推荐

Win10系统VS2019+Cmake+qhull_8.0.0环境配置

1 qhull 1.1 简要介绍 qhull是一个强大的计算几何库,可以用于计算高维的convex hull, Delaunay triangulation, Voronoi diagram等。 1.2 依赖库 qhull不依赖其他库。 1.3 源码包下载 qhull源码地址:github:https://github.com/qhull/qhull.git 2 Cmake构建项目 2.1 路径 源代码路径:D:/ThirdParty/qhull/qhull_8.0.0构建项目路径:D:/Thi.

wangchenxue的博客 2492

Cesium源码解读之Viewer(全网最全)

这流程一两句话也说不情况,就不一个字一个字的敲了太费时间了,这里我拍个视频大家感兴趣可以看看,今天我们来扒一扒cesium 的源码, 探寻一下底层的奥秘,我们平时工作中用的最多的应该就是。这句了但我们却很少去了解他底层是否如何实现的。

奔跑的痕迹的博客 508

MOOS-ivp 实验三 MOOS简介(3)

MOOS-ivp 实验三 MOOS简介(3) 继上一篇文章继续对实验进行记录 提示:写完文章后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录MOOS-ivp 实验三 MOOS简介(3)六、A Simple Example with pXRelay1.pXRelay基本使用2.pXRelay简单例子3.pXRelay实验七、First Experiments in Modifying MOOS App Code1.下载一个MOOS模板文件2.打开MOOS模板文件总结 六、A Simple E

weixin_44151170的博客 2534

Viewer.js 开源项目教程

Viewer.js 开源项目教程 1. 项目的目录结构及介绍 Viewer.js 是一个用于在网页上查看图片的开源库。以下是其基本的目录结构: viewer.js/ ├── dist/ │ ├── viewer.css │ ├── viewer.js │ └── viewer.min.js ├── src/ │ ├── css/ │ │ └── viewer.css │ ...

gitblog_00686的博客 440

MySQL下载和安装教程

1.下载MySQL数据库可以访问官方网站:https://www.mysql.com/ 2.点击DOWNLOADS模块下的Community模块下的MySQL Community Server进行下载。 由于目前最新版本是:MySQL Community Server 5.7.21 建议博友下载历史版本,本博下载的是5.6.39 下载步骤: 进入,选择MySQL的版本及主机 根据自己的电脑选择相应的位数进行下载,本机是64位,点击download。 进入下.

残雪的剑的博客 4万+

ROS2学习笔记(二)-- 多机通讯原理简介及配置方法

简单介绍ROS2多机通信原理以及配置注意事项

aibingjin的博客 1万+

强大的图片预览组件Viewer.js

​Viewer.js 是一款强大的图片查看器。我们通过Viewer.js 在页面上添加强大的图片查看功能,同时,这款优秀的插件配置操作起来也非常的方便。Viewer.js分为2个版本,js版本和jquery版本,下载地址分别为纯JS版本:https://github.com/fengyuanchen/viewerjsjQuery 版本:GitHub - fengyuanchen/jquery-viewer: A jQuery plugin wrapper for Viewer.js.、网上看到有说jquer

西洲 2万+

LangChain Message 官方文档

消息是聊天模型中的基本通信单位。它们用于表示聊天模型的输入和输出,以及与对话相关的其他上下文或元数据。每条消息都包含一个角色(如“用户”、“助手”)和内容(如文本或多模态数据),并可能包含根据不同聊天模型提供商而有所不同的附加元数据。LangChain 提供了一个统一的消息格式,可以跨不同聊天模型使用,简化用户在不同模型之间切换时所需关注的消息格式差异。

AI Agent 首席体验官 896

HierarchyViewer源代码理解(三)

上一篇文章中提到对HierarchyViewer中,命令发送与接收的机制并不是很清楚,这篇文章就主要对这个进行研究   首先,通过adb命令行,连接到ViewServer(真机的话需要root权限才能够连接) 步骤如下 1.adb -e forward tcp:4939 tcp:4939 讲Android设备的4939端口映射到pc的4939端口上 2.adb -e shell ser

Programmer_CJC的博客 1308

如何使用 ABAP 代码调度一个 ABAP 程序,让其以后台作业的方式运行

笔者之前的教程,介绍了如何使用 SM36 一系列事务码,将一个 ABAP 程序,调度成以后台作业方式运行的详细步骤。 38. 如何让 ABAP 报表在后台作业的模式下运行 大家如果照着上述文章的步骤走一遍,会发现这些手动执行的步骤还是有些繁琐的。 有没有可能让这一切都自动化起来,即通过 ABAP 代码去完成呢?当然可以。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1944

筹码峰五句口诀,看懂主力的秘密动作!(附实战图示)

筹码图的价值在于,它不像K线那样容易造假。主力可以骗线,但骗不了筹码分布。主力在不在;是吸筹还是出货;接下来是变盘还是震荡。这五句口诀可以说是“筹码阅读的入门圣经”:单峰坚挺变盘在即,双峰对垒高抛低吸;上峰不移主力在跑,多峰林立行情不止;下峰不移不离不弃,筹码识庄稳中取利!📌市场从来不是靠猜,而是靠看清。筹码,就是主力最真实的痕迹。如果你想学会提前布局、跟庄不被甩,学会看筹码峰——这一步必须打牢!

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1165

Android HierarchyViewer

Android HierarchyViewer

Jun_P的博客 1390

C#上位机实战:工业产线数据采集与监控系统开发(附源码思路)

模块化设计:四层架构清晰,各模块独立可替换,便于后期维护与扩展;稳定性强:支持断线重连、异常重试、并发采集,满足工业7×24小时运行需求;实用性高:覆盖产线监控核心功能,可视化组件适配工业场景,操作简单;源码可复用:通信类、采集服务、报警管理器等可直接复制到其他上位机项目。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 1654

HierarchyViewer源代码理解(一)

注:文章是建立在http://blog.youkuaiyun.com/liguangzhenghi/article/details/8363911的基础上理解和扩充,所以首先先表示感谢 1.程序的入口为HierarchyViewerApplication.java中的createContents 当程序在pc上创建时,这个函数就开始启动了 a.关于代码中的mDirector,是一个Hie

Programmer_CJC的博客 782

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

使用HierarchyViewer工具

进入正题,我们这一篇文章会提到为什么使用HierarchyViewer,怎么使用HierarchyViewer,后者内容会多一下。 为什么使用HierarchyViewer     不合理的布局会使我们的应用程序UI性能变慢,HierarchyViewer能够可视化的角度直观地获得UI布局设计结构和各种属性的信息,帮助我们优化布局设计。HierarchyViewer是我们优化程

yingfengzhaozhan的专栏 2106

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

HierarchyViewer使用

我们这一篇文章会提到为什么使用HierarchyViewer,怎么使用HierarchyViewer,后者内容会多一下。为什么使用HierarchyViewer&nbsp; &nbsp; 不合理的布局会使我们的应用程序UI性能变慢,HierarchyViewer能够可视化的角度直观地获得UI布局设计结构和各种属性的信息,帮助我们优化布局设计。HierarchyViewer是我们优化程序的工具之一...

赛博朋克 1953

Android工具HierarchyViewer 代码导读(2) -- 建立Eclipse调试环境

在上文<Android工具HierarchyViewer 代码导读(1) -- 功能实现演示>中,我们介绍了HierarchyViewer主要技术点的实现。虽然我们还没有涉及到HierarchyViewer的源代码,但是利用上节所讲到的知识,读者甚至已经可以实现一个自己的HierarchyViewer了。 本文的内容比较轻松,我们将介绍如何把Android源代码中的Hierar...

weixin_30834783的博客 118

Android工具HierarchyViewer 代码导读

Android工具HierarchyViewer 代码导读(1) HierarchyViewer是Android SDK包中一个非常好用的工具,你在 android-sdks/tools目录下可以找到它。通过HierarchyViewer,即使没有应用的源代码,我们也可以非常直观地浏览Activity中控件的层次结构图,以及每个控件的属性和截图,这对于测试人员编写自动化测试用例是极有帮助的。

大脸猫的博客 2656

Android UI 优化——使用HierarchyViewer工具

Android UI 优化——使用HierarchyViewer工具

ytfghytf的博客 391

HierarchyViewer布局优化工具

进入正题,我们这一篇文章会提到为什么使用HierarchyViewer,怎么使用HierarchyViewer,后者内容会多一下。 为什么使用HierarchyViewer     不合理的布局会使我们的应用程序UI性能变慢,HierarchyViewer能够可视化的角度直观地获得UI布局设计结构和各种属性的信息,帮助我们优化布局设计。HierarchyViewer是我们优化程序的

我的专栏 666

Android自动化测试初探(二): Hierarchyviewer 捕获Element的实现原理

                Android SDK tools下的工具hierarchyviewer可以展现Device上的Element的层次分布和自身属性,其核心函数之一就是LoadScene,研究后发现其实现方法是向Device的4939端口通过socket的方式发送了一个DUMP的命令,Device会自动处理该命令并将所有Screen上的Element层次结构和属性一并发回,实现代码如

Roger Ge 的专栏 2万+

Android工具HierarchyViewer

HierarchyViewer是Android SDK包中一个非常好用的工具,你在 android-sdks/tools目录下可以找到它。通过HierarchyViewer,即使没有应用的源代码,我们也可以非常直观地浏览Activity中控件的层次结构图,以及每个控件的属性和截图,这对于测试人员编写自动化测试用例是极有帮助的。这个系列的文章,我们将通过阅读和解析HierarchyViewer的代码

哲的专栏 881
上一篇: mac下ADB的配置和常用命令
下一篇: HierarchyViewer源代码理解(三)
Programmer_CJC
博客等级 码龄11年 37粉丝 39原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值