转:Android 学习笔记 1

本文介绍Android开发中常用的工具和技术,包括Ant构建工具、ADB命令行工具的使用方法,如何通过命令行向Android模拟器发送电话和短信,以及模拟其他硬件事件。此外还涉及了Dalvik虚拟机的特点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载自: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)的中可视化操作来达到发短信与打电话的功能:

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

5 Traceview

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

 6 Dalvik

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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值