Time of Update: 2018-12-04
剛才經過自己的測試,找到了可以開啟另外個程式的方法,現在分享給大家: Intent intent = new Intent(Intent.ACTION_MAIN);ComponentName com = new
Time of Update: 2018-12-04
android系統的照相功能,已實現2種方法,可供大家參考:1.調用系統網路攝影機來拍照首先,找到AndroidManifest.xml檔案裡加入使用者權限<uses-permission android:name="android.permission.CAMERA"></uses-permission> <uses-feature android:name="android.hardware.camera" /> <uses-feature
Time of Update: 2018-12-04
範例說明 “如何在和機上繪製2D圖形呢?”這是許多android遊戲開發都是常提到的問題,在android SDK 當中,並沒有Java Graphics2D的函數可以使用,而是使用android.graphics底下的類來繪製2D向量圖。這個package提供了許多在手機上繪製圖形的類與方法,其中Canvas上,而Paint(Android.graphics.Paint)類則像是彩色鉛筆,給予不同的調協,即可繪製不同顏色、不同種類效果的向量圖形。
Time of Update: 2018-12-04
怎麼知道手機使用了多少流量呢,android2.2之後為我們提供了TrafficStats這個類,可以用來解決這個問題。下面和大家分享一下代碼:package com.zyb.flow;import android.app.Activity;import android.net.TrafficStats;import android.os.Bundle;public class MainActivity extends Activity { /** Called when the
Time of Update: 2018-12-04
Time of Update: 2018-12-04
下面和大家分享一個實際工作中經常使用的TabWidget標籤分頁技術,先看一下效果: 下面和大家分享一下實現代碼:MainActivity.javapackage com.zyb.tab;import android.app.TabActivity;import android.content.Intent;import android.os.Bundle;import android.widget.TabHost;import
Time of Update: 2018-12-04
下面和大家分享一下android中的自動連結,也就是android系統會自動識別我們文本中的網址,電話號碼,郵箱地址,當我們點擊的時候會自動開啟瀏覽器,自動啟動撥號程式,自動開啟發送郵件的程式。下面先看效果。這麼神奇的效果是怎麼實現的呢?下面請看代碼:package com.zyb.link;import android.app.Activity;import android.os.Bundle;import android.text.util.Linkify;import
Time of Update: 2018-12-04
Make UDC & Android ADB Gadget driver work1. Open the config menu, enable USB Gadget support and choose PXA27x UDC driver support and Android ADB Gadget driver support. Ifyou don't have PXA27x item appeared in the menu, copy pxa27x_udc.c
Time of Update: 2018-12-04
修改 frameworks/base/core/res/res/values/config.xml <!-- Component name of the service providing network location support. --> <string
Time of Update: 2018-12-04
問題:編譯了Android源碼,然後用模擬器載入源碼編譯出來的system.img,在模擬器主菜單上看不見soundrecorder應用,但是在Application Management裡可以看見。 解決方案:這是由於SoundRecorder預設並不在Lancher的category中。如果想讓SoundRecorder在主菜單上顯示出來,需要修改AndroidManifest.xml,把SoundRecorder添加到Lancher的category中。添加如下紅色部分:
Time of Update: 2018-12-04
用圖片工具編輯好想要的png之後,儲存為logo.png在logo.png所在命令下執行命令:使用ImageMagick內建的convert命令,進行raw格式轉換convert -depth 8 logo.png rgb:logo.raw android內建的rgb2565工具,對raw檔案進行rle565格式轉換$(SRC_HOME)/out/host/linux-x86/bin/rgb2565 -rle
Time of Update: 2018-12-04
Android recovery update script Generate update script: make-update-script out/target/product/generic/system/ out/target/product/generic/android-info.txt > update-script Commands: /* assert <boolexpr> */ /* format <root> *//*
Time of Update: 2018-12-04
Android裡有兩個類android.view.GestureDetectorandroid.view.GestureDetector.SimpleOnGestureListener1) 建立一個類繼承SimpleOnGestureListener,HahaGestureDetectorListener ,可以實現以下event事件。boolean onDoubleTap(MotionEvent e)解釋:雙擊的第二下Touch down時觸發boolean
Time of Update: 2018-12-04
1. Get the bash source:$ wget -c http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz$ tar zxvf bash-4.1.tar.gz 2. Download the ARM Toolkit , e.g. Sourcery G++ Lite 2008q1-126 for ARM GNU/Linux $ wget -c
Time of Update: 2018-12-04
android 中intent是經常要用到的。不管是頁面牽轉,還是傳遞資料,或是調用外部程式,系統功能都要用到intent。在做了一些intent的例子之後,整理了一下intent,希望對大家有用。由於intent內容太多,不可能真的寫全,難免會有遺落,以後我會隨時更新。如果你們有疑問或新的intent內容,希望交流。 ★intent大全: 1.從google搜尋內容 Intent intent = new Intent();
Time of Update: 2018-12-04
Android中Tweened animation Android提供兩種建立簡單動畫的機制:tweened animation 和 frame-by-frame animation.tweened animation:通過對情境裡的對象不斷做映像變換(平移、縮放、旋轉)產生動畫效果 frame-by-frame animation:順序播放事先做好的映像,跟電影類似
Time of Update: 2018-12-04
在android中,經常用到的定時器主要有以下幾種實現:一、採用Handler與線程的sleep(long )方法二、採用Handler的postDelayed(Runnable, long) 方法三、採用Handler與timer及TimerTask結合的方法。下面逐一介紹:一、採用Handle與線程的sleep(long
Time of Update: 2018-12-04
我們建好一個android 的項目後,預設的res下面 有layout、values、drawable等目錄這些都是程式預設的資源檔目錄,如果要實現多語言版本的話,我們就要添加要實現語言的對應的資源檔。首先我們點擊添加Android Xml File按鈕,會出現下面的介面: 輸入檔案名稱:string.xml,選中Values單選框,並把下面左列表中的Region添加到左邊的列表裡面,並在Region輸入框裡輸入cn,如
Time of Update: 2018-12-04
1.解壓Android SKD 2.執行如上目錄下的檔案:SDK Setup.exe,(機器人表徵圖的那個) 注意:一般的話會出現 Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml,所以應該修改如下幾個地方: a)修改Available Packages,點擊"add Site..",增加:
Time of Update: 2018-12-04
Gallery組件主要用於橫向顯示映像列表,不過按常規做法。Gallery組件只能有限地顯示指定的映像。也就是說,如果為Gallery組件指定了10張映像,那麼當Gallery組件顯示到第10張時,就不會再繼續顯示了。這雖然在大多數時候沒有什麼關係,但在某些情況下,我們希望映像顯示到最後一張時再重第1張開始顯示,也就是迴圈顯示。要實現這種風格的Gallery組件,就需要對Gallery的Adapter對象進行一番改進。 Gallery組件的傳統用法 在實現可迴圈顯示映像的Gallery組件之