Time of Update: 2018-12-06
1.使用VedioView VideoView videoView = (VideoView)findViewById(R.id.video); String src = "rtsp://v6.cache7.c.youtube.com/CjYLENy73wIaLQlSNwWysTZuKRMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoYP6mvvezrYeZTgw=/0/0/0/video.3gp";
Time of Update: 2018-12-06
參考網頁:http://www.njpro.cn/forum.php?mod=viewthread&tid=111http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcphttp://forum.xda-developers.com/showthread.php?t=1071584 方法一:利用USB連接線進行串連1.
Time of Update: 2018-12-06
使用系統內建瀏覽器可以成功播放flash,可是利用自己開發的就無法播放。代碼如下:browser = (WebView) findViewById(R.id.webview);browser.getSettings().setJavaScriptEnabled(true);browser.getSettings().setPluginsEnabled(true);browser.getSettings().setAllowFileAccess(true);browser.getSettings(
Time of Update: 2018-12-06
一種是使用ScrollView和HorizontalScrollView結合。 這種方式的話,斜向滑動會有先後次序,一般將ScrollView放在外層第二種,使用onTouchEvent方法,監聽移動事件,進行處理。 如果只是監聽移動事件,圖片可以移出指定地區之外,可以通過控制邊界來進行限制在一定範圍內移動。 簡單解決方案代碼如下: container.setOnTouchListener(new OnTouchListener() { @
Time of Update: 2018-12-06
在Android中,有對應於其它語言中的進度條,也就是我們要提到的ProgressDialog,但絕對美觀大方,可以產生一個ProgressDialog對象,設定彈出進度視窗的標題(setTitle),過程提示訊息(setMessage),再顯示(show)即可,也可直接調用ProgressDialog的showl靜態方法,直接顯示一個進度框,如果設定ProgressDialog為可以被Cancel的,則能通過手機回退鍵來中止它,否則只有通過程式內部的邏輯來中止,通過介面及鍵盤是無法
Time of Update: 2018-12-06
偶爾地,你可能想要確保你的應用程式在某一個確定的方向上面顯示,橫屏模式或豎屏模式。例如,你可能會開發一款只在橫屏模式下面啟動並執行遊戲。在這種情況下,可以通過編寫代碼,強制把Activity的方向設定為橫向,這需要使用Activity類的setRequestOrientation()方法。[java] view plaincopyimport android.content.pm.ActivityInfo; @Override public void onCreate(Bundle
Time of Update: 2018-12-06
來自XDA developer的一篇文章,作者詳細描述了如何使用gdb + ida找到Angry Birds RIO Android版中lua檔案的加密key,雖然目前還不會反向工程,不過說不定哪一天會用上,先記錄下來。 Well… I have attached a debugger to native code, set breakpoints, analyzed registers, memory, etc. It wasn’t that easy though. It took me
Time of Update: 2018-12-06
//建立建立全域變數類 1 public class MyApplication extends Application { 2 3 /** 4 * 建立全域變數 5 * 全域變數一般都比較傾向於建立一個單獨的資料類檔案,並使用static靜態變數 6 * 7 * 這裡使用了在Application中添加資料的方法實現全域變數 8 * 注意在AndroidManifest.xml中的Application節點添加android
Time of Update: 2018-12-06
//能夠取得螢幕的資訊 DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm);dm.widthPixels; //取得寬像素 dm.heightPixels; //取得高像素 //擷取當地的日曆 Calendar c=Calendar.getInstance();
Time of Update: 2018-12-06
結構繼承關係public interface IBinderandroid.os.IBinder子類及間接子類間接子類Binder一個遠程對象的基類,IBinder定義一個輕量級的遠端程序呼叫機制的核心部分。 類概述Base interface for a remotable object, the core part of a lightweight remote procedure call mechanism designed for high performance when
Time of Update: 2018-12-06
LayoutAnimationController的作用:A. 用於為一個layout裡面的控制項,或者是一個ViewGroup裡面的控制項設定動畫效果B. 每一個控制項都有相同的動畫效果C. 這些控制項的動畫效果在不用的時間顯示出來 在xml當中使用LayoutAnimationController的具體步驟:1.
Time of Update: 2018-12-06
研究官方範例無疑是快速學習任何SDK的不二法門,Android內建samples檔案夾工程的建立可以參考這裡,下面是我在調試該工程時遇到的兩個問題,示:錯誤1WARNING: Application does not specify an API level requirement!解決方案:在Mainfest.xml檔案中的<mainfest ...></mainfest>元素中添加<uses-sdk android:minSdkVersion="10"
Time of Update: 2018-12-06
直接上代碼,代碼內容上有相應的注釋。效果作簡短介紹,有一個圓形一個方形,當一隻手指觸控的時候只有圓形隨著移動;當兩隻手指觸控的時候圓形與方形各自隨著手指移動。不要忘記使用View.invalidate()對繪圖進行更新。/* import相關class */import android.app.Activity;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;i
Time of Update: 2018-12-06
首先看一下: 項目結構圖: Android
Time of Update: 2018-12-06
Select按鈕是把資料庫的內容搜尋出來並顯示在下面的列表中;Insert按鈕是把輸入框的資料插入到資料庫;Modify是當在列表中選擇到資料,然後通過輸入框進行修改後更新到資料庫;Delete按鈕是當在列表中選擇到資料後,對選擇的那條資料進行刪除。注意:Age輸入框必須輸入數字。
Time of Update: 2018-12-06
註冊感應器:使用SensorManager的registerListener(SensorEventListener listener, Sensor sensor, int rate)方法SensorEventListener 有兩個需要實現的方法:1. onAccuracyChanged(Sensor sensor, int
Time of Update: 2018-12-06
WebView 設定實現兩個手指縮放網頁:mWebView.getSettings().setSupportZoom(true);mWebView.getSettings().setBuiltInZoomControls(true); WebView cookies清理: CookieSyncManager.createInstance(this);CookieSyncManager.getInstance().startSync();CookieManager.getInstance().
Time of Update: 2018-12-06
1. 改變背景 在res/drawable下建立一個xml檔案: <?xml version="1.0" encoding="UTF-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android">//
Time of Update: 2018-12-06
轉:http://www.open-open.com/lib/view/open1347440993944.html做Android應用,不可避免的會與SQLite打交道。隨著應用的不斷升級,原有的資料庫結構可能已經不再適應新的功能,這時候,就需要對 SQLite資料庫的結構進行升級了。 SQLite提供了ALTER TABLE命令,允許使用者重新命名或添加新的欄位到已有表中,但是不能從表中刪除欄位。並且只能在表的末尾添加欄位,比如,為
Time of Update: 2018-12-06
轉自:http://blog.csdn.net/xxxsz/article/details/8199031判斷網路類型是wifi,還是3G,還是2G網路,對不同的網路進行不同的處理,現將判斷方法整理給大家,以供參考 說明:下面用到的資料移動2G,聯通2G,聯通3G,wifi我都已經測試過,暫時手上沒有電信的卡,所以沒有驗證,有電信手機的同事,可以驗證一下,驗證後將結果發送給大家。 ConnectivityManager connectMgr = (ConnectivityManager) th