編輯:Android開發教程
As described in the android documentation, the SDK level (integer) the phone is running is available in:
android.os.Build.VERSION.SDK_INT;
The enum corresponding to this int is in the android.os.Build.VERSION_CODES class.
Code example:
int currentapiVersion=android.os.Build.VERSION.SDK_INT;
if(currentapiVersion >= android.os.Build.VERSION_CODES.FROYO){
// Do something
}else{
// do something
}
Note:
This SDK_INT is available since Donut (android 1.6 / API4)
so make sure your application is not retro-compatible with Cupcake (android 1.5 / API3)when you use it or your application will crash(thanks to Programmer Bruce for the precision).
====================================================================================
Build.VERSION_CODES
1 (0x00000001) Android 1.0 BASE
2 (0x00000002) Android 1.1 BASE_1_1
3 (0x00000003) Android 1.5 CUPCAKE
4 (0x00000004) Android 1.6 DONUT
5 (0x00000005) Android 2.0 ECLAIR
6 (0x00000006) Android 2.0.1 ECLAIR_0_1
7 (0x00000007) Android 2.1 ECLAIR_MR1
8 (0x00000008) Android 2.2 FROYO
9 (0x00000009) Android 2.3 GINGERBREAD
10 (0x0000000a) Android 2.3.3 GINGERBREAD_MR1
11 (0x0000000b) Android 3.0 HONEYCOMB
12 (0x0000000c) Android 3.1 HONEYCOMB_MR1
13 (0x0000000d) Android 3.2 HONEYCOMB_MR2
Build.VERSION_CODES:http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
相信每個項目都會有用戶反饋建議等功能,這個實現的方法很多,下面是我實現的方法,供大家交流。首 先看具體界面,三個字段。名字,郵箱為選填,可以為空,建議不能為空。如有需要可
Android API Demos中有很多非常Nice的例子,這些例子的代碼都寫的很出色,如果大家把API Demos中的 每個例子研究透了,那麼恭喜你已經成為一個真正的
iPhone第一個真正意義上的競爭對手G1如期而來,正如蘋果的產品一樣,這是一個強大的掌上電腦,並且擁有一個開源的操作系統,和一個智能的指觸式用戶界面。和iPhone一樣
App->Notification->Notifying Service Controller這個例子介紹了如何在Service中使用Notification