Time of Update: 2018-12-03
我們可以通過AutoCompleteTextView來讓使用者在輸入時彈出建議項。import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.AutoCompleteTextView;import com.sec.android.touchwiz.samples.R;public class SearchBoxSample1Xml ext
Time of Update: 2018-12-03
import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.Spinner;import com.sec.android.touchwiz.samples.R;/** * @author yh0409.kim * spinner sample Example * * <used file List> * spinnersam
Time of Update: 2018-12-03
在2.1之前的版本中,只有一個drawable,而2.1版本中有drawable-mdpi、drawable-ldpi、drawable-hdpi三個,這三個主要是為了支援多解析度。 drawable- hdpi、drawable- mdpi、drawable-ldpi的區別: (1)drawable-hdpi裡面存放高解析度的圖片,如WVGA (480x800),FWVGA (480x854) (2)drawable-mdpi裡面存放中等解析度的圖片,如HVGA (320x480) (
Time of Update: 2018-12-03
XP 上遠程Putty+Xming使用方法 用過putty的人應該知道, putty可以執行非圖形介面的命令, 但是如果是開啟圖形介面的命令, 如firefox, 就不行了。用過xwin32或者xmanager的人應該知道,xwin32和xmanager是獨立的應用程式, 就是說單獨, 不需要其他程式即可遠端控制linux, 但是xwin32和xmanager都不是免費的, 都是收費軟體。Putty+Xming則不一樣, Xming相當於putty的一個增強圖形外掛程式先來處理ubuntu伺服器
Time of Update: 2018-12-03
取得手機螢幕大小DisplayMetrics取得畫面寬高的方法範例說明在開發手機應用程式時,除了底層對API的掌握度之外,最重要的仍是對螢幕解析度的概念,因各家手機廠商所採用的螢幕尺寸不同,user UI介面呈現及布局自然也各異。儘管Android可設定為隨著視窗大小調整縮放比例,但即便如此,手機程式設計人員還是必須知道手機螢幕的邊界,以避免縮放造成的布局(Layout)變形問題。這個範例非常的簡短,只需幾行程式即可取得手機的解析度,當中的關鍵則是DisplayMetrics類的應用。andro
Time of Update: 2018-12-03
當你設計你的程式的時候,你可以用風格和主題來統一格式化各種螢幕和UI元素。 * 風格(style)是一個包含一種或者多種格式化屬性值的集合,你可以將其用為一個單位用在布局XML單個元素當中。比如,你可以定義一種風格來定義文本的字型大小大小和顏色,然後將其用在View元素的一個特定的執行個體。 * 主題(themes)是一個包含一種或者多種格式化屬性值的集合,你可以將其為一個單位用在應用中所有的Activity當中或者應用中的某個Activity當中。比如,你可以定義一個主題,它為wi
Time of Update: 2018-12-03
LayoutInflater是用來找layout下xml布局檔案,並且執行個體化!而findViewById()是找具體View下的某個(如:Button,TextView等)【控制項已經實執行個體化了】。為了讓大家容易理解我做了一個簡單的Demo,主布局main.xml裡有一個TextView和一個Button,當點擊Button,出現 Dialog,而這個Dialog的布局方式是我們在layout目錄下定義的custom_dialog.xml檔案(裡面左右分布,左邊 ImageView,右邊
Time of Update: 2018-12-03
import java.util.ArrayList;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.util.AttributeSet;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.Vi
Time of Update: 2018-12-03
時間設定對話方塊DatePickerDialog的使用一、可以同過重載DatePickerDialog的setTitle來設定個性的標題比如: @Override public void setTitle(CharSequence title) { // TODO Auto-generated method stub java.text.DateFormat dataFormat = (DateFormat .getD
Time of Update: 2018-12-03
getView是在Adapter中申明public abstract View getView (int position, View convertView, ViewGroup parent)Since: API Level 1Get a View that displays the data at the specified position in the data set. You can either create a View manually or inflate it from
Time of Update: 2018-12-03
關於重寫View的onDraw的問題:首先裡面的座標參考點是螢幕左上方。如果幾個重寫onDraw的View一起用,只有一個View能顯示出來。第一個能顯示。後面的顯示不回來。Why?I am puzzled.import android.content.Context;import android.content.res.TypedArray;import android.graphics.Canvas;import android.graphics.Color;import android.g
Time of Update: 2018-12-03
Starting Activities and Getting ResultsThe startActivity(Intent) method is used to start a new activity, (注意是new)which will be placed at the top of the activity stack. It takes a single argument, an Intent, which describes the activity to be execute
Time of Update: 2018-12-03
關於activity 的方法onSaveInstanceState(Bundle)和onRestoreInstanceState(Bundle)). protected void onSaveInstanceState (Bundle outState) Called to retrieve per-instance state from an activity befor
Time of Update: 2018-12-03
DOM是文件物件模型(Document Object
Time of Update: 2018-12-03
原文地址:http://codingstandards.iteye.com/blog/831504 簡介type命令用來顯示指定命令的類型。一個命令的類型可以是如下之一alias 別名keyword 關鍵字,Shell保留字function 函數,Shell函數builtin 內建命令,Shell內建命令file 檔案,磁碟檔案,外部命令unfound
Time of Update: 2018-12-03
在xml 檔案裡定義控制項的屬性,我們已經習慣了android:attrs="" ,那麼我們能不能定義自己的屬效能,比如:test:attrs="" 呢?答案是肯定的.好了我就不賣關子了,直接進入主題。大致以下步驟:一、 在res/values 檔案下定義一個attrs.xml 檔案.代碼如下: <?xml version="1.0" encoding="utf-8"?> <resources> <--注意這裡只是聲明--
Time of Update: 2018-12-03
使用SoundPool放聲音在開發Android軟體中我們可能經常需播放多媒體音效檔,一般使用MediaPlayer類但該類佔用資源較多,對於遊戲等應用可能不是很適合,這裡描述下SoundPool類。SoundPool類在SDK的android.media.SoundPool,顧名思義是聲音池的意思。主要播放一些較短的聲音片段,可以從程式的資源或檔案系統載入,相對於MediaPlayer類可以做到使用較少的CPU資源和較短的反應延遲。 SoundPool和其他聲音播放類相比,其特點是可以自行設
Time of Update: 2018-12-03
本文轉載自:http://blog.csdn.net/wtz1985/article/details/301637在上一篇文章中,我已經闡述了多線程中簡單鎖的實現,可在結束的時候,我就提了那麼一個問題,那就是如果在一個鏈表中進行插入時,要進行查詢的操作,如果只是簡單的鎖,是沒法實現的。所以“遞迴鎖”就浮現於世了。可能有些人看到遞迴這兩個字,有點傻了眼,其實也沒什麼的,簡單的介紹,就是進行簡單的計數而已。剛開始引用鎖的時候,就產生它,當在鎖沒有解開的時候,還要繼續用鎖,就簡單的加一,解開一把就減一
Time of Update: 2018-12-03
android的JNI開發一種是核心級的(android源碼),一種是一般的應用程式(它被打入到APK包)。在此討論的是一般的應用程式。開發JNI應用需要的工具有Android NDK:http://developer.android.com/sdk/ndk/index.html#requirements而要運行Android NDK的命令(比如ndk-build)需要: * For all development platforms, GNU Make 3.81 or later is
Time of Update: 2018-12-03
空間、屬性、時間是地理現象的三個基本特徵,也是GIS資料庫的三種基本資料成分。這裡的“空間”指空間位置資料及其派生資料。“屬性”指與空間位置無派生關係的專題屬性資料。“時間”則指時間、空間和屬性狀態的時變資訊。隨著近年來以空間資料庫為基礎的GIS研究和應用的不斷深入,隨時間而變化的資訊越來越受到人們的關注,因而提出了時態GIS(簡稱TGIS)的概念。時態GIS的組織核心是時空資料庫,時空資料模型則是時空資料庫的基礎。但是由於空間、屬性、時間三者之間的關係和結構組織非常複雜,理想的時空資料庫和時態