教育部補助資訊軟體人才培育先導計畫 100 年度課程發展專案計畫 實驗課程名稱 : IPC(Inter-Process Communication) 開發教師 : 張晉源老師 開發學生 : 林政揚 學校系所 : 樹德科技大學資訊工程學系

Size: px
Start display at page:

Download "教育部補助資訊軟體人才培育先導計畫 100 年度課程發展專案計畫 實驗課程名稱 : IPC(Inter-Process Communication) 開發教師 : 張晉源老師 開發學生 : 林政揚 學校系所 : 樹德科技大學資訊工程學系"

Transcription

1 教育部補助資訊軟體人才培育先導計畫 100 年度課程發展專案計畫 實驗課程名稱 : IPC(Inter-Process Communication) 開發教師 : 張晉源老師 開發學生 : 林政揚 (s @stu.edu.tw) 學校系所 : 樹德科技大學資訊工程學系

2 實驗目的 本實驗的目的在於讓同學們可以了解 Android 系統核心內部的行程通訊的原理, 透過呼叫系統提供的其中一樣服務 (MediaPlayer), 來實作 IPC(Inter-Process Communication) 機制, 讓同學們可以對 IPC 的機制流程有更深刻的理解, 藉此可跟前幾章相做呼應 個人電腦 X 1 需求 : 個人電腦或筆記型電腦一部 目的 : 實作 IPC 機制程式 MP3 2 首 實驗器材 個人電腦 eclipse JDK SDK ADT 實驗所需軟體 實驗步驟簡述 創建專案 (1) 創建專案 MediaIPC 裡面包含兩支程式 MediaIPCActivity.java/ RemoteService.java (2) 創建專案 MediaClient 裡面包含 MediaClientActivity.java 實作 (1) 撰寫 RemoteService.java 內容 (2) main.xml 撰寫 (3) string.xml 撰寫 (4) AndroidManifest.xml 撰寫 (5) 撰寫 MediaIPCActivity.java 內容 (6) 撰寫 MediaClientActivity.java 內容 (7) 測試

3 Part I 基本知識 Binder 流程

