Skip to Content
Android Developer Tools深入精要
book

Android Developer Tools深入精要

by Mike Wolfson
July 2014
Intermediate to advanced
248 pages
5h 19m
Chinese
GoTop Information, Inc.
Content preview from Android Developer Tools深入精要
116
|
第八章:模擬事件
[Page-121]
8-6
檢視
SMS
的模擬
更改網路參數
你可能會想要更改裝置上的網路參數;當你想從電腦轉發請求到模擬器或實體裝置上
(假設你想測試
Android
系統的區域網路設定),這會很實用。
利用
ADB
可以很容易地做到;語法如此範例:
adb forward tcp:9222 tcp:9333
而下次你從本地端電腦
ping
此位置時,
localhost:9333
你的指令會被直接轉發到
Android
裝置。
使用實體裝置模擬感測器
|
117
[Page-122]
使用實體裝置模擬感測器
要在模擬器上模擬某些動作是不容易的,例如模擬多點觸控、與基於動作的感測器互
動,如陀螺儀。要解決這一難題,
ADT
提供一個功能可將實體裝置連線到模擬器上,
並使用該裝置上的感測器與模擬器互動。在模擬器上執行的
app
可以監測實體裝置上
的感測器,感測器事件會傳送至模擬器上,並且注入至系統中。
為了使用這個功能,你需要在模擬器上執行
Android 4.0
第二版或更高的系統。
開啟感測器模擬功能的步驟為:
1.
修改你將會使用的
AV D
;新增一個「
Multi-touch screen support
(支援多點觸控
螢幕)」硬體屬性,並設為
true
。第
3
章介紹如何完成。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Android 高效能多執行緒

Android 高效能多執行緒

Anders Goransson
深入淺出 jQuery

深入淺出 jQuery

Ryan Benedetti, Ronan Cranley
HTML5 錦囊妙計

HTML5 錦囊妙計

Christopher Schmitt, Kyle Simpson

Publisher Resources

ISBN: 9789863470861