Microsoft Word - ASM SDK 說明文件

Similar documents
1. 技術項目簡介 對於應用程式開發人員而言, 其開發程式的執行效能, 攸關使用者的使用意願 故開發時最好能夠兼顧所開發之軟體於執行時期, 對於系統的資源使用情況 本技術可以幫助程式開發人員瞭解所欲開發之應用軟體, 對於系統效能的影響, 進而進行效能改善 有別於市面上的應用程式, 本軟體開發套件可以

Microsoft Word zw

AL-M200 Series

目 錄 版 次 變 更 記 錄... 2 原 始 程 式 碼 類 型 之 使 用 手 冊... 3 一 安 裝 軟 體 套 件 事 前 準 備... 3 二 編 譯 流 程 說 明

Cadence SPB 15.2 VOICE Cadence SPB 15.2 PC Cadence 3 (1) CD1 1of 2 (2) CD2 2of 2 (3) CD3 Concept HDL 1of 1

Microsoft Word - 第1章 Android基本概念.docx

Microsoft Word - template.doc

Windows XP

附录J:Eclipse教程

Java 1 Java String Date

ebook140-9

epub83-1

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

Symantec™ Sygate Enterprise Protection 防护代理安装使用指南

CANVIO_AEROCAST_CS_EN.indd

TX-NR3030_BAS_Cs_ indd

1.ai

<4D F736F F D20BBF9D3DA416E64726F6964C6BDCCA8B5C4B5E7D7D3C5C4C2F4CFB5CDB32E646F63>

目次 

IC-900W Wireless Pan & Tilt Wireless Pan & Tilt Remote Control / Night Vision FCC ID:RUJ-LR802UWG

Microsoft Word - PS2_linux_guide_cn.doc

IP505SM_manual_cn.doc

内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1.

2 第 章 绪 论 Internet 2.0 使 得 消 费 型 电 子 产 品 用 户 可 以 通 过 多 种 不 同 的 数 据 网 络 访 问 互 联 网 内 容 用 户 可 以 使 用 便 携 式 消 费 型 电 子 设 备, 如 智 能 手 机 触 屏 平 板 电 脑 电 子 书, 甚 至

WinMDI 28

The golden pins of the PCI card can be oxidized after months or years

ICD ICD ICD ICD ICD

EK-STM32F

Microsoft PowerPoint - 第一讲 概论.ppt

5in1_eDVR_Manual_Chinese.cdr

目 录

F4

Measurement Studio Expands Your Test and Measurement Programming Power

untitled

f2.eps

GoFlex Home UG Book.book

Microsoft PowerPoint - AWOL - Acrobat Windows Outlook.ppt [Compatibility Mode]

mvc

2/14 Buffer I12, /* x=2, buffer = I 1 2 */ Buffer I243, /* x=34, buffer = I 2 43 */ x=56, buffer = I243 Buffer I243I265 code_int(int x, char *buffer)

Microsoft Word - Front cover_white.doc

Chapter 2

ebook 185-6

Basic System Administration

untitled

Oracle Oracle Solaris Studio IDE makefile C C++ Fortran makefile IDE Solaris Linux C/C++/Fortran Oracle IDE "P

K7VT2_QIG_v3

untitled

Windows 2000 Server for T100

<4D F736F F D C4EABCC6CBE3BBFAB4F3C8FCCDA8D6AA E646F63>

麻 省 理 工 學 院 是 在 西 元 2013 年 12 月 3 日 推 出 MIT App Inventor 2 網 站, 提 供 免 費 的 雲 端 服 務, 使 用 者 可 以 透 過 瀏 覽 器 來 開 發 Android 裝 置 應 用 程 式, 該 網 站 的 網 址 為 : http

APP 103 學 年 度 嶺 東 科 技 大 學 資 訊 網 路 系 專 題 研 究 報 告 嶺 東 中 華 民 國 一 四 年 五 月 1

Learning Java

1 SQL Server 2005 SQL Server Microsoft Windows Server 2003NTFS NTFS SQL Server 2000 Randy Dyess DBA SQL Server SQL Server DBA SQL Server SQL Se

ebook

ebook140-11

Microsoft PowerPoint - ch6 [相容模式]

Oxford iSolution下載及安裝指南

2 2 3 DLight CPU I/O DLight Oracle Solaris (DTrace) C/C++ Solaris DLight DTrace DLight DLight DLight C C++ Fortran CPU I/O DLight AM

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

untitled

HOL-CHG-1695

ebook71-6

RunPC2_.doc

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6

RUN_PC連載_12_.doc

LSI U320 SCSI卡用户手册.doc

新建 Microsoft Word 文档.doc

中 文 摘 要 智 慧 型 手 機 由 於 有 強 大 的 功 能, 以 及 優 渥 的 便 利 性, 還 能 與 網 路 保 持 隨 時 的 鏈 結 與 同 步 更 新, 因 此 深 受 廣 大 消 費 者 喜 愛, 當 然, 手 機 遊 戲 也 成 為 現 代 人 不 可 或 缺 的 娛 樂 之

K301Q-D VRT中英文说明书141009

Logitech Wireless Combo MK45 English

