Time of Update: 2018-12-04
1.將Launcher2項目匯入eclipse中。這時候Launcher2工程已經匯入到eclipse中了,不過這時候會有100多個錯誤.2.添加Launcher2使用的包檔案。由於在Android源碼中,很多方法、成員、類、包都被打上@hide標籤,這些成員在SDK中沒有公開,以至於在編譯Launcher源碼時最常遇到的類android.view.View的成員mScrollX無法訪問。因此首先需要下載Android的代碼並且編譯好,因為要用到一些編譯完成的class.jar檔案這裡我們用到的
Time of Update: 2018-12-04
Service是android 系統中的一種組件,它跟Activity的層級差不多,但是他不能自己運行,只能後台運行,並且可以和其他組件進行互動。Service的啟動有兩種方式:context.startService()和context.bindService()。 使用context.startService() 啟動Service是會會經曆:context.startService() ->onCreate()- >onStart()->Service
Time of Update: 2018-12-04
開啟命令列終端Terminal, 進行第一次系統更新並安裝開發必要的軟體包shawn@e014-anle-lnx:~$ sudo su# apt-get install aptitude# aptitude update# aptitude full-upgrade## aptitude -y install sysv-rc-conf subversion subversion-tools python-svn git-core git-svn binutils binutils-dev
Time of Update: 2018-12-04
String fileName = "/sdcard/TestB.apk"; Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file://" +new File(fileName)),"application/vnd.android.package-archive"); startActivity(intent); 1、安裝apkString
Time of Update: 2018-12-04
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" >
Time of Update: 2018-12-04
今天在遇到一個非常需求的一個問題,需要在listview上面的headview 加上一個可以滾動切換圖片的畫面接著就開始使用 scorller and VelocityTracker 實現,但是在滑動headview的時候,出現了情況 是:scorller 滑動時候,touch down 和touch move 都執行成功了,但是不見touch up訊息回來所以就感覺到很奇怪,開始認為是listview
Time of Update: 2018-12-04
顯示兩個進度的原因是因為螢幕適應解析度的問題解決方案是:首先需要在AndroidMinifest。xml中配置 <supports-screens android:largeScreens="true" android:smallScreens="true" android:normalScreens="true" android:anyDensity="true" android:xlargeScreens=
Time of Update: 2018-12-04
<activity>元素的launchMode屬性可以設定四種不同的載入模式:"standard" (預設值) "singleTop" "singleTask"
Time of Update: 2018-12-04
//////////////////////////////////1.drawable-(hdpi,mdpi,ldpi)的區別dpi是“dot per inch”的縮寫,每英吋像素數。四種密度分類: ldpi (low), mdpi (medium),hdpi (high), and xhdpi (extra high)一般情況下的普通螢幕:ldpi是120,mdpi是160,hdpi是240,xhdpi是320。2.WVGA,HVGA,QVGA的區別VGA是"Video Graphics
Time of Update: 2018-12-04
Google於北京時間5月20日晚上10:30點在舊金山Moscone會展中心舉辦Google I/O2010大會第二天的會議,Google正式發布了代號是“froyo 凍優酪乳”的Android作業系統2.2版(高清圖集)。下面是Android 2.2版本的改進和提升: 1.速度提升 Google介紹Android2.2時,將速度放在了第一位。Google在2.2中加入了Just-In-Time(JIT),可以使程式運行速度提高2-5倍。示範運行在2.1下的Nexus One遊戲幀數為29
Time of Update: 2018-12-04
/*** 將字串轉成16 位MD5值* * @param string* @return*/public static String MD5(String string) {byte[] hash;try {hash = MessageDigest.getInstance("MD5").digest(string.getBytes("UTF-8"));} catch (NoSuchAlgorithmException e) {e.printStackTrace();return null;}
Time of Update: 2018-12-04
l Permission inmanifest: <uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/> l Save web Page tosdcard: //get file name String fileName =
Time of Update: 2018-12-04
1.在res下建一個raw的檔案夾,用於放置html檔案。2.在raw下建立一個html檔案:mypage.html<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><HTML><HEAD><TITLE>Actuate Viewer</TITLE></HEAD><BODY>
Time of Update: 2018-12-04
1. ADB SHELL2. cd 到database目錄:3. sqlite3 databaseName.db;4. .tables;5. selecte * from tableName;# lslslibcachedatabasesshared_prefs# cd databasescd databases# lslswebviewCache.dbwebview.dbyb_database.db# cd yb_databasecd yb_databasecd: can't cd to
Time of Update: 2018-12-04
通過CMD 命令列建立android自訂模擬器1.先cd到android SDK 的tools目錄下, 2.輸入以下命令:android create avd -n myandroid1.5 -t 2其中: myandroid1.5為模擬器的名字,可以任意取, -t 2 中的2指建立android1.5 的AVD 裝置,如1表示1.1, 6表示android 2.1等等。 3.在輸入以上命令後,系統會輸出如下資訊來詢問是否繼續自訂avd裝置:Android 1.5 is a basic
Time of Update: 2018-12-04
1.定義callback類:public abstract class AppCallback { public abstract void startCallback();}2.在觸發callback函數的地方定義:private static AppCallback mClearAll = null;並且定義註冊和移除callback的方法:public static void registerCallback(AppCallback callback, int callBackId)
Time of Update: 2018-12-04
F1/PgUp Menu key 菜單鍵 F2/PgDown Star key 星號鍵 F3 Call key 發送撥號鍵 F4 End Call key 結束通話或者說紅鍵 Home Home key Home鍵 ESC Back Key 後退鍵 F7 Power button 電源鍵 F8 Disable/Enable all
Time of Update: 2018-12-04
http://blog.sina.com.cn/s/blog_5edb01e90101dwh7.html方法一: 在 AndroidMainfest.xml中選擇哪個activity,設定windowSoftInputMode屬性為 adjustUnspecified|stateHidden < activity android:name=".Main" android:label="@string/app_name"
Time of Update: 2018-12-04
http://www.eifr.com/article.php?id=1464奇怪問題 startActivityForResult() 後直接調用 onActivityResult() 開發人員都知道,可以通過使用 startActivityForResult() 和 onActivityResult() 方法來傳遞或接收參數。然而在“輕聽”項目中,還沒等到被調用的 Activity 返回,onActivityResult() 就被執行了。找了很久,終於通過小道訊息得知,這與
Time of Update: 2018-12-04
http://hi.baidu.com/theonlyking/blog/item/58dcc61373a98ac8f7039ebc.html現在Android發展的如火如荼,但是它的一些程式還是需要調用到C的代碼,這期間的銜接(JAVA與C之間)就叫做JNI。不熟悉JNI的可以先百度一下,另外,還需要NDK的一個開發環境,我用的是NDK5。話不多說,開始:建立一個Android工程,之後,在裡面建立一個類,裡面只需要包含一個native方法即可,例:package