Time of Update: 2013-12-11
————————下面是翻譯—————————我是分割線————————— 多解析度支援 在設計之初,Android系統就被設計為一個可以在多種不同解析度的裝置上啟動並執行作業
Time of Update: 2013-12-11
android會把簡訊信心儲存在資料庫中,可查看/dbdata/databases/com.android.providers.telephony/mmssms.db。但是我們不能直接存取資料庫,只能通過ContentProvider來訪問它。 以下是訪問簡訊資料庫的uri
Time of Update: 2013-12-11
[size=medium][/size]有時候Android內建的控制項無法滿足我們的某些要求,這時就需要我們自訂控制項來實現這些功能。比如需要一個TextView裡的字傾斜一定的角度,就需要自訂TextView。下面介紹怎麼自訂TextView。首先建立一個繼承自TextView的類,取名為RotateTextView:import android.content.Context;import android.graphics.Canvas;import
Time of Update: 2013-12-11
ServiceDiscoveryServerServiceClassID_UUID = '{00001000-0000-1000-8000-00805F9B34FB}'BrowseGroupDescriptorServiceClassID_UUID = '{00001001-0000-1000-8000-00805F9B34FB}'PublicBrowseGroupServiceClass_UUID = '{00001002-0000-1000-8000-
Time of Update: 2013-12-11
Java代碼 public class Main extends Activity implements OnGestureListener, OnTouchListener { //
Time of Update: 2013-12-11
1.判斷是否支援BluetoothBluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();if(bluetoothAdapter == null) { //the device doesn't support bluetooth} else { //the device support
Time of Update: 2013-12-11
不知道大家有沒有遇到過,在聽一首歌時,我們可以隨意改變歌曲的進度,在聽完歌后可以對這首歌進行評分,在開發中,要實現這兩個功能,就要用到兩個控制項,分別是SeekBar和RatingBar。下面我將這兩個控制項簡單的用法進行詳細說明。首先先看下運行效果: 下來我們看看布局檔案的設計:main.xml: 1 <?xml version="1.0" encoding="utf-8"?> 2
Time of Update: 2013-12-11
1) 安裝 Help->SoftWare Updates and Add-ons->Available software-> Add Site : http://download.eclipse.org/mat/1.0/update-site/2) 產生.hprof檔案adb shellchmod 777 /data/misc (預設的HProf (Heap Profile) 放在/data/misc,需要改寫入權限為777
Time of Update: 2013-12-11
背景SurfaceView是遊戲開發中經常使用到的View,能夠即時的更新UI介面,實現遊戲邏輯。在這裡的討論中,我設定了一個GameActivity , 在這個activity的布局中,放置了一個全屏的GameSurfaceView。GameActivity雖然是遊戲的主體,但遊戲的邏輯和顯示都是由GameSurfaceView負責。遊戲開始後,GameSurfaceView在新開的線程中運行,並即時的更新遊戲介面。當遊戲邏輯結束時,需要結束掉activity,以使得activity
Time of Update: 2013-12-11
RadioButton 類結構圖: RadioButton很好理解就是我們做Web開發裡的選項按鈕,需要注意的是我們在做Web開發需要將選項按鈕的名字設定成一樣,在這裡Android開發,我們需要將兩個或者更多的RadioButton放在一個RadioGroup裡 實戰演練:1、如何設定RadioButton的對齊:通過android:orientation其值有:vertical、horizontal垂直:<RadioGroup
Time of Update: 2013-12-11
android中的組件可謂應有盡有,從簡單的Button到複雜的WebView,無所不能,無所不有。本案例通過一個註冊介面儘可能多的為大家展示一些控制項的使用。本案例涉及的控制項有:TextView、EditText、RadioButton、Button、ToggleButton、CheckBox、Spinner等。本案例整體的布局結構如: MainActivity.java中main.xml的代碼如下:<?xml version="1.0"
Time of Update: 2013-12-11
下面來看看音量設定相關的介面。*****************************************源碼************************************************* //Test case 1: setStereoVolume() with max volume returns SUCCESS @LargeTest public void
Time of Update: 2013-12-11
1. ramdisk.img檔案gzip壓縮檔, 所以要用gunzip命令解壓縮. 但是gunzip需要預設尾碼名.gz才可以正常解壓, 不然會被忽略對待.(源檔案類型) ramdisk.img: gzip compressed data, from Unix 2. 解壓後名字會自動去掉.gz尾碼,並重新命名為ramdisk.img, 這時候檔案類型為ramdisk.img: ASCII cpio archive (SVR4 with no CRC) 3.
Time of Update: 2013-12-11
Android提供完全的對SQLite資料庫的支援。你在應用程式中建立的任何資料庫,應用程式中的任何類都可以通過名稱來訪問。推薦建立SQLite資料庫的方法是建立一個SQLiteOpenHelper類的子類,並重寫onCreate()方法,在這個方法中你可以執行SQLite命令來建立資料庫中的表。 例如: public class DictionaryOpenHelper extends SQLiteOpenHelper { &
Time of Update: 2013-12-11
Activity 生命週期 顯式 Intent 調用 1 //建立一個顯式的 Intent 對象(方法一:在建構函式中指定) 2 Intent intent = new Intent(Intent_Demo1.this, Intent_Demo1_Result1.class); 3
Time of Update: 2013-12-11
Android模擬器內容是用OpenGL渲染的,所以用一般的編程(如PrintWindow()等)會是黑屏。這是因為畫的東西放在framebuffer裡。 一種方法是通過adb把guest的framebuffer資料/dev/graphics/fb0倒到host,再轉為圖片。但這樣速度比較慢。 好在Android模擬器中把guest的framebuffer傳到host進行顯示,所以在host端只要將framebuffer輸出到檔案即可。 首先定義每次framebuf
Time of Update: 2013-12-11
[java] <span style="background-color: rgb(243, 248, 251); font-family: simsun;">使用者定位介紹:</span> User Location的作用:1.擷取使用者的位置2.追蹤使用者的移動 User Location的關鍵API1.Location Manager:用於管理Android的使用者定位服務2.Location
Time of Update: 2013-12-11
首先內部儲存路徑為/data/data/youPackageName/,下面講解的各路徑都是基於你自己的應用的內部儲存路徑下。所有內部儲存中儲存的檔案在使用者卸載應用的時候會被刪除。 一、 files1. Context.getFilesDir(),該方法返回/data/data/youPackageName/files的File對象。2.
Time of Update: 2013-12-10
MainActivity.java[java]package com.example.test; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.os.Bundle; import android.app.Activity;
Time of Update: 2013-12-10
As shown in previous lessons, location updates are received in the form of latitude and longitude coordinates. While this format is useful for calculating distance or displaying a pushpin on a map, the decimal numbers make no sense to most end users.