Time of Update: 2018-12-05
在模擬器上給gallery放入圖片的時候,出現java.lang.OutOfMemoryError: bitmap size exceeds VM budget 異常,映像大小超過了RAM記憶體。 模擬器RAM比較小,只有8M記憶體,當我放入的大量的圖片(每個100多K左右),就出現上面的原因。由於每張圖片先前是壓縮的情況。放入到Bitmap的時候,大小會變大,導致超出RAM記憶體,具體解決辦法如下://解決載入圖片 記憶體溢出的問題
Time of Update: 2018-12-05
a reference to another resource, in the form "@[+][package:]type:name" to a theme attribute in the form "?[package:][type:]name" 例: <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text1"
Time of Update: 2018-12-05
如需轉載,請註明出處!薑江 linuxemacs@gmail.com 因項目原因需要構建一個基於MIPS晶片的GDB,這裡簡單記錄一下構建過程以備以後使用。 一、目標 1. 運信在MIPS晶片上的gdbserver 2. 運行在MIPS晶片上的gdb 3. 運行在x86晶片上的gdb 二、所需要環境1. 工具鏈 從CodeSourcery上下載用於MIPS晶片的工具鏈。第一次嘗試構建時,下載的是CodeSourcery G++
Time of Update: 2018-12-05
Button button1 = (Button) findViewById(R.id.bt);InputStream stream = null; try { stream = getAssets().open("button_compiled.9.png"); } catch (IOException e1) { e1.printStackTrace(); }Bitmap bitmap = BitmapFactory.de
Time of Update: 2018-12-05
個人覺得回調就像多態一樣,比如Boss叫員工去吃飯,但每個員工可能吃不同的食物。只不過,回調是對介面而言。簡單來說就是,A對象調用了自己的方法a,方法a接收的參數是B介面的執行個體b,而在方法a中將執行介面B中的方法c。這樣解釋可能有點繞不過來,下面我們來看一個例子。比如宿舍的某個同學設定了一個鬧鈴,鬧鈴響時全宿舍的人都能聽到,但是張三比較勤奮,聽到鈴聲後起床了,李四比較懶,聽到鈴聲後還要睡會。我們可以把鬧鈴發出的鈴聲看作是介面,張三和李四都實現了這個“介面”,鬧鈴到一定時間後就要“響鈴”,響鈴
Time of Update: 2018-12-05
Linking to Your ProductsFor a link that includes the Google Play brand icon, check out the Badges page. Google Play provides several link formats that let you bring users to yourproducts in the way you want, from Android apps, web pages, ads,
Time of Update: 2018-12-05
文章目錄 GridLayout Getting StartedSizes, Margins and Alignment/Gravity FlexibilityEmulating Features from other LayoutsThe Phases of the Layout OperationConclusion 10 November 2011http://android-developers.blogspot.com/2011/1
Time of Update: 2018-12-05
ADT BundlePlatformPackageSizeMD5 ChecksumWindows 32-bitadt-bundle-windows-x86.zip425429957 bytescca97f12904774385a57d542e70a490fWindows 64-bitadt-bundle-windows-x86_64.zip425553759 bytesc51679f4517e1c3ddefa1e662bbf17f6Mac OS X 64-bitadt-bundle-mac-x8
Time of Update: 2018-12-05
1.下載image包:https://developers.google.com/android/nexus/imagesFactory Images "yakju" for Galaxy Nexus "maguro" (GSM/HSPA+)4.1.2 (JZO54K)Linkcc710f1539765c6ab7fbb8f50b69f0d692ff9457515384d598ff6e8b36e4f47ca02c447b2.解壓到目錄中3.關機4.同事按volume up ,volume
Time of Update: 2018-12-05
Getting Started with Android StudioEARLY ACCESS PREVIEWDownload Android Studio v0.1 for WindowsThis download includes:Android Studio early access previewAll the Android SDK Tools to design, test, debug, and profile your appThe latest Android
Time of Update: 2018-12-05
今天來說一下Android下如何攔截電話CallLog在Android中,電話跟簡訊一樣,也是有一套訊息(廣播)機制的,我們只需要註冊一個Receiver,接收Android電話的相關廣播就OK了,下面這段代碼是一個完整的BroadcasReceiver類,能夠監聽Android系統下打進來的電話和打出去的電話:package com.contact.main.receiver;import android.content.BroadcastReceiver; import
Time of Update: 2018-12-05
android擷取sd卡路徑方法:public String getSDPath(){File sdDir = null;boolean sdCardExist = Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED); //判斷sd卡是否存在if (sdCardExist){sdDir =
Time of Update: 2018-12-05
常規的我們可能只考慮QVGA,HVGA,WVGA,FWVGA和DVGA,但是拋去了手機不談,可能平板使用類似 WSVGA的1024x576以及WXGA的1280x768等等。 QVGA = 320 * 240; WQVGA = 320 * 480; WQVGA2 = 400 * 240; WQVGA3 = 432 * 240; HVGA = 480 * 320; VGA = 640 * 480; WVGA = 800 * 480; WVGA2 = 768 *
Time of Update: 2018-12-05
謂國際化和本地化呢?就是在資源檔夾res內建立不同國家語言的檔案,這些國家語言的檔案命名是有規定的,具體參見表6-1。當使用者佈建手機的語言時,程式能根據使用者選擇的語言情況,而載入相對應的語言檔案。使用者感受到是程式的本地化,而對於開發人員來講就是程式實現了國際化。在本例中實現了一個註冊的介面,它可以實現中文簡體和中文繁體的本地化過程,編寫的string.xml和檔案夾命名如表6-1。 表6-1 檔案命名對比表 values/strings.xml 預設
Time of Update: 2018-12-05
在Linux手機生態圈中有幾個圈子:CELF , LiMo, LiPS,OMA, OHA(Android) Android是新生力量,也是比較生猛的,Google是牽頭者。2007.11.5 Android平台推出之際,幾個圈子對Android的態度也是耐人尋味的。 LiPS認為他這個圈子的責任就是一統江湖:把各家在Linux手機各自標準統一起來。他把各家自己的一套標準稱為:Ad Hoc 的標準,即臨時標準; LiPS還拿出4款不同廠家的手機做了說明:圖中的四款手機從上往下分別為:摩托羅拉A1
Time of Update: 2018-12-05
很多人都想在activity載入完畢的同時處理一下事件,如彈出一個popWindow或者其他,但在onCreate方法中處理這個時間的話,程式會報錯:大意是activity還沒有載入完,不能處理彈窗事件,其實不光是彈窗,只要用到activity.this的事件,在activity載入完之前都不能處理,原因很明顯——popWindow或者是dialog的顯示都要依附在一個parent
Time of Update: 2018-12-05
在做android項目時,我們經常需要從本地或者網路讀取圖片,並轉換為Bitmap圖片,以便使用,下面是讀取本地圖片並轉換的方法:Java代碼 /** * 得到本地或者網路上的bitmap url - 網路或者本地圖片的絕對路徑,比如: * * A.網路路徑: url="http://blog.foreverlove.us/girl2.png" ; * * B.本地路徑:url="fil
Time of Update: 2018-12-05
上個月僅十幾天,Android手機Defy在我沒有明確使用的情況下把一個月的移動網路套餐流量50M跑光了,而且是我上班在公司時都開著Wifi的,當周未想上網時,卻收到中國移動的簡訊說流量 已不足。我當場暈倒,因為近一個月都沒有怎麼使用GPRS上網,是誰動了我的流量了呢?使用資料管理軟體查 一下,發現有幾個應用用的流量特別多:安卓市場,Andoid Market,Google
Time of Update: 2018-12-05
import Android.app.Activity;import Android.content.Intent;import Android.net.Uri;import Android.net.Uri.Builder;import java.io.File;import Android.content.Intent; //自訂Android
Time of Update: 2018-12-05
1.軟鍵盤的顯示原理 軟鍵盤其實是一個Dialog。InputMethodService為我們的IME建立了一個Dialog,並且對某些參數進行了設定,使之能夠在底部或者全螢幕顯示。當我們點擊輸入框時,系統會對當前的主視窗進行調整,以便留出相應的空間來顯示該Dialog在底部,或者全屏。歡迎來到我的部落格2.活動主視窗調整 Android定義了一個屬性windowSoftInputMode,