Planet of NCCUCS
dosbox windows resolution Buy Microsoft Windows Server 2008 Web Edition SP2 configure internet connection on windows xp consumer ratings on vinyl windows Buy Microsoft Windows 7 Professional buy dhcp windows 2000 server apple usb keyboard windows drivers Buy Microsoft Office Visio Professional 2007 buy windows xp registration number buy windows applications Buy Microsoft Windows XP Professional SP3 disable autoplay cd windows 2000 asms windows xp home Buy McAfee Total Protection 2009 autocad lt autodesk contemporary windows Buy Cyberlink PowerDVD 8 Ultra check windows genuine effects for windows movie maker Buy Corel VideoStudio Pro X2 audio codec windows cannot end programs in windows xp Buy CorelDraw Graphics Suite X4 borland delphi 5 and windows vista cannot open windows updates Buy Autodesk AutoCAD 2009 checkpoint ngx r65 windows 2003 download terminal services client windows 2000 Buy Autodesk AutoCAD 2010 download windows xp file debug windows application Buy Autodesk 3Ds Max Design 2009 convert dbx outlook express windows mail automatically reboot windows xp Buy Ahead Nero 9 ashampoo defrag windows xp serious error cannot install printer driver windows 2000 Buy Microsoft Office 2003 Professional apple toolbar for windows delay write failed windows xp Buy Microsoft Office 2007 Enterprise cleanup windows startup

Android Application in 5 minutes

作者:Anderson on 九月 3, 2008 Posted in RSS | | 觀看文章來源

基本上一android application可以分四部份:

Activity
Broadcast Intent Receiver
Service
Content Provider

每個都有不同的意思,也是種類的控制方式。

但對一個想快速上手的開發者而言,如同在before helloworld文中所提到的,只要先掌握好自己的myproject.java來控制流程(Controller),把res/layout/main.xml當作外觀(View)。然後再找到如何把Controller(*.java)以及View(main.xml)結合的方式,就可以作一簡單的Android Application。

不過這只是把java application假裝是Android Application而已。
如果要再多作些讓他像一點,那就要記得去改AndroidManifest.xml,在裡面把有用到的label以及activity註冊一下。就可以作成有點像的Android Application。


以上是作弊的範圍,以下是小抄。

首先在src\下面有myproject.java 當然就要看個人需求,看是要作九九乘法表還是萬年曆等常見資料結構題目。

想好要做的東西可以先去查一下有哪些view可以用,goolge整理好有外觀有對應的api,詳見下列網址。

http://code.google.com/android/reference/view-gallery.html

找到可以用的view widget 之後就直依需求接修改main.xml,在eclipse專案中直接refresh會發現到,在src\R.java也跟著作相對應的修改。這算是android開發時一個特點,會根據你放入res目錄下的東西自動對於 R.java做修改。(這裡有個很奧妙的地方,如果不是用eclipse開發要怎麼樣產生出R.java勒 ?) 如果有要放檔案的話,請放在res\assets\ 這個目錄下。R.java也會自動作對應的修改。

最後就是對AndroidManifest.xml作修改,用eclipse開發的時候會將每一個類別作成選單,只要跟著填入就好,相當方便。

要注意的activity,activity 通常是指一個單一的頁面,而每一個activity也需要用一個class來描述。你需要知道說那個頁面的作用是什麼,會有什麼動作,這就是一個activity。像是在list page中要有選擇的動作,這就是一個activity。但選擇之後要作修改還是刪除這可以分別是不同的activity或是一個activity然後把各個動作都寫在*.java裡面。這就看各project的架構了。

目前還在做小抄速成的階段,等多累積些經驗之後會再做分享。提供一個case study的題材:AndroidBM

AndroidBMI 是 Android 平台上的 BMI (Body Mass Index) 值計算器。 本專案包含 深入淺出 Android 手機應用程式設計 一書。提供大家做參考:)

:, , ,

讀過本文的讀者, 也對以下文章有興趣

No comments for this entry yet...

Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

最新文章

照片

R0012028R0012036R0013553R0013551R0013550R0013549R0013560R0013558R0013569R0013561R0013570R0013571R0013580R0013581R0013556R0013567R0013563R0013572R0011783R0012312