Time of Update: 2018-12-04
關鍵字: 安裝apk檔案到android模擬器和android sdcard的使用安裝APK檔案到Android模擬器Android手機使用的執行檔案為APK格式,類似於Windows平台的exe檔案。在Android模擬器中安裝APK檔案有多種方法,如果你是開發人員,可以通過Eclipse+ADT,使用DDMS可以傳輸檔案。大多數可以直接在Windows的cmd中操作就可以了。一、首先在Android
Time of Update: 2018-12-04
如何分析android應用效能,java函數調用關係。 1.mksdcard -l sdcard 512M /root/.android/sdcard.img2.在應用程式中加入trace 的開始和結束函數(詳細說明參考開發文檔) // start tracing to "/sdcard/calc.trace" Debug.startMethodTracing("calc"); --------calc是你要產生的.trace檔案的名字 // .. // stop
Time of Update: 2018-12-04
我用eclipse啟動模擬器,點擊start,顯示launch options,再點擊launch,顯示starting android emulator,然後就什麼都沒了。開始還可以啟動的。檢查ADT版本為14.0.0.v201110171935-205994,sdk的版本為revision
Time of Update: 2018-12-04
首先說一下手機與電腦串連方法:家裡有無線網路由器的話,直接將手機介入無線網就可以了,如果只有手機和筆記本的話,可以開啟android的wifi熱點。設定-無線和網路-綁定與攜帶型熱點,開啟攜帶型熱點。然後用筆記本串連。筆記本自動擷取ip的話,就可以通過android上網了。wifi開發實質還是tcp,udp網路編程1,基於tcp網路編程:class Client{public static final int port=8882;private Socket s=null;private
Time of Update: 2018-12-04
哦然間發現了android.inputmethodservice.Keyboard類,即android可以自訂鍵盤類,做了一個簡單例子供大家參考,首先看看:鍵盤內容布局:keycontent.xml<?xml version="1.0" encoding="utf-8"?><Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:keyWidth="25%p"
Time of Update: 2018-12-04
android中ListView使用最為頻繁,但是同時出現錯誤也是最多的,下面就總結一下我在開發中遇到的問題,問題一:在自訂添加adapter中添加button,或是checkBox時無法同時響應setOnItemClickListener事件中的item click 事件和控制項本身點擊事件item 原布局檔案;<?xml version="1.0" encoding="utf-8"?><RelativeLayout
Time of Update: 2018-12-04
android:drawSelectorOnTop="true" 點擊某一條記錄,顏色會顯示在最上面,記錄上的文字被遮住,所以點擊文字不放,文字就看不到android:drawSelectorOnTop="false"
Time of Update: 2018-12-04
先看;詳細看代碼;package com.taskmanage.file;import java.util.ArrayList;import java.util.Collections;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.Map;import android.app.Activity;import
Time of Update: 2018-12-04
先說說原理,大家知道,android可以對資料庫進行監控。但是個人感覺這個監控不給力,無論怎麼實現監控,最後返回的結果是資料庫是否改變,沒有告訴我們資料庫的那條資料進行了改變或者是刪除,添加,並不能解決大多數需求。當初我遇到這樣的問題我也很痛苦,無論怎麼早資料都沒找到自己想要的,而網上大多數資料只是告訴你怎麼監控資料庫,但沒有告訴你怎麼擷取具體的資料改變。往往成功是逆境裡逼出來的,我去尋找英文API,發現ContactsContract.RawContacts類中VERSION欄位的說明,原文如
Time of Update: 2018-12-04
最近總結了一下Android中對圖片處理方法,具體如下:/** * 圖片反轉 * @param img * @return */public Bitmap toturn(Bitmap img){Matrix matrix = new Matrix();matrix.postRotate(90); /*翻轉90度*/int width = bitmap.getWidth();int height =bitmap.getHeight();img = Bitmap.createBitmap(img,
Time of Update: 2018-12-04
android 中定時操作需要依靠AlarmManager類來完成該功能:下面舉例分析:DateSetActivity:package com.hello.project;import java.util.Calendar;import android.app.Activity;import android.app.AlarmManager;import android.app.DatePickerDialog;import android.app.Dialog;import
Time of Update: 2018-12-04
Android調用打電話,發簡訊功能可分為直接調用和間接調用,通過設定intent屬性即可實現:直接調用,不經過使用者確認://電話 Intent intent = new Intent( Intent.ACTION_CALL, Uri.parse("tel:10086")); startActivity(intent); //簡訊String smsContent = "ye";
Time of Update: 2018-12-04
建立SysCamera類package com.recorder.video;import java.io.File;import java.text.SimpleDateFormat;import java.util.Date;import com.recoder.start.MyRecorderActivity;import com.recoder.start.R;import android.app.Activity;import
Time of Update: 2018-12-04
最近項目裡使用到了android中重力感應使用,現分享給大家。重力感應座標是相對於裝置而言,而不是空間座標,代碼如下;package com.pioneersoft.temp;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.hardware.Sensor;import
Time of Update: 2018-12-04
有時候我們可能需要將兩張後多張圖片疊加到一起使其成為一張合成圖片下面是我整理的資料,方便日後複習使用public Bitmap diejia(Bitmap b){ if(!b.isMutable()){//設定圖片為背景為透明b = b.copy(Bitmap.Config.RGB_565, true);//}Canvas canvas = new Canvas(b);Bitmap lock=BitmapFactory.decodeResource(getResources(),
Time of Update: 2018-12-04
Android 中語音朗讀比較簡單,下面是一個小例子;package com.recorder.audio;import java.util.Locale;import android.app.Activity;import android.os.Bundle;import android.speech.tts.TextToSpeech;import android.util.Log;import android.widget.Button;public class TextSpeech
Time of Update: 2018-12-04
擷取mac地址:public String getLocalMacAddress() { WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = wifi.getConnectionInfo(); return info.getMacAddress(); } 或者:private String
Time of Update: 2018-12-04
在android中為了安全性起見,對於一些系統的相關操作定義了很多許可權,比如打電話,簡訊,檔案寫入等等。為了確保應用程式安全,穩定性,我們可以自訂一些許可權機制來阻止其他應用程式對本應用程式的相關操作。下面舉個例子;在A項目的AndroidManifest.xml配置如下;<?xml version="1.0" encoding="utf-8"?><manifest
Time of Update: 2018-12-04
Android中擷取系統時間有多種方法,可分為Java中Calendar類擷取,java.util.date類實現,還有android中Time實現現總結如下:方法一;void getTime1(){ long time=System.currentTimeMillis();//long now = android.os.SystemClock.uptimeMillis(); SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-
Time of Update: 2018-12-04
總結一下,android中設定壁紙幾種方法方法一: 擷取WallpaperManager執行個體 private void set_mytheme(int resid){ WallpaperManager wallpaperManager = WallpaperManager.getInstance(this); // Resources res = getResources(); try {