首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

转:Android 学习札记 1

2012-09-25 
转:Android 学习笔记 1转载自:http://www.cnblogs.com/mengshu-lbq/archive/2010/08/05/1793263.html1 ant

转:Android 学习笔记 1

转载自:http://www.cnblogs.com/mengshu-lbq/archive/2010/08/05/1793263.html
1 ant

Apace Ant(Another Neat Tool)类似于make file之类的工具

?

2 adb

Android Debug Bridge

用于向模拟器或者设备传送文件或者文件夹

?

3 向模拟器打电话与发短信

1)连接模拟器:

打开命令行cmd,输入telnet 回车

然后输入 o localhost 5554 回车(注:第一个字符为open中的第一个字符非数字0)

//其中5554表示adb服务为该模拟器实例服务的端口号

2)打电话

gsm call 10086

挂断电话

gsm cancel 10086

发短信

sms send 10086 HellloWorld

(奇怪的是如果发送内容为空的,在模拟器上的显示是乱码)

?

其他的用户,可以在上面的页面中,输入:gsm

系统会提示相关的帮助信息与使用方法,如:

gsm
allows you to change GSM-related settings, or to make a new inbound phone cal

available sub-commands:
??? list???????????? list current phone calls
??? call???????????? create inbound phone call
??? busy???????????? close waiting outbound call as busy
??? hold???????????? change the state of an oubtound call to 'held'
??? accept?????????? change the state of an outbound call to 'active'
??? cancel?????????? disconnect an inbound or outbound phone call
??? data???????????? modify data connection state
??? voice??????????? modify voice connection state
??? status?????????? display GSM status

?

3) 除了发短信与打电话外,还可以模拟硬按键事件、电源以及网络等事件:

??? help|h|????????? print a list of commands
??? event??????????? simulate hardware events
??? geo????????????? Geo-location commands
??? gsm????????????? GSM related commands
??? kill???????????? kill the emulator instance
??? network????????? manage network settings
??? power??????????? power related commands
??? quit|exit??????? quit control session
??? redir??????????? manage port redirections
??? sms????????????? SMS related commands
??? avd????????????? manager virtual device state
??? window?????????? manage emulator window

try 'help <command>' for command-specific help

以上内容参考:http://j-butterfly.javaeye.com/blog/593145

?

当然也可以用DDMS(Dalvik Debug Monitor Service)的中可视化操作来达到发短信与打电话的功能:

转:Android 学习札记 1

4 apk文件(Android应用程序的发行包,相当于Windows中的exe文件

5 Traceview

是android平台配备性能分析的工具(Symbian也有一个类似的工具 好像叫PerfMon),脚本文件为 \<AndroidSDK>\tools\traceview.bat

?6 Dalvik

其实就是一个虚拟机,只不过Dalvik是基于寄存器,而JVM 基于栈;并且Dalvik经过优化,允许在有限的内存中同时运行多个虚拟机的实例,并且每一个Dalvik 应用作为一个独立的
Linux进程执行,独立的进程可以防止在虚拟机崩溃的时候所有程序都被关闭。

?

热点排行