4 Binder 架構 (MediaPlayer) 舉例 1 系統 Service 實例 Media server framework/base/media/mediaserver/main_mediaserver.cpp 檔案 : 19: int main(int argc, char** argv) 20: { 21: sp<processstate> proc(processstate::self()); 22: sp<iservicemanager> sm = defaultservicemanager(); 23: LOGI("ServiceManager: %p", sm.get()); 24: AudioFlinger::instantiate(); 25: MediaPlayerService::instantiate(); 26: CameraService::instantiate(); 27: AudioPolicyService::instantiate(); 28: ProcessState::self()->startThreadPool(); 29: IPCThreadState::self()->joinThreadPool(); 30: 1. 程式碼第 21 行建立一個 ProcessState 的參照, 但是這個物件後面並沒有被使用到, 那麼為什麼要建立呢? 教學的簡報上有提過, 如果一個行程要使用 Binder 機制, 那麼他的行程中必須要建立一個 ProcessState 物件來負責管理 Service 的代理對象 2. 第 22 行呼叫 defaultservicemanager() 取得一個 Service Manager 代理對象 3. 後面幾行都是實體化 Service 物件, 展開之後發現都是一些調用 Service Manager 的 addservice 進行註冊的函數, 以 AudioFlinger 為例,instantiate 如下 : 1: void AudioFlinger::instantiate() { 2: defaultservicemanager()->addservice( 3: String16("media.audio_flinger"), new AudioFlinger()); 4: 4. 最後呼叫 ProcessState 的 startthreadpool 方法和 IPCThreadState 的 jointhreadpool

5 使 Media Server 進入等待請求的循環當中 2 系統 Service 的基礎 BBinder 仔細查看一下 Media Server 中定義的四個 Service 將會發現它們都是繼承自 BBinder, 而 BBinder 又繼承自 IBinder 介面, 每個 Service 都覆寫了 BBinder 的 ontransact 函數, 當 Client 發送請求到達 Service 時, 將會呼叫 Service 的 ontransact 函數, 後面將會詳細的介紹這個機制 3 Service 註冊 每個 Service 都需要向 大管家 Service Manager 進行註冊, 呼叫 Service Manager 的 addservice 方法註冊 這樣 Service Manager 將會執行 Client 端查詢和獲取該 Service( 代理對象 ), 然後 Client 端就可以通過該 Service 的代理對象請求該 Service 的服務 4 Service 進入等待請求的循環 每個 Service 必須要進入死循環, 等待 Client 端請求的到達, 本例中最後兩句就是使 Service 進行等待請求的循環之中 ProcessState 的 startthreadpool 方法最終調用的也是 IPCThreadState 的 jointhreadpool 方法, 具體請查看程式碼 IPCThreadState 的 jointhreadpool 方法的程式碼如下 : 1: void IPCThreadState::joinThreadPool(bool ismain) 2: { 3:... 4: do { 5: int32_t cmd; 6: 7:... 8: 9: // now get the next command to be processed, waiting if necessary 10: result = talkwithdriver(); 11: if (result >= NO_ERROR) { 12:... 13: 14: result = executecommand(cmd); 15: 16: 17:... 18: while (result!= -ECONNREFUSED && result!= -EBADF); 19: 20:... 21: Service 在 IPCThreadState 的 jointhreadpool 方法中, 呼叫 talkwithdriver 方法和 Binder 驅動進行溝通, 讀取 Client 端的請求 當 Client 端請求到達之後呼叫 executecommand 方法進行處理

6 Service 怎樣處理客戶端的請求? 看一下 executecommand 方法的程式碼 : 1: status_t IPCThreadState::executeCommand(int32_t cmd) 2: { 3: BBinder* obj; 4: RefBase::weakref_type* refs; 5: status_t result = NO_ERROR; 6: 7: switch (cmd) { 8:... 9: case BR_TRANSACTION: 10: { 11:... 12: if (tr.target.ptr) { 13: sp<bbinder> b((bbinder*)tr.cookie); 14: const status_t error = b->transact(tr.code, buffer, &reply, 0); 15: if (error < NO_ERROR) reply.seterror(error); 16: 17: 18:... 19: 20: 21: 22:... 23: 24: 25: if (result!= NO_ERROR) { 26: mlasterror = result; 27: 28: 29: return result; 30: 可以看到 IPCThreadState 將會直接呼叫 BBinder 的 transact 方法來處理客戶端請求, 再看一下 BBinder 的 transact 方法 : 1: status_t BBinder::transact( 2: uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) 3: { 4: data.setdataposition(0); 5: 6: status_t err = NO_ERROR; 7: switch (code) { 8: case PING_TRANSACTION:

7 9: reply->writeint32(pingbinder()); 10: 11: default: 12: err = ontransact(code, data, reply, flags); 13: 14: 15: 16: if (reply!= NULL) { 17: reply->setdataposition(0); 18: 19: 20: return err; 21: 發現它將會叫用自己的方法 ontransact 前面提到所有的 Service 都繼承自 BBinder, 並且都覆寫了 ontransact 虛函數 那麼 IPCThreadState 將會呼叫 Service 定義 ontransact 方法來處理客戶請求 Part II 放置音樂檔案及創建專案 Step 1 SDcard 放入所需檔案 放入兩個 mp3 檔案, 名稱分別為 music.mp3 music.mp3

8 Step 2 新增 MediaIPC 專案 File > New > Android Project( 新增一個 Android 專案 ) Project name : 為您的 Android 專案命名 Build Target : 選擇您剛剛所選的 Android 版本 (2.2) 設定方式 : Application Name: 請自行設定欲使用的名稱, 建議與本實習取相同名稱 MediaIPC Project Name: 預設會與 Application Name 相同 Package Name: 請不要使用預設的名稱, 建意將前述取名為各自學校的名稱 ( 可參考本範例 ) SDK 版本 : 請挑選 Android2.2 版 之後一直下一步, 直到 Finish, 無須再進行任何設定

9 Step 3 新增 RomteService 於左側欄中的 src -> stu.edu.mediaipc 按右鍵 new -> Class 並設定 class 名稱為 RomteService, 之後按下 Finish 即可 Step 4 新增 MediaClient 專案 依照前面的步驟再新增另一個專案, 叫 MediaClient 設定方式 : Application Name: 請自行設定欲使用的名稱, 建議與本實習取相同名稱 MediaClient Project Name: 預設會與 Application Name 相同 Package Name: 請不要使用預設的名稱, 建意將前述取名為各自學校的名稱 ( 可參考本範例 ) SDK 版本 : 請挑選 Android2.2 版 之後一直下一步, 直到 Finish, 無須再進行任何設定

10 Step 5 刪除兩者專案中不必要的 Menu 資料夾 此步驟請將 MediaIPC 及 MediaClient 專案中位於 res 內的 Menu 資料夾刪除, 因為此資 料夾內的檔案會與後續我們要增加的檔案有所衝突 Part III MediaIPC Project 撰寫 Step 1 string.xml 撰寫 string.xml 在創建專案時就一並會被創建出來, 在 res ->values 資料夾底下, 在這邊新增一些字串 <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">hello World, MediaIPCActivity!</string> <string name="app_name">mediaipc</string> <string name="remote_service_started">remoteservice started!!</string> <string name="remote_service_label">remoteservice label</string> <string name="remote_service_stopped">remoteservice stopped!!</string> </resources>

11 Step 2 activity_main.xml 撰寫 activity_main.xml 在創建專案時就一並會被創建出來, 在 res ->layout 資料夾底下, 在 這邊新增三個按鈕, 做播放 暫停及停止動作 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <Button android:id="@+id/start" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="start" /> <Button android:id="@+id/pause" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="pause" /> <Button android:id="@+id/stop" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="stop" /> </LinearLayout> Step 3 RomteService.java MediaIPCActivity.java 檔先不動, 因為需要呼叫 RomteService.java 檔, 若先寫 MediaIPCActivity.java 則在撰寫的過程中會出現大量錯誤, 所以我們撰寫的順序稍微改變一下 宣告全域變數 (Global variables) 並將 RomteService 繼承 Service, 且實作 onbind package stu.edu.mediaipc; import java.io.ioexception; import android.app.notification; import android.app.notificationmanager; import android.app.pendingintent;

12 import android.app.service; import android.content.intent; import android.media.mediaplayer; import android.os.handler; import android.os.ibinder; import android.os.message; import android.os.messenger; import android.os.remoteexception; import android.util.log; import android.widget.toast; public class RomteService extends Service { private String path1 = "/sdcard/music1.mp3"; private String path2 = "/sdcard/music2.mp3"; private static final int SOUNG1 = 1; private static final int SOUNG2 = 2; private static final int PAUSE = 3; private static final int STOP = 4; /** For showing and hiding our notification. */ NotificationManager mnm; Messenger mclients ;// 紀錄 client 的 Messnger int mvalue = 0; MediaPlayer mp; /* * 下面是如何使用 Messenger 的概要 : * 1. Service 實作一個接收從 Client 端的每次請求時產生回應的 Handler * 2. Handler 被用來建立一個 Messenger 物件 ( 它是 Handler 的一個參照 ) * 3. Messenger 建立一個從 service 的 onbind() 返回給 Client 端的 IBinder * 4. 客戶端使用 IBinder 來實體化這個 Messenger( 它參照到 service 的 Handler) *,Client 端用它來向 service 發送 Message * 5. service 在它的 Handler 中接收每個消息 具體是在 handlemessage() 方法中 */ Messenger mmessenger = null;// 讓 client 可以對 service 溝通的 Messenger /** * When binding to the service, we return an interface to our messenger * for sending messages to the service. public IBinder onbind(intent intent) {

13 Log.i("RemoteService", "onbind()"); return mmessenger.getbinder(); 撰寫一個方法 shownotification() 這方法是當 service 被創建時會做提醒的動作, 提醒 client 已經連線成功 /** * Show a notification while this service is running. */ private void shownotification() { CharSequence text = gettext(r.string.remote_service_started); // Set the icon, scrolling text and timestamp Notification notification = new Notification(R.drawable.ic_launcher, text, System.currentTimeMillis()); PendingIntent contentintent = PendingIntent.getActivity(this, 0, new Intent(this, MediaIPCActivity.class), 0); // Set the info for the views that show in the notification panel. notification.setlatesteventinfo(this, gettext(r.string.remote_service_label), text, contentintent); // Send the notification. // We use a string id because it is a unique number. We use it later to cancel. mnm.notify(r.string.remote_service_started, notification); 建立一個內隱類別 (inner class ), 繼承 Handler 覆寫 handlemessage () 方法, 將從 Client 端傳來的 Message 做處理 class IncomingHandler extends Handler public void handlemessage(message msg) { Message message = null; mclients = msg.replyto; try { switch (msg.what) { case SOUNG1: message = Message.obtain(null, SOUNG1); mp.reset(); mp.setdatasource(path1); mp.prepare(); mclients.send(message); mp.start();

14 case SOUNG2: message = Message.obtain(null, SOUNG2); mp.reset(); mp.setdatasource(path2); mp.prepare(); mp.start(); mclients.send(message); case STOP: message = Message.obtain(null, STOP); mp.stop(); mclients.send(message); case PAUSE: message = Message.obtain(null, PAUSE); mp.pause(); mclients.send(message); catch (IllegalArgumentException e) { e.printstacktrace(); catch (IllegalStateException e) { e.printstacktrace(); catch (IOException e) { e.printstacktrace(); catch (RemoteException e) { e.printstacktrace(); Service 生命週期 : oncreate() -> onstart() -> ondestroy(), 由於本範例沒用到 onstart() 因此沒有做覆寫動作, 這邊做的是將提醒框以及 Media Player 做關閉動作 覆寫 public void oncreate() { Log.i("RemoteService", "oncreate()"); mnm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); mp = new MediaPlayer();

15 shownotification(); // Display a notification 覆寫 public void ondestroy() { Log.i("RemoteService", "ondestroy()"); // Cancel the persistent notification. mnm.cancel(r.string.remote_service_started); mp.reset(); mp.release(); // Tell the user we stopped. Toast.makeText(this, R.string.remote_service_stopped, Toast.LENGTH_SHORT).show(); 附註 : RomteService.java 檔完成之 source code 如下所示 : package stu.edu.mediaipc; import java.io.ioexception; import android.app.notification; import android.app.notificationmanager; import android.app.pendingintent; import android.app.service; import android.content.intent; import android.media.mediaplayer; import android.os.handler; import android.os.ibinder; import android.os.message; import android.os.messenger; import android.os.remoteexception; import android.util.log; import android.widget.toast; public class RomteService extends Service { private String path1 = "/sdcard/music1.mp3"; private String path2 = "/sdcard/music2.mp3"; private static final int SOUNG1 = 1; private static final int SOUNG2 = 2;

16 private static final int PAUSE = 3; private static final int STOP = 4; /** For showing and hiding our notification. */ NotificationManager mnm; Messenger mclients ;// 紀錄 client 的 Messnger int mvalue = 0; MediaPlayer mp; Messenger mmessenger = null;// 讓 client 可以對 service 溝通的 Messenger /** * When binding to the service, we return an interface to our messenger * for sending messages to the service. public IBinder onbind(intent intent) { Log.i("RemoteService", "onbind()"); return mmessenger.getbinder(); /** * Show a notification while this service is running. */ private void shownotification() { CharSequence text = gettext(r.string.remote_service_started); // Set the icon, scrolling text and timestamp Notification notification = new Notification(R.drawable.ic_launcher, text, System.currentTimeMillis()); PendingIntent contentintent = PendingIntent.getActivity(this, 0, new Intent(this, MediaIPCActivity.class), 0); // Set the info for the views that show in the notification panel. notification.setlatesteventinfo(this, gettext(r.string.remote_service_label), text, contentintent); // Send the notification. // We use a string id because it is a unique number. We use it later to cancel. mnm.notify(r.string.remote_service_started, notification);

17 @Override public void oncreate() { if (mmessenger == null) { mmessenger = new Messenger(new IncomingHandler()); Log.i("RemoteService", "oncreate()"); mnm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); mp = new MediaPlayer(); shownotification(); // Display a public void ondestroy() { Log.i("RemoteService", "ondestroy()"); // Cancel the persistent notification. mnm.cancel(r.string.remote_service_started); mp.reset(); mp.release(); // Tell the user we stopped. Toast.makeText(this, R.string.remote_service_stopped, Toast.LENGTH_SHORT).show(); class IncomingHandler extends Handler public void handlemessage(message msg) { Message message = null; mclients = msg.replyto; try { switch (msg.what) { case SOUNG1: message = Message.obtain(null, SOUNG1); mp.reset(); mp.setdatasource(path1); mp.prepare(); mclients.send(message); mp.start();

18 case SOUNG2: message = Message.obtain(null, SOUNG2); mp.reset(); mp.setdatasource(path2); mp.prepare(); mp.start(); mclients.send(message); case STOP: message = Message.obtain(null, STOP); mp.stop(); mclients.send(message); case PAUSE: message = Message.obtain(null, PAUSE); mp.pause(); mclients.send(message); catch (IllegalArgumentException e) { e.printstacktrace(); catch (IllegalStateException e) { e.printstacktrace(); catch (IOException e) { e.printstacktrace(); catch (RemoteException e) { e.printstacktrace(); Step 4 AndroidManifest.xml 撰寫這邊是在做權限設定以及 service 的相關設定, 如果沒做這些設定程式將會無法執行 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="stu.edu.mediaipc"

19 android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" /> <application > <activity android:name=".mediaipcactivity" > <intent-filter > <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <!-- 以下為新增片段 --> <service android:enabled="true" android:name=".romteservice" android:process=":remote" > <intent-filter > <action android:name="stu.edu.mediaipc.romteservicetransact" /> </intent-filter> </service> <!-- 以上為新增片段 --> </application> </manifest> Slep5 MediaIPCActivity.java 撰寫 宣告全域變數 (Global variables) package stu.edu.mediaipc; import android.app.activity; import android.content.componentname; import android.content.context; import android.content.intent;

20 import android.content.serviceconnection; import android.os.bundle; import android.os.handler; import android.os.ibinder; import android.os.message; import android.os.messenger; import android.os.remoteexception; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; public class MediaIPCActivity extends Activity { private Button start, pause, stop; private Messenger locms = new Messenger(new handler()); private Messenger romms; private static final int SOUNG1 = 1; private static final int PAUSE = 3; private static final int STOP = 4; private static final String tag = "MediaIPCActivity"; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); /* 以下為新增程式片段 */ start = (Button) findviewbyid(r.id.start); pause = (Button) findviewbyid(r.id.pause); stop = (Button) findviewbyid(r.id.stop); start.setonclicklistener(this); pause.setonclicklistener(this); stop.setonclicklistener(this); bindservice(new Intent(this,RomteService.class), serverconnection, Context.BIND_AUTO_CREATE); /* 以上為新增程式片段 */ 新增 ServiceConnection 變數 這類別是用來與 Service 做連線用的, 當連線成功後, 會呼叫 onserviceconnected, 這時候再用 剛剛上面定義好的 Messager roms 去參照從 service 回傳過來的 Ibinder

21 private ServiceConnection serverconnection = new ServiceConnection() { public void onserviceconnected(componentname name, IBinder service) { // TODO Auto-generated method stub Log.i("ServiceConnection", "onserviceconnected"); romms = new Messenger(service); public void onservicedisconnected(componentname name) { // TODO Auto-generated method stub romms = null; ; 新增內隱 Class handler 這類別是內隱類別 (inner class), 繼承 Handler 覆寫 handlemessage() 方法, 將從 Service 端傳來的 Message 做處理 class handler extends Handler public void handlemessage(message msg) { switch (msg.what) { case SOUNG1: settitle("play song1"); case PAUSE: settitle("meida Pause"); case STOP: settitle("media Stop"); 實做 OnClickListener 為方便處理按鈕事件, 因此覆寫監聽事件 public void onclick(view v) { Message message = null; try { if (v == start) message = Message.obtain(null, SOUNG1);

22 else if (v == pause) message = Message.obtain(null, PAUSE); else if (v == stop) message = Message.obtain(null, STOP); message.replyto = locms; if (message!= null) romms.send(message); catch (RemoteException e) { e.printstacktrace(); 附註 : MediaIPCActivity java 檔完成之 source code 如下所示 : package stu.edu.mediaipc; import android.app.activity; import android.content.componentname; import android.content.context; import android.content.intent; import android.content.serviceconnection; import android.os.bundle; import android.os.handler; import android.os.ibinder; import android.os.message; import android.os.messenger; import android.os.remoteexception; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; public class MediaIPCActivity extends Activity implements OnClickListener { private Button start, pause, stop; private Messenger locms = new Messenger(new handler()); private Messenger romms; private static final int SOUNG1 = 1; private static final int PAUSE = 3; private static final int STOP = 4; private static final String tag = "MediaIPCActivity";

23 class handler extends Handler public void handlemessage(message msg) { switch (msg.what) { case SOUNG1: settitle("play song1"); case PAUSE: settitle("meida Pause"); case STOP: settitle("media Stop"); protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); start = (Button) findviewbyid(r.id.start); pause = (Button) findviewbyid(r.id.pause); stop = (Button) findviewbyid(r.id.stop); start.setonclicklistener(this); pause.setonclicklistener(this); stop.setonclicklistener(this); bindservice(new Intent(this,RomteService.class), serverconnection, Context.BIND_AUTO_CREATE); Log.i("MediaIPCActivity", "oncreate()"); private ServiceConnection serverconnection = new ServiceConnection() { public void onserviceconnected(componentname name, IBinder service) { // TODO Auto-generated method stub Log.i("ServiceConnection", "onserviceconnected"); romms = new Messenger(service);

24 ; public void onservicedisconnected(componentname name) { // TODO Auto-generated method stub romms = null; public void onclick(view v) { Message message = null; try { if (v == start) message = Message.obtain(null, SOUNG1); else if (v == pause) message = Message.obtain(null, PAUSE); else if (v == stop) message = Message.obtain(null, STOP); message.replyto = locms; if (message!= null) romms.send(message); catch (RemoteException e) { e.printstacktrace();

25 Part IV MediaClient Project 撰寫 Step 1 將 MediaIPC 中的 main.xml 覆蓋 MediaClient 中的 main.xml 將 MediaIPC 的 res -> layout -> main.xml 複製到 MediaClient 的 res -> layout 因內容相同, 所以直接複製過來使用即可 Step 2 撰寫 MediaClientActivity.java 內容 與 MediaIPCActivity.java 大同小異, 下列需要更改之處將會用紅框標示 package stu.edu.mediaclient; import android.app.activity; import android.content.componentname; import android.content.context; import android.content.intent; import android.content.serviceconnection; import android.os.bundle; import android.os.handler; import android.os.ibinder;

26 import android.os.message; import android.os.messenger; import android.os.remoteexception; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; public class MediaClientActivity extends Activity implements OnClickListener { private Button start, pause, stop; private Messenger locms = new Messenger(new Handler()); private Messenger romms; private static final int SONG2 = 2; private static final int PAUSE = 3; private static final int STOP = 4; private static final String tag = "MediaIPCActivity"; private ServiceConnection serviceconnection = new ServiceConnection() { public void onservicedisconnected(componentname name) { Log.i(tag, "onservicedisconnected"); romms = null; ; public void onserviceconnected(componentname name, IBinder service) { Log.i(tag, "onserviceconnected"); romms = new Messenger(service); class handler extends Handler public void handlemessage(message msg) { switch (msg.what) { case SONG2: settitle("play song2"); case PAUSE: settitle("meida Pause"); case STOP: settitle("media Stop");

27 /** Called when the activity is first created. public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); start = (Button) findviewbyid(r.id.start); pause = (Button) findviewbyid(r.id.pause); stop = (Button) findviewbyid(r.id.stop); start.setonclicklistener(this); pause.setonclicklistener(this); stop.setonclicklistener(this); // 呼叫名為 " stu.edu.mediaipc.romteservicetransact" 的 Service bindservice(new Intent("stu.edu.mediaipc.RomteServiceTransact"), serviceconnection, public void onclick(view v) { Message message = null; try { if (v == start) message = Message.obtain(null, SONG2); else if (v == pause) message = Message.obtain(null, PAUSE); else if (v == stop) message = Message.obtain(null, STOP); message.replyto = locms; romms.send(message); catch (RemoteException e) { e.printstacktrace();

28 Part IV 測試 Step 1 執行應用程式並進行撥放音樂 啟動 MeidaIPC 按播放 按 home 鍵啟動 MediaClient 按播放

Android Service

Android Service Android Service- 播放音樂 建國科技大學資管系 饒瑞佶 2013/7 V1 Android Service Service 是跟 Activity 並行 一個音樂播放程式若沒使用 Service, 即使按 home 鍵畫面離開之後, 音樂還是照播 如果再執行一次程式, 新撥放的音樂會跟先前撥放的一起撥, 最後程式就會出錯 執行中的程式完全看不到! 但是, 寫成 Service 就不同了

More information

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 專題進度 老師 : 趙啟時老師 學生 : 陳建廷 2013/10/13 用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 程式碼 : package com.example.phone; import java.util.arraylist;

More information

res/layout 目录下的 main.xml 源码 : <?xml version="1.0" encoding="utf 8"?> <TabHost android:layout_height="fill_parent" xml

res/layout 目录下的 main.xml 源码 : <?xml version=1.0 encoding=utf 8?> <TabHost android:layout_height=fill_parent xml 拓展训练 1- 界面布局 1. 界面布局的重要性做应用程序, 界面是最基本的 Andorid 的界面, 需要写在 res/layout 的 xml 里面, 一般情况下一个 xml 对应一个界面 Android 界面布局有点像写 html( 连注释代码的方式都一样 ), 要先给 Android 定框架, 然后再在框架里面放控件,Android 提供了几种框架,AbsoluteLayout,LinearLayout,

More information

新・解きながら学ぶJava

新・解きながら学ぶJava 481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --

More information

單步除錯 (1/10) 打開 Android Studio, 點選 Start a new Android Studio project 建立專案 Application name 輸入 BMI 點下 Next 2 P a g e

單步除錯 (1/10) 打開 Android Studio, 點選 Start a new Android Studio project 建立專案 Application name 輸入 BMI 點下 Next 2 P a g e Android Studio Debugging 本篇教學除了最基本的中斷點教學之外, 還有條件式中斷的教學 條件式中斷是進階的除錯技巧, 在某些特定情況中, 我們有一個函數可能會被呼叫數次, 但是我們只希望在某種條件成立時才進行中斷, 進而觀察變數的狀態 而條件式中斷這項技巧正是符合這項需求 本教學分兩部分 單步除錯 (Page2~11, 共 10) 條件式中斷點 (Page12~17, 共 6)

More information

Android Robert C.C. Huang Oscar F.Y. Liu Peter C.L. Hsieh 2011/03/21

Android Robert C.C. Huang Oscar F.Y. Liu Peter C.L. Hsieh 2011/03/21 Android Robert C.C. Huang Oscar F.Y. Liu Peter C.L. Hsieh 2011/03/21 Outlines for Today Future Planning Review System Architecture Dev. Tools & Making the First App Project Structure & File Details Application

More information

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new ListView 自訂排版 主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new int[]{r.drawable.dog1, R.drawable.dog2,

More information

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

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入 100 年 特 種 考 試 地 方 政 府 公 務 人 員 考 試 試 題 等 別 : 三 等 考 試 類 科 : 資 訊 處 理 科 目 : 系 統 分 析 與 設 計 一 請 參 考 下 列 旅 館 管 理 系 統 的 使 用 案 例 圖 (Use Case Diagram) 撰 寫 預 約 房 間 的 使 用 案 例 規 格 書 (Use Case Specification), 繪 出 入

More information

建模与图形思考

建模与图形思考 C03_c 基 於 軟 硬 整 合 觀 點 JNI: 从 C 调 用 Java 函 数 ( c) By 高 煥 堂 3 How-to: 基 於 軟 硬 整 合 觀 點 从 C 调 用 Java 函 数 如 果 控 制 点 摆 在 本 地 C 层, 就 会 常 常 1. 从 本 地 C 函 数 去 调 用 Java 函 数 ; 2. 从 本 地 C 函 数 去 存 取 Java 层 对 象 的 属 性

More information

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

中 文 摘 要 智 慧 型 手 機 由 於 有 強 大 的 功 能, 以 及 優 渥 的 便 利 性, 還 能 與 網 路 保 持 隨 時 的 鏈 結 與 同 步 更 新, 因 此 深 受 廣 大 消 費 者 喜 愛, 當 然, 手 機 遊 戲 也 成 為 現 代 人 不 可 或 缺 的 娛 樂 之 臺 北 市 大 安 高 級 工 業 職 業 學 校 資 訊 科 一 百 零 一 學 年 度 專 題 製 作 報 告 ------ 以 Android 製 作 ------ ----- 連 線 塔 防 遊 戲 ------ Tower defense game using Internet technology 班 級 : 資 訊 三 甲 組 別 : A9 組 組 員 : 葉 冠 麟 (9906129)

More information

Microsoft PowerPoint - ch6 [相容模式]

Microsoft PowerPoint - ch6 [相容模式] UiBinder wzyang@asia.edu.tw UiBinder Java GWT UiBinder XML UI i18n (widget) 1 2 UiBinder HelloWidget.ui.xml: UI HelloWidgetBinder HelloWidget.java XML UI Owner class ( Composite ) UI XML UiBinder: Owner

More information

ShareText

ShareText 作者 : 林致宇 日期 :2012/1/23 問題 : 如何分享分享文字資訊給其它的應用程式? 解答 : 有時候我們可能會希望 我們的應用程式的資訊 能夠讓使用者分享出去, 讓使用者能夠將此資訊傳送簡訊給其好友或寄電子郵件的方式寄給其好友, 這份文件將示範如何寫出這樣的應用程式 本文件將產出兩個 App, 第一個 App 是 分享資料的來源, 名為 CopyPaste_Source, 功能非常簡單,

More information

書面

書面 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 5.4 互動功能畫面 程式碼請參考附件-程式三 在進入互動頁面時 會執行setAllText()依寵物狀態數值來 設定狀態文字與頭像 並且依心情決定是否要不要播放音效 觸摸的區域 由於是自己寫的 view 所以並未透過xml來設置 而是透過Layut.addview()來動態新增

More information

Android Android Android SDK iv

Android Android Android SDK iv Android Market Google Android SDK Apple Google Microsoft b2c b 2010 Internet Android how why iii Android 240... Android Android SDK iv Android Market Google Android SDK Visual C++ Java N-tier J2EE Unix/Linux

More information

Dynamic Layout in Android

Dynamic Layout in Android Dynamic Layout in Android 建國科技大學資管系 饒瑞佶 2013/5 V1 Layout 多半都透過 res/layout/xml 格式設定來達成 Android 是 OOP, 所以可以動態產生 Layout 重點是 Layout 的階層關係 (Hierarchy) 需要處理對應事件 最後一樣用 setcontentview 加入 Layout 一 加入現有 Layout 中

More information

Microsoft Word - GoF-ch06-8-AbsFactory-ok.doc

Microsoft Word - GoF-ch06-8-AbsFactory-ok.doc 第 6 章 Abstract Factory 樣式 137 138 Google Android 設計招式之美 Android 設計招式之美教材下載 第 6 章 Abstract Factory 樣式 139 第 6 章 Abstarct Factory 模式 6.1 Abstract Factory 模式美何在? 6.1.1 大格局的分合自如 6.1.2 不知而亦能用 之实践 6.2 介绍 Abstract

More information

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6:

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6: Chapter 15. Suppressed Exception CH14 Finally Block Java SE 7 try-with-resources JVM cleanup try-with-resources JVM cleanup cleanup Java SE 7 Throwable getsuppressed Throwable[] getsuppressed() Suppressed

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

0511-Android程式之GPS應用_專題週記4

0511-Android程式之GPS應用_專題週記4 逢甲大學通訊工程學系專題研究 Android 程式之 GPS 應用 專題週記 0511 學生姓名 陳彥儒 D0035131 廖元譽 D0077791 指導老師 楊豐瑞老師繳交日期 2014.05.11 1 匯入 GoogleMap 1.1 取得授權步驟 目前進度 取得 Google 授權鑰匙 實作程式尚未成功 1.1.1 建立個人的 keystore 1.1.2 由個人的 keystore 查詢 SHA1

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

More information

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO CHAPTER 使用 Hadoop 打造自己的雲 8 8.3 測試 Hadoop 雲端系統 4 Nodes Hadoop Map Reduce Hadoop WordCount 4 Nodes Hadoop Map/Reduce $HADOOP_HOME /home/ hadoop/hadoop-0.20.2 wordcount echo $ mkdir wordcount $ cd wordcount

More information

投影片 1

投影片 1 資料庫管理程式 ( 補充教材 -Part2) 使用 ADO.NET 連結資料庫 ( 自行撰寫程式碼 以實現新增 刪除 修改等功能 ) Private Sub InsertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InsertButton.Click ' 宣告相關的 Connection

More information

Android Fragment

Android Fragment Android Fragment 建國科技大學資管系饒瑞佶 2017/10 V1 Android 3.0 後才支援 Fragment 解決部分 App 適應螢幕大小的問題 它類似於 Activity, 可以像 Activity 可以擁有自己的版面設計, 也和 Activity 一樣有自己的生命週期 ( 具備 oncreate() oncreateview() 與 onpause() 方法 ) LifeCycle

More information

01_Service

01_Service 移动平台应用软件开发 Service 主讲 : 张齐勋 zhangqx@ss.pku.edu.cn 移动平台应用软件开发 课程建设小组 北京大学 二零一七年 什么是 Service 与 Activity 一样, 同属 Android 基本组件 后台运行, 不与用户交互, 没有可视化界面 最常见的 Service 如 : 在后台播放歌曲 后台执行文件的下载 同样需在 AndroidManifest.xml

More information

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

The golden pins of the PCI card can be oxidized after months or years Q. 如何在 LabWindows/CVI 編譯 DAQ Card 程式? A: 請參考至下列步驟 : 步驟 1: 安裝驅動程式 1. 安裝 UniDAQ 驅動程式 UniDAQ 驅動程式下載位置 : CD:\NAPDOS\PCI\UniDAQ\DLL\Driver\ ftp://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/unidaq/dll/driver/

More information

Microsoft Word - ASM SDK 說明文件

Microsoft Word - ASM SDK 說明文件 System Monitor SDK (for Android) 開發者指南說明書 1. 技術項目簡介 經由簡化的應用程式介面 (Application Programming Interface), 可 提供給 Android 應用程式開發者開發基於 System monitor 的應用程式 2. 應用範圍說明 本技術可應用於具備 Android 系統 2.3.3 以上版本的 Android 嵌入式裝

More information

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

Microsoft Word - 第1章 Android基本概念.docx Android 系 统 下 Java 编 程 详 解 作 者 : 华 清 远 见 第 1 章 Android 基 本 概 念 本 章 简 介 本 章 主 要 介 绍 Android 基 本 概 念 方 面 的 内 容, 包 括 Android 平 台 特 性 Android 系 统 架 构 Android 开 发 框 架 和 Android 开 发 环 境 搭 建 1.1 Android 简 介 Android

More information

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

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6 www.brainysoft.net 1.JasperReport ireport...4 1.1 JasperReport...4 1.2 ireport...4 2....4 2.1 JDK...4 2.1.1 JDK...4 2.1.2 JDK...5 2.1.3 JDK...5 2.2 ant...6 2.2.1 ant...6 2.2.2 ant...6 2.3 JasperReport...7

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Java application Java main applet Web applet Runnable Thread CPU Thread 1 Thread 2 Thread 3 CUP Thread 1 Thread 2 Thread 3 ,,. (new) Thread (runnable) start( ) CPU (running) run ( ) blocked CPU sleep(

More information

Database_001

Database_001 作者 : 林致宇日期 :2011/10/26 主要參考來源 : http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applicat ions/ 問題 : 如在存取一個已經建立好的資料庫? 解答 : 有一些應用程式會需要讀取已經建立好的資料庫, 例如一個試題測驗應用程式, 裡面的試題可能已經於電腦上, 使用任何的

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

untitled

untitled 4.1AOP AOP Aspect-oriented programming AOP 來說 AOP 令 理 Cross-cutting concerns Aspect Weave 理 Spring AOP 來 AOP 念 4.1.1 理 AOP AOP 見 例 來 例 錄 Logging 錄 便 來 例 行 留 錄 import java.util.logging.*; public class HelloSpeaker

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-065Big5 Title : Sun Certified Programmer for the Java 2 Platform, SE 6.0 Version : Demo 1 / 14 1. 35. String #name = "Jane Doe"; 36. int

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

建立Android新專案

建立Android新專案 Android 智 慧 型 手 機 程 式 設 計 Android WebService 建 國 科 技 大 學 資 管 系 饒 瑞 佶 2012/4 V1 2012/8 V2 2013/5 V3 2014/10 v4 提 醒 這 節 的 內 容 針 對 的 是 MS 的 Web Service 或 是 使 用 SOAP(Simple Object Access Protocol) 標 準 建 立

More information

SDK 概要 使用 Maven 的用户可以从 Maven 库中搜索 "odps-sdk" 获取不同版本的 Java SDK: 包名 odps-sdk-core odps-sdk-commons odps-sdk-udf odps-sdk-mapred odps-sdk-graph 描述 ODPS 基

SDK 概要 使用 Maven 的用户可以从 Maven 库中搜索 odps-sdk 获取不同版本的 Java SDK: 包名 odps-sdk-core odps-sdk-commons odps-sdk-udf odps-sdk-mapred odps-sdk-graph 描述 ODPS 基 开放数据处理服务 ODPS SDK SDK 概要 使用 Maven 的用户可以从 Maven 库中搜索 "odps-sdk" 获取不同版本的 Java SDK: 包名 odps-sdk-core odps-sdk-commons odps-sdk-udf odps-sdk-mapred odps-sdk-graph 描述 ODPS 基础功能的主体接口, 搜索关键词 "odpssdk-core" 一些

More information

预览图 : (2) 在 SelectCity.java 中增加控件, 用于绑定 select_city 文件的 ListView, TextView,EditTest 等控件 代码和注释如下 :

预览图 : (2) 在 SelectCity.java 中增加控件, 用于绑定 select_city 文件的 ListView, TextView,EditTest 等控件 代码和注释如下 : EditText 实现城市搜索 1801210778 邹宇航 摘要 : 使用 EditText 实现搜索城市的功能, 以此为依据更新 ListView 1. 效果图 : 2. 主要步骤 (1) 在 select-city.xml 布局文件中中添加 EditText 控件用作搜索框, 然后添加 ListView 控件用来显示城市名字内容 代码如下 : 预览图 : (2) 在 SelectCity.java

More information

ContextMenu

ContextMenu 作者 : 林致宇 日期 :2012/1/20 問題 : 如何建立 ContextMenu? 解答 : 什麼是 ContextMenu 呢? 下面兩張圖是 ContextMenu 的範例, 紅色框線中的選單即所謂的 ContextMenu, 可以視為 選單列表, 例如在左圖的 ContextMenu 中有兩個選項 : Action 1 與 Action 2, 按下 Action 1 可執行某些動作,

More information

Android 编程基础 Android 开发教程 & 笔记 1

Android 编程基础 Android 开发教程 & 笔记 1 Android 开发教程 & 笔记 1 多式样 ProgressBar 撰写 : 地狱怒兽 联系 :zyf19870302@126.com 普通圆形 ProgressBar 该类型进度条也就是一个表示运转的过程, 例如发送短信, 连接网络等等, 表示一个过程正 在执行中 一般只要在 XML 布局中定义就可以了

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

《大话设计模式》第一章

《大话设计模式》第一章 第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜

More information

INTRODUCTION TO COM.DOC

INTRODUCTION TO COM.DOC How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU mahler@ms16.hinet.net This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX

More information

Lecture01_Android介绍

Lecture01_Android介绍 移动平台应用软件开发 Android 介绍 主讲 : 张齐勋 zhangqx@ss.pku.edu.cn 移动平台应用软件开发 课程建设小组 北京大学 二零一七年秋北京 Android是什么 Android不仅仅是一个操作系统 它更是一个完整的软件框 架 Android基于Linux内核 2005年Google公司收购了Android公司 Google公司选择使用Apache许可证开放Android源码

More information

EJB-Programming-3.PDF

EJB-Programming-3.PDF :, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client

More information

Microsoft Word - 004_Android線程模式介紹.doc

Microsoft Word - 004_Android線程模式介紹.doc Android 線程模式简介 基礎概念進程與線程在 Android 框架裡, 一個應用套件 (Application Package) 通常含有多個 Java 類 (Class), 這些類可以在同一個進程 (Process) 裡執行 ; 也可以在不同的進程裡執行 基於 Linux 的安全限制, 以及進程的基本特性 ( 例如, 不同進程的位址空間是獨立的 ), 如果兩個類 ( 或其對象 ) 在同一個進程裏執行時,

More information

JavaIO.PDF

JavaIO.PDF O u t p u t S t ream j a v a. i o. O u t p u t S t r e a m w r i t e () f l u s h () c l o s e () public abstract void write(int b) throws IOException public void write(byte[] data) throws IOException

More information

Android + NFC

Android + NFC Android + NFC 建國科技大學資管系饒瑞佶 2017/3 v1 讀取 Tag UUID Android 2.3.3 (API Level 10) 才有支援完整的 NFC 功能 只要 NFC 相容都讀的到 (NFC 或 Mifare) 建立新專案修改 AndroidManifest.xml 加入 , 如果有 NFC Tag 進入感測範圍, 本 App 也會變成可處理的

More information

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

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class 踩地雷遊戲 高慧君南港高中 開啟專案 MineSweep 任務一 : 產生 30X20 個磚塊編輯 Table 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.arraylist; Write a description of class MyWorld

More information

手说TTS开发指南

手说TTS开发指南 手说 TTS 开发指南 v1.3 2011 年 6 月 版权所有 : 手说工作室 shoushuo.com 版本时间作者说明 1.0 2010-11-15 张波 1.1 2010-12-27 在 ondestroy 方法 unbindservice 1.2 2010-12-30 1.3 2011-6-12 去掉 TTS 初始化 ; ttsservice.initialize() 方法调用添加接口方法

More information

<ADB6ADB1C25EA8FAA6DB2D4D56432E706466>

<ADB6ADB1C25EA8FAA6DB2D4D56432E706466> packages 3-31 PART 3-31 03-03 ASP.NET ASP.N MVC ASP.NET ASP.N MVC 4 ASP.NET ASP.NE MVC Entity Entity Framework Code First 2 TIPS Visual Studio 20NuGetEntity NuGetEntity Framework5.0 CHAPTER 03 59 3-3-1

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

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)

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) 1/14 IBM Rational Test RealTime IBM, 2004 7 01 50% IBM Rational Test RealTime IBM Rational Test RealTime 1. 50% IBM Rational Test RealTime IBM Rational Test RealTime 2. IBM Rational Test RealTime Test

More information

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck

More information

<4D F736F F D FB1B5A4663F3FA4A7ACFC5FB371A5CEA9CAB1B5A466AABA3FA6583FA5CE5F6F6B2E646F63>

<4D F736F F D FB1B5A4663F3FA4A7ACFC5FB371A5CEA9CAB1B5A466AABA3FA6583FA5CE5F6F6B2E646F63> G08_ 接口设计之美 _ 通用性接口的组合应用 内容 : 1. 复习 : 通用性接口的基本结构 2. 此结构是由 2 个 EIT 造形所组成 3. 谁来 实现 通用性接口呢? 4. 应用范例 : 手机与 Android TV 的多机整合 4.1 应用情境 4.2 介绍 3 个通用性接口 :Servlet Context 和 IBinder 5. 范例架构设计 : 联合应用 3 个通用性接口 5.1

More information

C/C++ - 字符输入输出和字符确认

C/C++ - 字符输入输出和字符确认 C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,

More information

RecyclerView and CardVew

RecyclerView and CardVew RecyclerView and CardView 建國科技大學資管系饒瑞佶 2017/10 V1 CardView CardView A CardView is a ViewGroup. Like any other ViewGroup, it can be added to youractivity or Fragment using a layout XML file. To create an

More information

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP: ******************* * 关于 Java 测试试题 ******

エスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP:  ******************* * 关于 Java 测试试题 ****** ******************* * 关于 Java 测试试题 ******************* 問 1 运行下面的程序, 选出一个正确的运行结果 public class Sample { public static void main(string[] args) { int[] test = { 1, 2, 3, 4, 5 ; for(int i = 1 ; i System.out.print(test[i]);

More information

ASP.NET MVC Visual Studio MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\M

ASP.NET MVC Visual Studio MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\M ASP.NET MVC Visual Studio 2017 1 1-4 MVC MVC 範例 1-1 建立第一個 MVC 專案 Visual Studio MVC step 01 Visual Studio Web ASP.NET Web (.NET Framework) step 02 C:\MvcExamples firstmvc MVC 1-7 ASP.NET MVC 1-9 ASP.NET

More information

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2 PowerBuilder 9 PowerBuilder Native Interface(PBNI) PowerBuilder 9 PowerBuilder C++ Java PowerBuilder 9 PBNI PowerBuilder Java C++ PowerBuilder NVO / PowerBuilder C/C++ PowerBuilder 9.0 PowerBuilder Native

More information

Lecture01_Android介绍

Lecture01_Android介绍 移动平台应用软件开发 Android 介绍 主讲 : 张齐勋 zhangqx@ss.pku.edu.cn 移动平台应用软件开发 课程建设小组 北京大学 二零一八年秋北京 Android 是什么 Android 不仅仅是一个操作系统, 它更是一个完整的软件框架 Android 基于 Linux 内核 2005 年 Google 公司收购了 Android 公司 Google 公司选择使用 Apache

More information

Microsoft Word - A201103-528_1299547322.doc

Microsoft Word - A201103-528_1299547322.doc 5 10 15 20 25 30 基 于 Android 平 台 的 人 机 交 互 的 研 究 与 实 现 郁 亚 男 ( 北 京 邮 电 大 学 软 件 学 院, 北 京 100876) 摘 要 : 随 着 计 算 的 发 展, 计 算 变 得 越 来 越 自 由, 在 资 源 使 用 方 面 也 越 来 越 灵 活 移 动 终 端 由 于 无 线 通 信 网 络 传 输 速 率 的 提 高,

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

Android 开发教程

Android 开发教程 封面 1 文件存取编程基础 文件 文件可以用来存储比使用引用更大数量的数据 Android 提供方法来读 写文件 只有本地文件可以被访问 优点 : 可以存储大容量的数据 缺点 : 文件更新或是格式改变可能会导致巨大的编程工作 文件操作 读文件 Context.openFileInput(String name) 打开一个与应用程序联系的私有文件输入流 当文件不存在时抛出 FileNotFoundException

More information

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco Windows RTEMS 1 Danilliu MMI TCP/IP 80486 QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos ecos Email www.rtems.com RTEMS ecos RTEMS RTEMS Windows

More information

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii 前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii C# 7 More Effective C# C# C# C# C# C# Common Language Runtime CLR just-in-time

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

untitled

untitled JavaEE+Android - 6 1.5-2 JavaEE web MIS OA ERP BOSS Android Android Google Map office HTML CSS,java Android + SQL Sever JavaWeb JavaScript/AJAX jquery Java Oracle SSH SSH EJB+JBOSS Android + 1. 2. IDE

More information

建立Android新專案

建立Android新專案 經濟部工業局 Android 智慧型手機程式設計實務應用班 Android WebService 建國科技大學資管系 饒瑞佶 2012/4 WebService 需要 ksoap2-android-assembly-2.5.2-jar-withdependencies.jar 或 ksoap2-android-assembly-2.5.2-jar-withdependencies_timeout1.jar

More information

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj Message Transition 5-1 5-2 DataInputStream Class 5-3 DataOutputStream Class 5-4 PrintStream Class 5-5 (Message Transition) (Exercises) Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream

More information

09 (File Processes) (mkdir) 9-3 (createnewfile) 9-4 (write) 9-5 (read) 9-6 (deletefile) 9-7 (deletedir) (Exercises)

09 (File Processes) (mkdir) 9-3 (createnewfile) 9-4 (write) 9-5 (read) 9-6 (deletefile) 9-7 (deletedir) (Exercises) 09 (File Processes) 9-1 9-2 (mkdir) 9-3 (createnewfile) 9-4 (write) 9-5 (read) 9-6 (deletefile) 9-7 (deletedir) (Exercises) Java Servlet 9-1 Servlet (File Processes) Client Servlet Servlet Java Java (Stream)

More information

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

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile.. WebSphere Studio Application Developer IBM Portal Toolkit... 1/21 WebSphere Studio Application Developer IBM Portal Toolkit Portlet Doug Phillips (dougep@us.ibm.com),, IBM Developer Technical Support Center

More information

Microsoft Word - 02.目錄.doc

Microsoft Word - 02.目錄.doc 目錄 -1- 目錄 序 準備篇 一 使用說明... 0-2 二 標示說明... 0-6 三 注意事項... 0-7 第一類 Android 基礎知識 -UI 設計及語法應用 101. 整存整付計算機... 1-2 102. 電費計算機... 1-8 103. 點餐系統... 1-18 104. 計算 BMI 值... 1-23 105. MENU 功能選單... 1-36 106. 畫廊展示...

More information

附录J:Eclipse教程

附录J:Eclipse教程 附 录 J:Eclipse 教 程 By Y.Daniel Liang 该 帮 助 文 档 包 括 以 下 内 容 : Eclipse 入 门 选 择 透 视 图 创 建 项 目 创 建 Java 程 序 编 译 和 运 行 Java 程 序 从 命 令 行 运 行 Java Application 在 Eclipse 中 调 试 提 示 : 在 学 习 完 第 一 章 后 使 用 本 教 程 第

More information

untitled

untitled ArcGIS Server Web services Web services Application Web services Web Catalog ArcGIS Server Web services 6-2 Web services? Internet (SOAP) :, : Credit card authentication, shopping carts GIS:, locator services,

More information

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

目 錄 版 次 變 更 記 錄... 2 原 始 程 式 碼 類 型 之 使 用 手 冊... 3 一 安 裝 軟 體 套 件 事 前 準 備... 3 二 編 譯 流 程 說 明... 25 1 科 技 部 自 由 軟 體 專 案 原 始 程 式 碼 使 用 手 冊 Source Code Manual of NSC Open Source Project 可 信 賴 的 App 安 全 應 用 框 架 -App 應 用 服 務 可 移 轉 性 驗 證 Trusted App Framework -Transferability Verification on App MOST 102-2218-E-011-012

More information

chp6.ppt

chp6.ppt Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行

More information

IBM Rational ClearQuest Client for Eclipse 1/ IBM Rational ClearQuest Client for Ecl

IBM Rational ClearQuest Client for Eclipse   1/ IBM Rational ClearQuest Client for Ecl 1/39 Balaji Krish,, IBM Nam LeIBM 2005 4 15 IBM Rational ClearQuest ClearQuest Eclipse Rational ClearQuest / Eclipse Clien Rational ClearQuest Rational ClearQuest Windows Web Rational ClearQuest Client

More information

RunPC2_.doc

RunPC2_.doc PowerBuilder 8 (5) PowerBuilder Client/Server Jaguar Server Jaguar Server Connection Cache Thin Client Internet Connection Pooling EAServer Connection Cache Connection Cache Connection Cache Connection

More information

ltu

ltu 資 訊 管 理 系 學 齡 前 自 主 學 習 之 行 動 裝 置 輔 助 系 統 指 導 教 授 : 李 靜 怡 教 授 組 員 名 單 : 蔡 承 育 988C012 黃 佳 誼 988C026 鄭 亦 琦 988C060 廖 曼 伶 988C108 中 華 民 國 1 0 2 年 5 月 嶺 東 科 技 大 學 資 訊 管 理 系 學 齡 前 自 主 學 習 之 行 動 裝 置 輔 助 系 統

More information

Chapter 16 Widget 作者 : 林致孙 不少 Android 手機在使用者剛購買時, 手機的桌面上就已經有不少的小工具 (Widget), 有些可以即時顯示氣候資訊, 有些則可以顯示最新股票資訊 本章將 利用兩個例子來說明 Widget 是如何設計的 16.1 時辰顯示小工具 在 An

Chapter 16 Widget 作者 : 林致孙 不少 Android 手機在使用者剛購買時, 手機的桌面上就已經有不少的小工具 (Widget), 有些可以即時顯示氣候資訊, 有些則可以顯示最新股票資訊 本章將 利用兩個例子來說明 Widget 是如何設計的 16.1 時辰顯示小工具 在 An Chapter 16 Widget 作者 : 林致孙 不少 Android 手機在使用者剛購買時, 手機的桌面上就已經有不少的小工具 (Widget), 有些可以即時顯示氣候資訊, 有些則可以顯示最新股票資訊 本章將 利用兩個例子來說明 Widget 是如何設計的 16.1 時辰顯示小工具 在 Android 開發者網站, 已針對 Widget 的開發提供了一份詳細的文件 [1], 本章大部份的內容皆是參考該文件而製作的,

More information

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074> 程 序 设 计 实 习 INFO130048 3-2.C++ 面 向 对 象 程 序 设 计 重 载 继 承 多 态 和 聚 合 复 旦 大 学 计 算 机 科 学 与 工 程 系 彭 鑫 pengxin@fudan.edu.cn 内 容 摘 要 方 法 重 载 类 的 继 承 对 象 引 用 和 拷 贝 构 造 函 数 虚 函 数 和 多 态 性 类 的 聚 集 复 旦 大 学 计 算 机 科 学

More information

X6-04_How_do_I_write_a_com_port_communicate_program_of_XPAC_tc

X6-04_How_do_I_write_a_com_port_communicate_program_of_XPAC_tc Author WeiKai Version 1.0.0 Date 2013/4/14 Page 1/11 我如何在 XPAC 上建立一個 COM port 通訊程式 Applies to: Platform OS version XPAC utility version XPAC series All versions (WinCE6) All versions XPAC SDK 提供 XPAC 結合

More information

Microsoft Word zw

Microsoft Word zw 第 1 章 Android 概述 学习目标 : Android Android Android Studio Android Android APK 1.1 1. 智能手机的定义 Smartphone 2. 智能手机的发展 1973 4 3 PC IBM 1994 IBM Simon PDA PDA Zaurus OS 1996 Nokia 9000 Communicator Nokia 9000

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 1Z0-854 Title : Java Standard Edition 5 Programmer Certified Professional Upgrade Exam Version : Demo 1 / 12 1.Given: 20. public class CreditCard

More information

Microsoft Word - 苹果脚本跟我学.doc

Microsoft Word - 苹果脚本跟我学.doc AppleScript for Absolute Starters 2 2 3 0 5 1 6 2 10 3 I 13 4 15 5 17 6 list 20 7 record 27 8 II 32 9 34 10 36 11 44 12 46 13 51 14 handler 57 15 62 63 3 AppleScript AppleScript AppleScript AppleScript

More information

Microsoft PowerPoint - App與微控器整合.pptx

Microsoft PowerPoint - App與微控器整合.pptx 1 2 Outline APP 與微控器整合 2017 中山大學電機實驗營 App 開發環境 -Android Studio 介紹 App 開發 實驗營 App 流程 3 4 Android Studio 介紹 Android Studio 是一個為 Android 平台開發程式的整合式開發環境, 可供開發者免費使用, 並在 Windows OS X Linux 平台上均可執行 專案結構 一個專案下有

More information

C6_ppt.PDF

C6_ppt.PDF C01-202 1 2 - (Masquerade) (Replay) (Message Modification) (Denial of Service) - ( ) (Eavesdropping) (Traffic Analysis) 8 1 2 7 3 6 5 4 3 - TCP SYN (SYN flood) Smurf Ping of Death LAND Attack Teardrop

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-055Big5 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : Demo 1 / 22 1. 11. public static void parse(string str)

More information

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO Car DVD New GUI IR Flow User Manual V0.1 Jan 25, 2008 19, Innovation First Road Science Park Hsin-Chu Taiwan 300 R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 Web: www.sunplus.com Important Notice SUNPLUS

More information

chapter 2 HTML5 目錄iii HTML HTML HTML HTML HTML canvas

chapter 2 HTML5 目錄iii HTML HTML HTML HTML HTML canvas Contents 目錄 chapter 1 1-1... 1-2 1-2... 1-3 HTML5... 1-3... 1-5 1-3... 1-9 Web Storage... 1-9... 1-10 1-4 HTML5... 1-14... 1-14... 1-15 HTML5... 1-15... 1-15... 1-16 1-5... 1-18 Apps... 1-18 HTML5 Cache

More information

建模与图形思考

建模与图形思考 F06_c 观摩 :ContentProvider 基於軟硬整合觀點 架构與 DB 引擎移植方法 ( c) By 高煥堂 4 通用性基类 ContentProvider 基於軟硬整合觀點 的使用范例 刚才的范例里, 我们直接使用 DataPersist 类的接口来与 SQLite 沟通 本节将替 DataPersist 配上 ContentProvider 基类, 让 Client 能透过 ContentProvider

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

图 6-1 主界面 MainActivity 界面对应的布局文件 (activity_main.xml) 如下所示 : <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="

图 6-1 主界面 MainActivity 界面对应的布局文件 (activity_main.xml) 如下所示 : <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android= 第 6 章广播接收者 应用案例 案例 6-1 CallRecord( 通话记录 ) 一 案例描述 1 考核知识点 030006001: 广播接收者简介 030006002: 广播接收者的创建 2 练习目标 广播的静态注册和使用 使用广播处理处理事件 3 需求分析手机最重要的功能就是通话功能, 同样储存通话记录也是必不可少的 该案例使用广 播接收者自己实现通话记录的功能 包括呼出电话 已接来电 未接来电以及通话产生的

More information

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

内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指 内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指 导 你 搭 建 Linux 平 台 下 的 JAVA 开 发 环 境, 包 括 JDK 以 及 集

More information

ii Vue Bootstrap 4 ES 6 Vue Vue Bootstrap 4 ES 6 Vue 2 vue html vue html vue Vue HTML 5 CSS ES 6 HTML 5 CSS Visual Studio Code h

ii Vue Bootstrap 4 ES 6 Vue Vue Bootstrap 4 ES 6 Vue 2 vue html vue html vue Vue HTML 5 CSS ES 6 HTML 5 CSS Visual Studio Code h ii Vue Bootstrap 4 ES 6 Vue Vue Bootstrap 4 ES 6 Vue 2 vue010101.html vue010104.html vue0101 01 04 Vue HTML 5 CSS ES 6 HTML 5 CSS Visual Studio Code https://code.visualstudio.com/ Chrome XAMP Visual Studio

More information

Microsoft Word - edu-re~1.doc

Microsoft Word - edu-re~1.doc 前 言 學 習, 可 以 為 個 創 造 未 來 ; 教 育, 能 夠 為 社 會 開 拓 明 對 個 而 言, 教 育 可 以 幫 助 每 個 發 展 潛 能 建 構 知 識 及 提 升 個 素 質 ; 它 賦 予 每 個 掌 握 前 途 和 開 拓 未 來 的 能 力 對 社 會 而 言, 教 育 不 單 可 以 培 育 才, 而 且 具 有 ㆒ 個 更 深 層 的 意 義, 它 給 予 社 會

More information

Microsoft Word - 發布版---規範_全文_.doc

Microsoft Word - 發布版---規範_全文_.doc 建 築 物 無 障 礙 設 施 設 計 規 範 內 政 部 97 年 4 年 10 日 台 內 營 字 第 0970802190 號 令 訂 定, 自 97 年 7 月 1 日 生 效 內 政 部 97 年 12 年 19 日 台 內 營 字 第 0970809360 號 令 修 正 內 政 部 101 年 11 年 16 日 台 內 營 字 第 1010810415 號 令 修 正 目 錄 第 一

More information

概 述 随 着 中 国 高 等 教 育 数 量 扩 张 目 标 的 逐 步 实 现, 提 高 教 育 质 量 的 重 要 性 日 益 凸 显 发 布 高 校 毕 业 生 就 业 质 量 年 度 报 告, 是 高 等 学 校 建 立 健 全 就 业 状 况 反 馈 机 制 引 导 高 校 优 化 招

概 述 随 着 中 国 高 等 教 育 数 量 扩 张 目 标 的 逐 步 实 现, 提 高 教 育 质 量 的 重 要 性 日 益 凸 显 发 布 高 校 毕 业 生 就 业 质 量 年 度 报 告, 是 高 等 学 校 建 立 健 全 就 业 状 况 反 馈 机 制 引 导 高 校 优 化 招 I 概 述 随 着 中 国 高 等 教 育 数 量 扩 张 目 标 的 逐 步 实 现, 提 高 教 育 质 量 的 重 要 性 日 益 凸 显 发 布 高 校 毕 业 生 就 业 质 量 年 度 报 告, 是 高 等 学 校 建 立 健 全 就 业 状 况 反 馈 机 制 引 导 高 校 优 化 招 生 和 专 业 结 构 改 进 人 才 培 养 模 式 及 时 回 应 社 会 关 切 的 一 项

More information