因爲本身的一個應用提醒是很重要的一部分,因此就得好好學習下Android自帶的鬧鐘的實現了。android
android自帶應用在源代碼目錄的package/apps目錄下。git
鬧鐘應用的名字叫作DeskClock(說明:我下載的是android4.1的源代碼)shell
(1)將DeskClock複製一份到工做目錄中,app
由於它自己不能直接導入到Eclipse中,咱們能夠到其它的android項目中,將.project和.classpath(這兩個是隱藏文件)學習
項目文件複製一份到DeskClock中。並手動打開修改。ui
或者。像下面這樣:使用android update project 命令來spa
banxi1988@banxi:~/android/tmp/DeskClock$ ls -a . AndroidManifest.xml assets .git NOTICE src .. Android.mk CleanSpec.mk MODULE_LICENSE_APACHE2 res tests banxi1988@banxi:~/android/tmp/DeskClock$
banxi1988@banxi:~/android/tmp/DeskClock$ android update project -p . -s -t 6 Updated and renamed default.properties to project.properties Updated local.properties No project name specified, using Activity name 'DeskClock'. If you wish to change it, edit the first line of build.xml. Added file ./build.xml Added file ./proguard-project.txt Updated and renamed default.properties to project.properties Updated local.properties No project name specified, using Activity name 'TestAddAlarm'. If you wish to change it, edit the first line of build.xml. Added file ./tests/build.xml Added file ./tests/proguard-project.txt banxi1988@banxi:~/android/tmp/DeskClock$ ls -a . assets local.properties project.properties .. build.xml MODULE_LICENSE_APACHE2 res AndroidManifest.xml CleanSpec.mk NOTICE src Android.mk .git proguard-project.txt tests banxi1988@banxi:~/android/tmp/DeskClock$
如今你發現了build.xml因而能夠使用此文件在Eclipse中將項目導入了。android update project的具體使用參見其它文檔。你懂的。code
而後,咱們就能夠嘗試編譯運行DeskClock了。若是原來的虛擬機或者機子上已經有這個應用了,xml
那應該作出些修改。如更改包名等等。。ip