Time of Update: 2013-12-10
本文 [DESCRIPTION]如何修改為出廠時區為指定的時區和預設的日期?[Solution]時間資訊預設資訊都是0, 在rtc 初試化時候設定的.由於RTC 基本上不會斷電,所以它的初試化只做一次,即使重新download bin 檔.用FlashTool 執行Format, 再執行download (不要用format -->download button),
Time of Update: 2013-12-10
首先是主要代碼 的實現 ,去調用 各個xml 設定檔:MainActivity: public class MainActivity extends Activity {private ImageView imageView;@Overrideprotected void onCreate(Bundle savedInstanceState)
Time of Update: 2013-12-10
–Bitmap代表這一張位元影像,BitmapDrawable裡封裝的圖片就是一個Bitmap對象。如果要將Bitmap對象封裝成BitmapDrawable對象只需要用構造方法即可。//講bitmap對象封裝成BitmapDrawable對象BitmapDrawable drawable = new BitmapDrawable(bitmap);//將BitmapDrawable對象轉換為bitmapBitmap bitmap =
Time of Update: 2013-12-10
package cn.testshortcut;import java.util.List;import android.net.Uri;import android.os.Bundle;import android.text.TextUtils;import android.app.Activity;import android.content.Context;import android.content.Intent;import
Time of Update: 2013-12-10
1.sharedpreference,儲存簡單的資訊,比如使用者名稱,密碼package com.google.datastore.sharep;import android.app.Activity;import android.content.Context;import android.content.SharedPreferences;import android.os.Bundle;import android.view.View;import
Time of Update: 2013-12-10
代碼如下: Bitmap bitmap = mWebView.getFavicon(); Drawable drawable = new BitmapDrawable(bitmap); // edit.setCompoundDrawables(drawable, null, null, null); drawable =
Time of Update: 2013-12-10
//在按鈕點擊事件裡處理 bt_search.setOnClickListener(new OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub&
Time of Update: 2013-12-10
在看Oplayer的時候看見滑動字母來實現listView的內容搜尋,所以就把裡面的核心的函數扣除來做了一個demo,分為兩部分一個是布局,另一個就是代碼了,具體的如下: 布局: [html] <?xml version="1.0" encoding="utf-8"?> <LinearLayout
Time of Update: 2013-12-10
android2.3提供的json解析類 android的json解析部分都在包org.json下,主要有以下幾個類: JSONObject:可以看作是一個json對象,這是系統中有關JSON定義的基本單元,其包含一對兒(Key/Value)數值。它對外部(External: 應用toString()方法輸出的數值)調用的響應體現為一個標準的字串(例如:{"JSON": "Hello, World"
Time of Update: 2013-12-10
添加案頭捷徑,非常簡單,只需三步: 1、建立一個添加捷徑的Intent,該Intent的Action為com.android.launcher.action.INSTALL_SHORTCUT。 2、通過為該Intent添加Extra屬性來設定捷徑的標題、表徵圖及捷徑對應啟動的程式。 3、調用sendBroadcast()方法發送廣播即可添加捷徑。 下面用一個簡單樣本來示範,在該應用程式中,只給出了添加案頭捷徑的內容,程式的具體應用無須給出,第一次安裝該程式
Time of Update: 2013-12-10
首先得Activity必須實現OnGestureListener介面,該介面提供了關於手勢操作的一些方法,onDown方法:onDown是,一旦觸控螢幕按下,就馬上產生onDown事件public boolean onDown(MotionEvent e) {return false;}onFling方法:當手在螢幕上滑動但手未離開螢幕時觸發MotionEvent e1 手開始觸碰螢幕的位置的MotionEvent對象MotionEvent e2
Time of Update: 2013-12-10
1、管理Fragment要在activity中管理fragment,需要使用FragmentManager. 通過調用activity的getFragmentManager()取得它的執行個體.•可以通過FragmentManager做一些事情, 包括: 使用findFragmentById()(用於在activity
Time of Update: 2013-12-10
使用ant打包,如果指令碼都是我們自己一步一步來寫的話,是一個比較麻煩的東西。關於ant,我們詳細看下:ant支援 ant debug,ant release等命令,我們需要簽名混淆,那麼就需要ant release這個命令。首先:ant環境搭建,這我就不多說了,很多部落格都有介紹,包括一些環境配置然後:ant環境可以之後,我們需要一個 build.xml檔案,這個是ant編譯去找的一個東西 <?xml version="1.0"
Time of Update: 2013-12-10
動畫不能離開聲音,充分利用各種媒體表現形式,提升軟體的使用者提驗和操作體驗,對於軟體的推廣,具有十分重要的意義。android中播放聲音常用的有兩種,java也有自己的聲音處理。這裡只是簡單的使用android的方法。一種是MediaPlayer, 一種是SoundPool,兩種方法,一種可以播入連續不斷的背景音,一種只能播斷促的爆炸聲,按鍵音之類。一般來說,SoundPool能實現的,都可以使用MediaPlayer來替換實現,但MediaPlayer需要更多的記憶體和處理器,佔用的系統資源比
Time of Update: 2013-12-10
基礎android的飛機類遊戲,與前人一樣,由surfaceView繪製遊戲畫面,另起線程式控制制繪製時間間隔達到動態效果。這裡附上最近自己寫的敵機自動飛行路徑代碼。請大家給點意見。
Time of Update: 2013-12-10
Android從3.0(API Level 11)開始,在繪製View的時候支援硬體加速,充分利用GPU的特性,使得繪製更加平滑,但是會多消耗一些記憶體。 開啟或關閉硬體加速: 由於硬體加速自身並非完美無缺,所以Android提供選項來開啟或者關閉硬體加速,預設是關閉。可以在4個層級上開啟或者關閉硬體加速:
Time of Update: 2013-12-10
在做一個小練習的時候,又遇到了Adapter,才發現以前沒有對它進行過記錄現在介紹一下:其實Adapter就是資料和視圖之間的橋樑,資料在adapter中做處理,然後顯示到ListView上面Adapter有很多種,有ArrayAdapter<T>, BaseAdapter, CursorAdapter, HeaderViewListAdapter, ListAdapter,ResourceCursorAdapter, SimpleAdapter,
Time of Update: 2013-12-10
Intent是什麼呢?來看Android官網上的定義:An intent is an abstractdescription of an operation to be performed. It can be used with startActivity tolaunch an Activity, broadcastIntent tosend it to any interestedBroadcastReceiver components,and startService(Intent)
Time of Update: 2013-12-10
我是直接在Ubuntu 12.10 64位系統下操作的,搭建Ubuntu開發環境類似,見Ubuntu 10.04開發環境配置。需要注意的是,64位的系統,需要安裝支援32位的庫(sudo apt-get install ia32-libs),不然編譯時間提示找不到交叉編譯鏈。1.安裝javauestc@uestc-ThinkPad-T43:~/tools$ lsjdk1.6.0_24 jdk-6u24-linux-i586.binuestc@uestc-ThinkPad-T43:~/
Time of Update: 2013-12-10
今天看了一個Android的Training生命週期轉換的例子,頓覺得他的設計非常巧妙,我的分析如下: 1.在com.example.android.lifecycle包中有: