Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts
最近發現SDK 可以更新, 主要是改善虛擬機效能問題. 對於Android 平台來說是一個很重要的更新.
因為用戶的Android 種類太多 囧rz 所以常常要用到虛擬機....

這邊是官方的資料 : 


General notes:
  • Emulator
    • Added support for hardware accelerated graphics rendering. This feature requires an API Level 15, Revision 3 or later system image. (more info)
      Note: As of the SDK Tools Revision 17 release, the API Level 15, Revision 3 system image is not yet available.
    • Added support for running Android x86 system images in virtualization mode on Windows and Mac OS X. (more info)
    • Added experimental support for multi-touch input by enabing the emulator to receive touch input from a USB-tethered physical Android device. (more info)
  • Added viewing of live detailed network usage of an app in DDMS. (more info)
  • ProGuard
    • Updated the bundled ProGuard tool to version 4.7. In addition to many new features, this update fixes the Conversion to Dalvik format failed with error 1 error some users have experienced.
    • Updated the default proguard.cfg file with better default flags for Android.
    • Split the ProGuard configuration file has been in half, with project specific flags kept in project and the generic Android flags distributed (and updated) with the tools themselves.
  • Build
    • Added a feature that allows you to run some code only in debug mode. Builds now generate a class called BuildConfig containing a DEBUGconstant that is automatically set according to your build type. You can check the (BuildConfig.DEBUG) constant in your code to run debug-only functions.
    • Fixed issue when a project and its libraries include the same jar file in their libs folder. (more info)
    • Added support for custom views with custom attributes in libraries. Layouts using custom attributes must use the namespace URIhttp://schemas.android.com/apk/res-auto instead of the URI that includes the app package name. This URI is replaced with the app specific one at build time.
  • Lint
    • Updated Lint to check Android application code. Lint rules which previously performed pattern based searches in the application code (such as the unused resource check) have been rewritten to use the more accurate Java-style parse trees.
    • Added support for checking library projects. This change means that rules such as the unused resource check properly handle resources declared in a library project and referenced in a downstream project.
    • Added ability to suppress Lint warnings in Java code with the new @SuppressLint annotation, and in XML files with the new tools: namespace and ignore attribute. (more info)
    • New Lint checks:
      • Added check for Android API calls that require a version of Android higher than the minimum supported version. You can use the new@TargetApi annotation to suppress warnings when the code is wrapped in a system version condition. (more info)
      • Added over 20 new Lint rules, including checks for performance, XML layouts, manifest and file handling.
以上 Hardware accelerated graphics 我自己是用不了 一直出錯誤, 可能電腦有什麼地方設不好吧... 
另外 x86 的虛擬機速度上有接近實體機了, 不過在跑自己Project 時還是有點小問題
其他功能待測 ( 懶惰 ) ~


Root
  • AndroidMainfest.xml - describes the application being built and what components are being supplied by that application.
  • bin/ - holds the appplication once compiled
  • libs/ - holds any third-party JARs your application requires
  • res/ - holds resources, such as picture, layouts.
  • drawable/ - holds picture or drawable xml.
  •  layout/ - holds GUI layout xml.
  •  value/ - holds key pairs that will reference in application.
  • src/ - holds java code for the application.
  • assets/ - holds other static files that you want packaged with the application.
  • gen/ - The directory in which Android's build tools place source code that they generate.
  • R.java
  • build.xml and *.properties - used as part of the Ant-Based command-line build process
  • proguard.cfg - A file that is used for integration with ProGuard to obfuscate your Android code ( 就是防止反編譯 )
最近面對的一個小問題就是如何在一個ScrollView 裹頭再放一個 ListView,  因為它們都有自己的Scroll Event 所以會出現 ScrollView 可以捲動但是 ListView 沒有反應.

雖然說Google 也不建議在 ScrollView 中再放 ListView 可是樣本是要這樣做沒辦法





一般來說學習新的 Programming Language 都會先編寫 Hello World! , 要進入Android 的世界先要準備幾種東西

1. IDE (可以是 Eclipse 或 Netbeans)
2.  Android SDK

因為Google 官方有 Eclipse ADT 插件所以以下用 Eclipse 做例子 ~

下載Eclipse : http://www.eclipse.org/
下載Android SDK : http://developer.android.com/sdk/index.html

安裝ADT 插件步驟
1. 開啟Eclipse , 按 Help > Install New Software
2.按右上方的Add 安鈕 增加以下  Repository  地址 :
https://dl-ssl.google.com/android/eclipse/
3. 按確定後選取 Developer Tools
4. 安裝完成後重啟Eclipse
5.於Windows > Preferences > Android 設定Android SDK 位置
6.設定好Android SDK 後, 按 Windows > Android SDK Manager 會出現以下視窗


7.選擇 & 安裝需要的元件

現在可以正式開始 ~