Time of Update: 2018-12-04
/* 從raw檔案夾中讀取檔案(在res目錄下建立的) */public String getFromRaw() { String result = ""; InputStream in = null; try {in = getResources().openRawResource(R.raw.test1);/* 從raw檔案夾中讀取檔案,不需要尾碼 */int len = in.available();byte[] msg = new
Time of Update: 2018-12-04
String[] colums = { Phone._ID, Phone.DISPLAY_NAME }; Uri contactUri = Phone.CONTENT_URI; public String getQueryData() { String result = ""; ContentResolver resolver = getContentResolver(); Cursor cursor = resolver.query(
Time of Update: 2018-12-04
package mutou.test;import android.database.sqlite.*;import android.content.Context;import android.database.sqlite.SQLiteDatabase.CursorFactory;public class MySQLiteHelper extends SQLiteOpenHelper {public MySQLiteHelper(Context context, String name,
Time of Update: 2018-12-04
package mutou.test;import android.app.Activity;import android.os.Bundle;import android.widget.EditText;import android.content.SharedPreferences;public class Sample45Activity extends Activity { EditText et; SharedPreferences sp; public
Time of Update: 2018-12-04
package mutou.test;import android.app.Activity;import android.hardware.Sensor;import android.hardware.SensorEvent;import android.hardware.SensorEventListener;import android.hardware.SensorManager;import android.os.Bundle;import
Time of Update: 2018-12-04
"創業"也有半年了, 還未成功, 今天突然心血來潮, 想將這一路,
Time of Update: 2018-12-04
【LG015.控制項篇】簡單控制項之《小人跑跑》遊戲執行個體關鍵字:LGame 入門
Time of Update: 2018-12-04
【LG014.控制項篇】簡單控制項之LPanelVS LPaper?關鍵字:LGame 入門 控制項 LPanel
Time of Update: 2018-12-04
【LGame學堂013.控制項篇】簡單控制項之LMessage關鍵字:LGame 入門 控制項
Time of Update: 2018-12-04
畢業答辯那天。 向各位敲代碼的報告一聲,我不是電腦專業的,我只是一個信管的學生。沒有過硬的技術,也沒有良好的管理知識。我選擇了技術,徹底拋棄了管理。即便如此,我也無法和專業的人相比。是的呢,我直到大三才開始會做個簡單的網站,到大四結束,我也沒有做過什麼出色的項目~ 在信管,我被謠傳地很厲害,一個無所不能的敲代碼的傢伙~就連老師也被我那認真的外表給欺騙了,很是信任我的能力~我當然開心~我非常的開心呢~嘿嘿可是吖,記得,我大二的時候參加過ACM競賽的,在校內拿了三等獎...然後就,被刷下來了,
Time of Update: 2018-12-04
【LG012.控制項篇】簡單控制項之形同虛設卻無比強大的LPaper關鍵字:LGame 入門 控制項 LPaper笨木頭花心貢獻,啥?花心?不呢,是用心~轉載請註明,原文地址:http://blog.csdn.net/musicvs/article/details/7552524LPaper的使用極其簡單,我就不多囉嗦了~好吧,還是囉嗦一下好了:LPaper paper = new LPaper(0, 0, 400, 400);前面兩個參數是座標,後面兩個參數是寬高。-LPaper到底是什麼呢?
Time of Update: 2018-12-04
【LGame學堂011】簡單控制項之解決添加控制項後控制項不顯示的問題 關鍵字:LGame 入門 控制項 -各位,不好意思,之前忘了說一個很重要的問題,也許有些朋友已經遇到這個問題了。那就是,明明建立了控制項,也調用了add函數,控制項也已經設為可見了,但控制項就是不顯示。1.我們是怎麼建立控制項的呢?當然是在構造器裡咯:public class GameScreen extends Screen { public GameScreen() {
Time of Update: 2018-12-04
1.主線程建立Handler類的對象,重寫handleMessage方法:Handler handler = new Handler(){public void handleMessage(Message msg){switch(msg.what){case 0:break;}}}; 2.主線程建立一個子線程(用Thread) 3.子線程用Handler對象建立Message對象:Message m = new
Time of Update: 2018-12-04
這章我們來看看LSelect吧~1.這個控制項可以理解為選項按鈕吧,我也只是剛接觸喇,所以也只是瞭解了表層。使用倒是挺簡單的,來看代碼吧:LSelect select = new LSelect(0, 200, 150, 220); select.setMessage("你覺得LGame好玩嗎?", new String[] {
Time of Update: 2018-12-04
主類:1.啟動Service:Intent startIntent = new Intent(主類.this, Service類.class);startService(startIntent); 2.停止Service(發送廣播資訊給Service):Intent stopIntent = new Intent();stopIntent.setAction("Service類");stopIntent.puExtra("cmd", 0);sendBroadcast(stopIntent); 3
Time of Update: 2018-12-04
package com.test.android.textview; import android.content.Context; import android.graphics.Paint; import android.util.AttributeSet; import android.widget.TextView; public class CustomTextView extends TextView { private static float DE
Time of Update: 2018-12-04
public void writeFileData(String filename, String message){FileOutputStream fs = null;try {fs = openFileOutput(filename, MODE_PRIVATE);byte[] msg = message.getBytes();fs.write(msg);} catch(FileNotFoundException e)
Time of Update: 2018-12-04
一個應用程式通常包含多個Activity,一個Activity甚至可以啟動另外一個應用程式中的Activity。儘管Activities可以來自不同的應用程式(application),但是android系統通過儲存Activities在同一個task中來維持一種無縫的使用者體驗。 task是使用者為了完成某項任務與之互動的Activities的集合,這些Activities被放到名叫“Back Stack”的堆棧中。
Time of Update: 2018-12-04
android在處理一寫圖片資源的時候,會進行一些類型的轉換,現在有空整理一下: 1、Drawable → Bitmap 的簡單方法 ((BitmapDrawable)res.getDrawable(R.drawable.youricon)).getBitmap(); 2、Drawable → Bitmap Java代碼 public static Bitmap drawableToBitmap(Drawable drawable) { Bitmap
Time of Update: 2018-12-04