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

Similar documents
Microsoft Word - ASM SDK 說明文件

Microsoft Word zw

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

AL-M200 Series

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

CANVIO_AEROCAST_CS_EN.indd

Java 1 Java String Date

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

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

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

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

Microsoft Word - template.doc

Microsoft PowerPoint - 第一讲 概论.ppt

Windows XP

epub83-1

附录J:Eclipse教程

<4D F736F F D20BBF9D3DA416E64726F6964C6BDCCA8B5C4B5E7D7D3C5C4C2F4CFB5CDB32E646F63>

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

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

TX-NR3030_BAS_Cs_ indd

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

ebook140-9

<4D F736F F D C4EABCC6CBE3BBFAB4F3C8FCCDA8D6AA E646F63>

目次 

5in1_eDVR_Manual_Chinese.cdr

ICD ICD ICD ICD ICD

WinMDI 28

Microsoft Word - PS2_linux_guide_cn.doc

CC213

1.ai

ebook

大连软~1

Measurement Studio Expands Your Test and Measurement Programming Power

mvc

Basic System Administration

untitled

HOL-CHG-1695

Guide to Install SATA Hard Disks

untitled

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

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

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

GoFlex Home UG Book.book

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

申 请 者 的 承 诺 : 我 承 诺 对 本 人 填 写 的 各 项 内 容 的 真 实 性 负 责, 保 证 没 有 知 识 产 权 争 议 如 获 准 立 项, 本 表 为 有 约 束 力 的 协 议, 遵 守 广 东 省 教 育 科 学 规 划 领 导 小 组 办 公 室 的 有 关 规 定

IP505SM_manual_cn.doc

F4

ebook 185-6

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

ebook140-11

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

BlackBerry Classic Smartphone-用户指南

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

概述

Internet Explorer Internet Explorer Internet Explorer Internet Explorer

K7VT2_QIG_v3

Android Service

f2.eps

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

学 院 人 才 培 养 分 项 自 评 报 告 结 果 汇 总 表 主 要 评 估 指 标 关 键 评 估 要 素 自 评 等 级 1.1 学 校 事 业 发 展 规 划 合 格 1. 领 导 作 用 1.2 办 学 目 标 与 定 位 合 格 1.3 对 人 才 培 养 重 视 程 度 合 格 1

C35_RG_E.book

EK-STM32F

INTRODUCTION TO COM.DOC

untitled

目 录

LSI U320 SCSI卡用户手册.doc

Windows 2000 Server for T100

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

Chapter 2

indd

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)

ebook140-8

財金資訊-80期.indd

穨IC-1000

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

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

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

ebook70-13

Microsoft Word - Learn Objective-C.doc

信息

<A4E2BEF7B4FAB8D5B3F8A F52322E786C7378>

藍牙網路在資訊家電的應用

(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

Oxford iSolution下載及安裝指南

RunPC2_.doc

Spyder Anaconda Spyder Python Spyder Python Spyder Spyder Spyder 開始 \ 所有程式 \ Anaconda3 (64-bit) \ Spyder Spyder IPython Python IPython Sp

Panaboard Overlayer help

Microsoft Word - Web Dynpro For ABAP跟踪测试工具简介 _2_.doc

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

Oracle 4

Serial ATA ( nvidia nforce4 Ultra/SLI)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 6 (4) S A T A... 9 (5) S A T A (6) Micro

untitled

Learning Java

中南大学第二届软件创新大赛

範本檔

Microsoft Word - PKUCS计算机教育 doc

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

untitled

Application description

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

Transcription:

System Monitor for Android SDK 開發者指南說明書

1. 技術項目簡介 對於應用程式開發人員而言, 其開發程式的執行效能, 攸關使用者的使用意願 故開發時最好能夠兼顧所開發之軟體於執行時期, 對於系統的資源使用情況 本技術可以幫助程式開發人員瞭解所欲開發之應用軟體, 對於系統效能的影響, 進而進行效能改善 有別於市面上的應用程式, 本軟體開發套件可以深入到開發者自行定義的功能, 針對特定功能區段, 進行中央處理器, 記憶體使用量, 網路使用流量, 或是電池耗電量等系統效能監測, 以了解所開發之程式, 需針對哪個部分進行效能上的優化, 增加開發軟體之價值 2. 應用範圍說明 要提昇智慧裝置的軟 硬體之效能品質或是使用者體驗, 最重要的一點便是要先將數值量化, 本技術模組可協助研發人員進行 API 層級的資源剖析, 應用情境包含 : 分析 IM 軟體不同功能的耗電情形 影片播放時 CPU 負載狀態以及裝置待機時背景系統資源應用情形等

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 [option] 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. 開發環境設定 本範例程式可在 PC 端執行, 或者在 Android 2.3 版 SDK AVD 模擬器或是 Android 1.6 版本以上之手機上執行 3.2.1. 開發範例程式 ( 以 PC 端程式為例 ) Step 1. Open a java project with Eclipse or other Android IDE Step 2. Import the project "SystemStatusMonitorController" Step 3. Copy AndroidSystemMonitor.jar into folder lib Step 4. Select Project > Properties > Java Build Path Step 5. Click Add JARs button to select the AndroidSystemMonitor.jar file to the build path. Step 6. Click OK to finish Java Build path. 3.3. 執行範例程式 Step 1. Open Run\Run as\run Configuration Step 2. Press one or many CPU Loading Memory Wifi or Battery Status button Step 3. Choose "Show on Screen" or "Write to Log" Step 4. Click Apply, and then click Run Step 5. Edit Interval seconds and Press "Start Monitoring" to start the monitor

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