Giter VIP home page Giter VIP logo

shelldemo's Introduction

简介 
version 1.0
1.安装 jar文件夹下的remotecontrol.jar 和 remotecontrol.sh到android的 /data/local/ 目录下。
	app push .../jar/remotecontrol.jar /data/local/remotecontrol.jar
	app push .../jar/remotecontrol.sh  /data/local/remotecontrol.sh
2.执行remotecontrol.sh 
	/data/local/remotecontrol.sh

  可以附带端口号,比如指定6666端口:/data/local/remotecontrol.sh 6666
  如果不附带端口号,那就采用默认端口号 6000
3.apk是测试demo,模拟发送事件到jar,然后由jar包来生成对应的事件。


使用说明:
	采用Json来传递数据,请封装成指定的格式。
	可以参考如下的方式来封装Json Command。(见 ShellDemoActivity.java)
1.按键事件:
	public String sendKeyActionEvent(int keycode)

	keycode = android.view.KeyEvent.KEYCODE_HOME|android.view.KeyEvent.KEYCODE_BACK|...

2.滑动事件:
	public String sendMoveActionEvent(float x, float y, float x2, float y2)

	x ,y : 初始点的坐标
	x2,y2: 终点的坐标

3.点击事件:
	public String sendTouchActionEvent(float x, float y)

	x ,y : 初始点的坐标

4.长按事件:
	public String sendTouchPressActionEvent(float x, float y, int millsecond)

	x ,y : 初始点的坐标
	millsecond:长按时间(毫秒)

5.按键长按事件:
	public String sendKeyPressActionEvent(int keycode, int millsecond)

	keycode = android.view.KeyEvent.KEYCODE_HOME|android.view.KeyEvent.KEYCODE_BACK|...
	millsecond:长按时间(毫秒)

生成的Json Command (String 类型)请放到List里后,统一发送。


For example:
	String command1 = sendKeyActionEvent(KeyEvent.KEYCODE_HOME); //创建一个Home按键的事件
	String command2 = sendMoveActionEvent(100,100,200,200); //创建一个滑动事件,从坐标(100,100)划动到(200,200)

	List<String> commands = new ArrayList<String>(); //生成List
	commands.add(command1);
	commands.add(command2);
	sendEvent(commands); //发送


version 1.1
添加Controller.java工具类,用于生成command,和发送事件。





有任何疑问请直接与我联系。

Thanks.
GongChen

shelldemo's People

Contributors

gongchen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.