Skip to main content

· One min read

在 Android 1.5 版發佈之後,我們就可以用官方文件中教的方法來定義不同語系的資源文件,並根據語言設定,在使用者螢幕上顯示出對應的語言。在此之前,我們可以在 onCreate 中加入下面的程式片段,來測試不同語系的介面:

 Resources res = getResources();
Configuration conf = res.getConfiguration();
conf.locale = Locale.TRADITIONAL_CHINESE;
DisplayMetrics dm = res.getDisplayMetrics();
res.updateConfiguration(conf, dm);

這段程式碼還可以搭配 Preference 設定,讓使用者在程式中自己選擇想要的語系。

update: 要針對不同語系做處理時,可以直接判斷

if (conf.locale == Locale.TRADITIONAL_CHINESE)

· One min read

Just got my Dev Phone 1 and tried to run Jythonroid on it.

The procedure is

1. download sourcecode

$ svn co -r 51 http://jythonroid.googlecode.com/svn/branches/Jythonroid

2. import project into eclipse

3. connect Dev Phone and computer with USB

4. setup eclipse debug setting to run jythonroid in real Dev Phone

Now I got jythonroid installed in Dev Phone. Here's how to play with jythonroid:

1. Install Terminal Emulator to use the shell

2. just follow the screenshot to say 'Hello Android!' :)

in java we import Toast widget with

import android.widget.Toast;In jython(roid), just type in interpreter:

from android.widget import ToastPython rocks!

· 2 min read

Android Market 本身尚未提供網頁版本,只能透過實機來查看應用程式的下載與評論狀況。這對於還沒有拿到實機的開發者來說相當不方便。

還好現在網路上已經出現了一些解決方法:

cyrket 提供了 Android Market 的網頁介面版本。可以透過 cyrket 來查看最近的使用者評論。

要得知最熱門應用程式,可以參考 aTrackDog 網站提供的排行榜。

想看各個應用程式的下載總數排行,則可以參考 Android Market Place Rankings (均不提供詳細下載數目)。

PS:下載數可以從側面顯示應用程式的普及率。但是應用程式的排行最理想的參考數值,則應該是使用者下載之後仍然保留在機器中繼續使用的數目(即 Active Install 數目)。

· One min read

Keep in mind the screen size of 480 x 320 pixels and use that as a motivation to focus the user interface on the essentials. You don't have the room to include design elements that aren't absolutely necessary, and crowding user interface elements makes your application unattractive and difficult to use. 螢幕就只有 480x320 這麼點大,促使我們必須盡量合理地利用每吋的空間。 在設計時我們不該在螢幕上放置不必要元素。 擁擠的螢幕配置讓我們的程式變得難用而不吸引人。 -- iphone Human Interface Guidelines