Time of Update: 2018-12-05
以前剛開始接觸android時對諸如簡訊攔截之類的功能高度興趣,網上很多文章都介紹了使用廣播接收android.provider.Telephony.SMS_RECEIVED的動作,從而接收到SMS資訊,不過當時也不知道怎麼樣把這個廣播刪掉,從而實現一個類似簡訊黑名單的功能。後來在網上看到可以使用abortBroadcast來屏蔽廣播,我測試了一下,可行。先上源碼:AndroidManifest.xml的代碼:<?xml version="1.0"
Time of Update: 2018-12-05
android 中Parcel 的使用,他是一個儲存基礎資料型別 (Elementary Data Type)和引用資料類型的容器,在andorid 中通過IBinder來綁定資料在進程間傳遞資料。Parcel parcel = Parcel.obtain();// 擷取一個Parcel 對象下面就可以對其進行方法進行操作了,createXXX(),wirteXXX(),readXXX(),其中dataPosition(),返回當前Parcel 當前Object Storage
Time of Update: 2018-12-05
通知用於在狀態列顯示訊息,訊息到來時以表徵圖方式表示,如下:如果需要查看訊息,可以拖動狀態列到螢幕下方即可查看訊息。發送訊息的代碼如下://擷取通知管理器NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);int icon = android.R.drawable.stat_notify_chat;long when =
Time of Update: 2018-12-05
1.Foreground Process: 前端的進程狀態: 正處於Activity Resume()狀態 正處於與bound服務互動狀態 正處於服務在前台啟動並執行狀態,(startForeground()被調用,例如:播放音樂) Service生命週期函數正在被執行(onCreate(),onStart(),onDestory()) BroadcastReceiver正在執行onReceive()方法 殺死Foreground
Time of Update: 2018-12-05
1.建立一個SD卡鏡像檔案開啟cmd,進入Android SDK安裝路徑下的tools目錄下,輸入如下命令: mksdcard 1024M
Time of Update: 2018-12-05
[First written by Steve Guo, please keep the mark if forwarding.] The original URL from : http://letsgoustc.spaces.live.com/blog/cns!89AD27DFB5E249BA!470.entryHere is the overall picture.There are two processes in the scenario. Mountd is a native
Time of Update: 2018-12-05
1. 編譯整個android 的souce code,在編譯之後會產生 ramdisk.img, system.img, userdata.img 三個 image 檔案。2. 解壓 ramdisk.img : mv ramdisk.img ramdisk.gz mkdir out cd out && cpio -i -F ../ramdisk.gz 3. 交叉編譯busybox, 只要需要把 tar 編譯進來。可以從
Time of Update: 2018-12-05
本文為轉貼。From : http://www.linuxgraphics.cn/android/graphics_system.html Android 圖形系統剖析作者: 本文根據參考資料1補充整理而成日期: 2009-06-04本文試圖講述Android圖形系統的底層實現。Android圖形系統底層實現非常複雜,文檔較少,沒有使用比較流行的圖形組建如X window, Cairo等。架構Android 中的圖形系統採用 Client/Server 架構。Server
Time of Update: 2018-12-05
http://www.cnblogs.com/melaniedeng/archive/2012/05/17/2506869.html 做Android應用的人都知道,要一個apk適用多個不同的手機螢幕是很容易的,就是在項目的res檔案夾下面有多套相關的資源檔。程式啟動並執行時候,Android系統會根據當前裝置的資訊去載入不同檔案夾下的資源檔。但是Android系統是怎麼做到這一點的呢?上網上搜了一下,很少有這方便的介紹,只好自己研究下代碼了。下面是我研究代碼得到的結果(正確性有待確認
Time of Update: 2018-12-05
引起crashpublic class MainActivity extends Activity {Button click2Crash; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.i("Thread0",
Time of Update: 2018-12-05
可以修改SDK 的 image 檔案,讓這些image 直接到自己編譯的image 目錄下面,這樣可以在模擬器中直接運行自己修改、編譯的image 檔案了。 在修改代碼之後,要執行 make sdk 來編譯產生新的SDK。 我使用的android 的版本是 1.6 的,故做如下修改使得模擬器所用的image 為編譯產生的image。 1. 到 android-sdk-windows/platforms/android-1.6 目錄下把 “data", "images",
Time of Update: 2018-12-05
android 在系統crash時往往UI線程會出現問題,這個時間關於介面的映像顯示往往會出現問題,總結了兩種顯示 方法,顯示Toast,或者跳轉Activity顯示ToastLooper.prepare();Toast.makeText(mContext, Message.CLOSE_FOR_UNEXPECTED_REASON, Toast.LENGTH_LONG).show();Looper.loop();關於Activity的跳轉Intent startMain = new Intent(
Time of Update: 2018-12-05
private void killProcess(Context mAct) { // TODO Auto-generated method stub Log.i(TAG, "killProcess"); String packageName = mAct.getPackageName(); String processId = ""; try { Runtime r =
Time of Update: 2018-12-05
Android 子項目列表, the list is from : http://android.git.kernel.org/ To clone one of these trees, install git, and run:git clone git://android.git.kernel.org/ + project path. To clone the entire platform, install repo, and run:mkdir mydroidcd
Time of Update: 2018-12-05
TextView 多行時,我選擇用WebView替換,寫一個Css,見代碼 Html<html><head><title>Test</title></head><body><div style="text-align:center; background-color:red;font-size:10px;color:blue"><span style="margin:0 auto;width:100px;"
Time of Update: 2018-12-05
下面的方法前提是你能獲得root許可權。我用的是小米手機, 上面的Calender程式感覺沒什麼。但是那是系統內建的程式沒辦刪除。於是我通過想到root後的命令列操作cmd #進入命令列adb remount #重寫分區命令,讓你的可讀許可權變為可寫cd /system/app/ #進入到安裝的應用檔案夾下ls -l #查看當前的檔案rm Cale* #刪除所有以Cale開頭的程式ls -l #查看當前的檔案
Time of Update: 2018-12-05
android的Face Service目前為上(4.2)只能進行人臉的識別,而不能進行人臉的對比。下面是具體代碼package com.example.facedetectdemo;import java.io.IOException;import android.app.Activity;import android.content.pm.ActivityInfo;import android.graphics.PixelFormat;import
Time of Update: 2018-12-05
1. 安裝 java 6 - sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse" - sudo apt-get update - sudo apt-get install sun-java6-jdk - sudo update-alternatives --config java 2. 安裝其他的程式包 sudo apt-get
Time of Update: 2018-12-05
public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView v= null; v.setText("abc");
Time of Update: 2018-12-05
Android 的編譯環境設定是通過 build/envsetup.sh 來完成的。 - croot: Changes directory to the top of the tree. - m: Makes from the top of the tree. - mm: Builds all of the modules in the current directory. - mmm: Builds all of the modules