Time of Update: 2013-12-10
在Android中讀取doc檔案需要用第三方jar包tm-extractors-0.4.jar,讀取的過程很簡單和普通的檔案流操作基本一樣,下面寫一個簡單的例子:package com.word.read;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import org.textmining.text.extraction.WordExtractor;import
Time of Update: 2013-12-10
Android學習整理_Service簡單應用.音樂播放器1.因為我們需要使用Service,所以我們需要在AndroidManifest.xml檔案中定義好. <service android:name=".Music" > <!-- 我們會設定一個music.java檔案來實現
Time of Update: 2013-12-10
JSON作為現在比較流行的資料交換格式,有著它的許多優點,Android的WEB應用中更是廣泛用到了它,這裡將我學習JSON的過程記錄如下在Android的Android.jar包中已經預設引入了這個包,這裡我們就可以直接調用它了JSON有五種基本類型,分別是object,array,value,string,numberObject以下面這個為例{"person":{"id":100,"address":"武漢市漢陽區&qu
Time of Update: 2013-12-10
直接給代碼吧:[html]package com.zte.android.greenweb.launcher.service; import org.json.JSONException; import org.json.JSONObject; import android.content.BroadcastReceiver; import android.content.Context; import
Time of Update: 2013-12-10
撥打到電話項目: activity_phone.xml[html] <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
Time of Update: 2013-12-10
Home鍵(小房子鍵)在鍵盤上映射的就是home鍵,這倒是很好記。Menu鍵用於開啟菜單的按鍵,在鍵盤上映射的是F2鍵,PgUp鍵同樣可以。另外,看英文原文的意思,貌似這個鍵在某些機型上會被設計為左軟體(left softkey)Start鍵這個鍵在模擬器和G1真機上我都沒有找到到底是哪個鍵。映射的是Shift+F2或PgDn,某些機型會被設計為右軟鍵(right
Time of Update: 2013-12-10
一、在assets檔案中寫一個xml檔案[html] v<?xml version="1.0" encoding="UTF-8"?> <persons> <person id="23">
Time of Update: 2013-12-10
1. 背景選取器(位於res/drawable/,使用方法:android:background=”@drawable/XXX”)<?xml version="1.0"
Time of Update: 2013-12-10
本文檔介紹了protocol buffer訊息的二進位格式。在你的應用程式中使用protocol buffers的時候,你不需要理解這些,但是對於你想知道不同的protocol buffer格式如何影響你的訊息編碼的大小是非常有用的。 一個簡單的訊息假設你有如下的一個簡單的訊息定義:message Test1 { required int32 a = 1;}
Time of Update: 2013-12-10
修改\packages\apps\Camera\res\values\arrays.xml中的以下代碼:<string-array name="pref_camera_continuous_number_entries">
Time of Update: 2013-12-10
1、建立一個Android Test Project,綁定到要測試的android項目。2、在測試專案中可以建立起與被測試的android項目一一對應的包和類結構。3、建立測試類別時注意要繼承的類是android.test.AndroidTestCase。4、測試結果的反饋可以通過調用Assert類的幾個方法把測試結果反饋在JUnit視圖中,如:Assert.assertEquals(expected, actual)可以檢驗“期望值”與“實際值”
Time of Update: 2013-12-10
聽到二分尋找,大家可能都會覺得它非常簡單,從而會自然而然地忽略它。那麼在實現這個看似簡單的演算法過程中有沒有什麼值得注意的地方呢?下面是我寫的一個二分尋找的實現int binary_search(int array[],int n,int value){ int begin = 0, end = n-1, mid = 0; bool flag =0; //判斷資料的排序方式,從小到大則為1
Time of Update: 2013-12-10
[java] Intent intent = new Intent("cn.pocketdigi.update.alarm"); intent.setClass(this, AlarmReceiver.class); PendingIntent pi=PendingIntent.getBroadcast(this, 0,
Time of Update: 2013-12-10
TextView中加入超連結的方式很多,但下面的方式應該的最簡便合理的strings.xml中定義字串<string name="blog"><a
Time of Update: 2013-12-10
[java] //音效的音量 intstreamVolume; //定義SoundPool對象 privateSoundPoolsoundPool; //定義HASH表 privateHashMapsoundPoolMap; /**********************************************
Time of Update: 2013-12-10
//儲存到SD卡 private static String sdState = Environment.getExternalStorageState(); private static String path = Environment.getExternalStorageDirectory().toString(); public static void saveBitmap(Bitmap bitmap,String imageName) { File
Time of Update: 2013-12-10
學習一門新的程式設計語言,資料類型是最基本的東西,這裡我們講述下jni中的資料類型。在JNI中把資料類型分為3類:primitive type:int float charreference type:class instances arraysstring type在
Time of Update: 2013-12-10
public class ReadBitmap { public void readByte(Context c, String name, int indexInt) { byte[] b = null; int[] intArrat = c.getResources().getIntArray(indexInt); try { AssetManager am = null; am =
Time of Update: 2013-12-10
按鍵盤的上下鍵矩形就會上下移動;通過執行個體化Handler對象並重寫handkeMessage方法實現了一個訊息接收器。然後再線程中通過sendMessage方法發送更新介面的訊息,接收器收到更新介面的訊息時便執行invalidate方法更新螢幕顯示。 package com.yarin.android.TestOnView; import android.content.Context; import android.graphics.Canvas; import
Time of Update: 2013-12-10
問題描述:在Activity中採用startActivityForResult(intent, requestCode)方式啟用AnotherActivity.當AnotherActivity執行:Intent intent=new Intent();intent.putExtra("test", "hello");setResult(RESULT_OK,