入學考試網上報名指南

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

ARM JTAG实时仿真器安装使用指南

範本檔

2 Java 语 言 程 序 设 计 教 程 简 单 性 Java 语 言 的 语 法 与 C 语 言 和 C++ 语 言 很 接 近, 使 得 大 多 数 程 序 员 很 容 易 学 习 和 使 用 Java 另 一 方 面,Java 丢 弃 了 C++ 中 很 少 使 用 的 很 难

大连软~1

Guide to Install SATA Hard Disks

Some experiences in working with Madagascar: installa7on & development Tengfei Wang, Peng Zou Tongji university

声 明 本 公 司 及 全 体 董 事 监 事 高 级 管 理 人 员 承 诺 不 存 在 任 何 虚 假 记 载 误 导 性 陈 述 或 重 大 遗 漏, 并 对 其 真 实 性 准 确 性 完 整 性 承 担 个 别 和 连 带 的 法 律 责 任 本 公 司 负 责 人 和 主 管 会 计 工

关 于 本 手 册 本 手 册 说 明 如 何 安 装 Print Client KM 以 及 使 用 方 法 Print Client KM 可 在 Microsoft Windows 2000/XP/Vista 上 使 用 本 手 册 的 目 标 用 户 是 已 掌 握 Windows 2000

untitled

PPBSalesDB.doc

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class

Abstract arm linux tool-chain root NET-Start! 2

言1.PDF

基于UML建模的管理管理信息系统项目案例导航——VB篇

ebook140-8

ebook8-30

ansoft_setup21.doc

Xear 3D USB CH-IN-2 SPKs 2 6 :

Microsoft Word - PKUCS计算机教育 doc

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

目 錄 第 一 章 weberp 簡 介... 6 第 一 節 概 述... 6 第 二 節 安 全 性... 7 第 三 節 功 能... 7 一 銷 售 及 訂 單... 7 二 稅... 8 三 應 收 帳 款... 8 四 存 貨... 8 五 購 買... 9 六 應 付 帳 款... 9

Microsoft Word - UserManualForEaton_SC.doc

CC213

V39用户手册0227.doc

Microsoft Word - SupplyIT manual 3_cn_david.doc

TPM BIOS Infineon TPM Smart TPM Infineon TPM Smart TPM TPM Smart TPM TPM Advanced Mode...8

What You Can Find with SciFinder Scholar SciFinder Scholar Area Information Available in SciFinder Scholar Document Title Information Author/inventor

Transcription:

System Monitor SDK (for Android) 開發者指南說明書 1. 技術項目簡介 經由簡化的應用程式介面 (Application Programming Interface), 可 提供給 Android 應用程式開發者開發基於 System monitor 的應用程式 2. 應用範圍說明 本技術可應用於具備 Android 系統 2.3.3 以上版本的 Android 嵌入式裝 置, 如 Android 手機,Android 機上盒等, 也可監控具備 Wi-Fi 功能之硬體的 Wi-Fi 使用情形

3. 安裝指南說明 3.1. 基本開發環境需求 採用 Windows XP/Vista/7, Mac OS X (intel) or Linux (i386) O.S 的 PC JavaSE JDK & JRE Version 5 or later, website: http://www.oracle.com/technetwork/java/javase/downloads/ Eclipse IDE Version 3.3(Europa) or later for JAVA Developer (including the Java Developer Tools (JDT), Web Developer Tooler (WDT) is included in the Eclipse installation package), website:http://www.eclipse.org Android SDK: download the appropriate package from following link, then read the guide to Install the Android SDK. website: http://developer.android.com/sdk/installing.html Android Development Tools plug-in for Eclipse, website: http://developer.android.com/ Android System Monitor SDK Library is in the SDK package.

3.2. 開發環境設定 本範例程式可在 Android 2.3 版 SDK AVD 模擬器或是 Android 1.6 版本以上之 手機上執行 3.2.1. 開發範例程式 Step 1. Open a android project with Eclipse or other Android IDE Step 2. Copy AndroidSystemMonitor.jar into folder libs Step 3. Select Project > Properties > Java Build Path Step 4. Click Add JARs button to select the AndroidSystemMonitor.jar file to the build path. Step 5. Click OK to finish Java Build path. Step 6. Add proper permission in manifest.xml, ex: android.permission.system_alert_window android.permission.write_external_storage Step 7. Register proper service into manifest.xml, ex: org.iii.systemmonitor.lib.cpuinfoservice org.iii.systemmonitor.lib.netcounterservice org.iii.systemmonitor.lib.memoryinfoservice org.iii.systemmonitor.lib.batterystatusservice org.iii.systemmonitor.lib.systemstatusmonitorservice Step 8. Register intent filter into manifest.xml: org.iii.systemmonitor.lib.systemstatusmonitorservice

