顯示具有 Android 標籤的文章。 顯示所有文章
顯示具有 Android 標籤的文章。 顯示所有文章

2010年9月21日 星期二

Android ADT 0.9.8, SDK Tools r7

這個月Android更新了 ADT, SDK Tools

SDK Tools, Revision 7 (September 2010)

Dependencies:
If you are developing in Eclipse with ADT, note that SDK Tools r7 is designed for use with ADT 0.9.8 and later. After installing SDK Tools r7, we highly recommend updating your ADT Plugin to 0.9.8.

General notes:
  • Added support for library projects that depend on other library projects.
  • Adds support for aidl files in library projects.
  • Adds support for extension targets in Ant build to perform tasks between the normal tasks: -pre-build, -pre-compile, and -post-compile.
  • Adds support for "headless" SDK update. See android -h update sdk for more information.
  • Fixes location control in DDMS to work in any locale not using '.' as a decimal point.

ADT 0.9.8 (September 2010)

Dependencies:
ADT 0.9.8 is designed for use with SDK Tools r7 and later. Before updating to ADT 0.9.8, we highly recommend that you use the Android SDK and AVD Manager to install SDK Tools r7 into your SDK.(先更新SDK喔)

General notes:
  • Adds a new Action, "Rename Application Package", to the Android Tools contextual menu. The Action does a full application package refactoring.
  • Adds support for library projects that don't have a source folder called src/. There is now support for any number of source folders, with no name restriction. They can even be in subfolder such as src/java. If you are already working with library projects created in ADT 0.9.7, seeMigrating library projects to ADT 0.9.8 for important information about moving to the new ADT environment.
  • Adds support for library projects that depend on other library projects.
  • Adds support for additional resource qualifiers: car/desk, night/notnight and navexposed/navhidden.
  • Adds more device screen types in the layout editor. All screen resolution/density combinations listed in the Supporting Multiple Screens are now available.(沒看到有新的Screen阿)
  • Fixes problems with handling of library project names that contain characters that are incompatible with the Eclipse path variable. Now properly sets up the link between the main project and the library project.

最近超需要Rename Application Package的功能,之前都用手動改package name真是麻煩死了,ADT更新的時機真是太剛好了。

2009年3月1日 星期日

下載 Android Java source code 並與Eclipse 連結

用Eclipse寫習慣Java的我,都會設定引用的library的Source code,一來這樣可以看到API解說,二來可以按住Ctrl + 直接點擊引用的程式碼,就可以連到source code看裡面到底是在做什麼。

但是很遺憾的Android SDK和一般Java open source的library不一樣,他提供的SDK的並沒有包含android.jar的source code,所以要自己到source.android.com下載

android source code不是用我比較熟的CVS, SVN,而是用Git,《如何在 Windows 平台上下載 Android 的原始碼?》有說明如何在windows下,下載source code。

git要下載的source code可以參考http://android.git.kernel.org/,因為我要的只是java source code,所以我只下載frameworks/base(Core Android app framework libraries),指令如下

git clone git://android.git.kernel.org/platform/frameworks/base.git

下載的時候速度之的很慢,不到10K,還好很晚了,就睡覺去讓他跑,隔天起來就下載完了。
再來依照下列步驟,就可以讓Eclipse連結到android java source code了

  1. android_sdk下新增一個資料夾"sources"
  2. 把D:\android\source\base\core\java底下的source複製到android_sdk\sources\下

網路上說,上面兩個步驟就可以了,但是我還是不行,後來花了一點時間,試了一下,發現一個解決方法,請繼續下面的步驟
  1. 複製android_sdk到任何其它位置,並把eclipse的Android SDK Loaction設定到複製的那個資料夾,按OK。這時侯其實就完成連結到source code了
  2. 重複步驟3,但是把Loaction指到原本的SDK資料夾,並把複製的那一個移除。(全部完成)


Android 課後感想

這禮拜六日(2/28, 3/1)去上 Sam Lu前輩的Android課程,總共兩天。

兩天上下來,其實內容對新手來說真的很不錯,Sam並沒有一頭直接交如何寫Android app,而是先說明整個Android 架構, OHA和G1手機,之後才一步一步的教一些component怎麼寫app,最後才是講解Android app一些核心架構,整個課程也很容易懂

整個課程的內容包含了
  • Android, OHA, G1簡介
  • 學習資料參考與學習方法
  • 開發環境安裝與應用(ADB, DDMS, LogCat)
  • 模擬器解說
  • apk
  • Mainfast
  • Activity, View(重要與常用的), custom view, adapter
  • UI from XML or by coding
  • Layout, Style, Resource
  • SQLite, Preferencess
  • Activity lifecycle
  • Service lifecycle
  • android_sdk\tools\底下一些有用的工具
  • 4個上機練習
  • 一些題外話和Q&A
對於看過一點點Doc和練習過Notepad教學的我來說,有大約一半的內容上課前都有自己學過,但整個課程內容還是很有幫助喔,畢竟有課程實作練習和一些開發經驗的分享,是很有幫助的。

接下來我就是要靠自己深入啦,目前打算買支G1(Dev phone對我來說太貴了),然後把整個doc看完,寫一些App放到market上,一步步的學系

最後還是要抱怨一下,修課條件都有註明要具備Java語言能力了,就不要因為有些人不會Java就用C的概念來解說程式和Java的概念,畢竟課程沒有註明要有C語言能力阿