3.2.2. 安裝範例程式 Step 1. To extract the III Android System Monitor SDK package of the folder to a convenient place on your computer. Step 2. To start Eclipse, run eclipse.exe found in the installation directory. Step 3. From the main menu bar, select File > Import... The Import wizard opens. Step 4. Select General > Existing Project into Workspace and click Next. Step 5. Choose either Select root directory or Select archive file and click the associated Browse to locate the directory or file containing the projects. Step 6. Under Projects select the project to import. Step 7. Click Finish to start the import. Step 8. Select Project > Properties > Java Build Path from the context menu on a created project or the File menu of the workbench. Step 9. Click Remove button to remove the selected folders from the class path. Step 10. Click Add JARs button to select the AndroidSystemMonitor.jar file to the build path. Step 11. Click OK to finish Java Build path. Your SDK example project development environment is now completed!

3.3. 執行範例程式 Step 1. Connect your Android device and it will show up in Eclipse. Step 2. Select Run As > Android Application, then Android System Monitor will run on your android device.

3.4. 範例程式操作說明 Step 1. 勾選任意複數欲監控的項目 (ex: CPU Loading, Memory, Wi-Fi, or Battery Status) 選項. Step 2. 勾選 Show on screen or write to log 選項 Step 3. 於輸入欄位輸入 Interval 秒數 Step 4. 按下 Start Monitoring 按鈕, 則即時的系統監控資訊會依照設定的時間間隔 (Interval) 顯示在螢幕或是寫入至手機, 儲存成 log 檔案 Step 4. 按下 Stop Monitoring 按鈕, 則停止系統監控 Step 5. 按下 View Log 按鈕, Step 6. 按下 View Graph 按鈕 Step 7. 使用連接線連接 PC 與手機, 開啟 Adroid SDK, 使用 ADB PULL 指令將儲存在手機的 Log 檔案複製到 PC 端 Step 8. 開啟 PC 端對應資料夾, 檢視 Log 檔是否存在 Step 9. 開啟 PC_Adroid_System_Monitor Step 10. 按下 Choose Log File 按鈕, 選擇對應的 Log 檔 Step 11. 按下 CPU Usage 按鈕 or Memory Usage 按鈕 or Network Usage Tx/Rx 按鈕 or Battery Level 按鈕 or Battery Temperature 按鈕, 則在 PC 端顯示監控資訊

4. 範例程式碼說明 本範例程式包含 IWannaUseSDKActivity.java 及 AndroidSystemMonitor.jar IWannaUseSDKActivity.java 程式碼撰寫重點如下 : 欄位宣告 : 一般性欄位宣告 Service 欄位宣告以及 ServiceConnection 欄位 宣告 mconnection: 此物件用來表示與 Service 之間建立的連線 dobindservice(): 此類方法建立 Activity.java 與 SystemStatusmotonitorSevice.class 之間的連線 getconnection(): 此類方法用來取得與 Service 之間建立的連線 dounbindservice(): 此類方法中斷 Activity.java 與 SystemStatusmotonitorSevice.class 之間的連線 StartService(): 此類方法用來開啟相對應的 Service StopService(): 此類方法用來關閉相對應的 Service tooglemonitorservice(boolean): 此類方法用來傳送相關監控設定至 SystemStatusmotonitorSevice.class showserviceview(int, boolean): 此類方法用以接收監控中的 Service 資訊

5.SDK 與 Function List API 說明 5.1. SystemStatusMonitorService Class Overview The class is to manage the system monitoring, which can get the setting about what is intend to monitor, and start or stop the monitoring. Public Method List void oncreate() Use to get shared preference setting and do init() int onstartcommand(intent intent, int flags, int startid) Start monitoring with information from intent void ondestroy() Unregister receiver and stop monitoring IBinder onbind(intent intent) Return incoming messenger with getbinder() 5.2. CpuInfoService Class Overview The class is to get and parse the system information of CPU and send it to System Status Monitor Service. Public Method List void oncreate() Use to get shared preference setting and do init() int onstartcommand(intent intent, int flags, int startid) Start monitoring with information from intent void ondestroy() Unregister receiver to status monitor receiver void parsetopinfo () To parse the information and send it within intent by broadcast

5.3. MemoryInfoService Class Overview The class is to get and parse the system information of Memory and send it to System Status Monitor Service. Public Method List void oncreate() Use to get shared preference setting and do init() int onstartcommand(intent intent, int flags, int startid) Start monitoring with information from intent void ondestroy() Unregister receiver to status monitor receiver void parsememinfo () To parse the information and send it within intent by broadcast 5.4. NetCounterService Class Overview The class is to get and parse the system information of Wi-Fi Net Counter and send it to System Status Monitor Service. Public Method List void oncreate() Use to get shared preference setting and do init() int onstartcommand(intent intent, int flags, int startid) Start monitoring with information from intent void ondestroy() Unregister receiver to status monitor receiver void parserxresult () To parse the information and send it within intent by broadcast void parsetxresult () To parse the information and send it within intent by broadcast

5.4. BatteryStatusService Class Overview The class is to get and parse the system information of Battery Status and send it to System Status Monitor Service. Public Method List void oncreate() Use to get shared preference setting and do init() int onstartcommand(intent intent, int flags, int startid) Start monitoring with information from intent void ondestroy() Unregister receiver to status monitor receiver 6. 參考文獻 Android SDK & Developer Guide http://developer.android.com/guide/basics/what-is-android.html