Time of Update: 2016-05-31
Android 在內部儲存讀寫檔案,android讀寫檔案讀寫操作* Ram記憶體:運行記憶體,相當於電腦的記憶體* Rom記憶體:內部儲存空間,相當於電腦的硬碟* sd卡:外部儲存空間,相當於電腦的移動硬碟在內部儲存空間中讀寫檔案>小案例:使用者輸入帳號密碼,勾選“記住帳號密碼”,點擊登入按鈕,登入的同時持久化儲存帳號和密碼。介面如下:1. 定義布局代碼如下:<LinearLayout
Time of Update: 2016-05-31
WebView輸入框提示,webview輸入框做基於WebView應用時,頁面上有一個輸入框,當輸入的文字過多時,超過輸入框的行數時,輸入框能夠滾動,這時間問題來了,輸入的提示箭頭會移動到輸入框外,如何解決這個問題呢,尋找chromium源碼如下: void LoadIfNecessary(jobject context) { if (loaded_) return; loaded_ =
Time of Update: 2016-05-31
[實踐] Android5.1.1源碼,android5.1.1源碼前言本文的方法要修改Android源碼。但只要將系統服務寫出來,也可以注入system_server進程將系統服務載入到system_server中。步驟1. 添加一個aidl檔案,我將aidl檔案添加到這個路徑下:frameworks/base/core/java/android/content/bw/IBWService.aidl,IBWService.aidl是我的aidl檔案。下面是一個例子: 2.
Time of Update: 2016-05-31
Android經典完美退出方法,android經典退出Android經典完美退出方法,使用單例模式建立一個Activity管理對象,該對象中有一個Activity容器(具體實現自己處理,使用LinkedList等)專門負責儲存新開啟的每一個Activity,並且容易理解、易於操作,非常不錯!AppUtils類(儲存每一個Activity,並實現關閉所有Activity的操作)/* * To change this template, choose Tools | Templates *
Time of Update: 2016-05-31
安卓android sharepreference資料存放區,儲存輸入框裡面的資料,sharepreference儲存Fragment 裡面 使用輕量級的資料存放區sharepreference ,代碼思路清晰。儲存輸入框裡面的資料,實現按鈕儲存。個人項目中簡單清晰代碼:趙存檔 編寫 ,可以參考:類繼承Fragment實現點擊事件: public View onCreateView(LayoutInflater inflater, ViewGroup container,
Time of Update: 2016-05-31
Activity往另外一個Activity傳值,Fragment擷取另外一個Activity裡面的值。,activityfragment 在oneActivity中實現跳轉到MainActivity
Time of Update: 2016-05-30
Android junit單元測試,androidjunit軟體測試的分類* 黑箱測試* 測試邏輯業務* 白盒測試* 測試邏輯方法根據測試粒度* 方法測試:function test* 單元測試:unit test* 整合測試:integration test* 系統測試:system test根據測試暴力程度* 煙霧測試 (Smoke Test):smoke test* 壓力測試:pressure
Time of Update: 2016-05-28
ActivityUI線程和Timer的衝突,activityuitimer建立了一個音樂播放器,在實現seekbar時用到了Timer和TimerTask:在OnDestory中我登出了播放器,但沒有管Timer,所以當程式退出後Timer還在執行,程式出現了這樣的錯誤:因為在OnDestory中我已經登出了MediaPlayer,但Timer啟動並執行過程中調用MediaPlayer.getCurrentPosition(),所以程式出現了錯誤。所以在OnDestory中加上timer.can
Time of Update: 2016-05-31
Android—基於GifView顯示gif動態圖片,android中顯示gif動態圖片用到了開源架構GifView1.拷GifView.jar到自己的項目中。2.將自己的gif圖片拷貝到drawable檔案夾3.在xml檔案中設定基本屬性:<com.ant.liao.GifView android:id="@+id/gifView" android:layout_centerInParent="true"
Time of Update: 2016-05-28
在Mac OS X下安裝Android Studio,osandroid在Mac OS X下安裝Android Studio只需要幾步。1. 下載Android Studio安裝包(.dmg)。2. 開啟Terminal輸入java -version命令查看是否已安裝JDK(1.8版本及以上),如果未安裝就去http://www.oracle.com/technetwork/java/javase/downloads/index.html下載安裝。3. 雙擊Android
Time of Update: 2016-05-27
Chapter 5. The Gradle Wrapper 關於gradle wrapper,gradlewrapperMost tools require installation on your computer before you can use them. If the installation is easy, you may think that’s fine. But it can be an unnecessary burden on the users of
Time of Update: 2016-05-28
gridview安卓實現單行多列橫向滾動,gridview安卓 <GridLayout android:layout_width="match_parent" android:layout_height="match_parent" android:columnCount="1" > <HorizontalScrollView
Time of Update: 2016-05-30
android 切換fragment的兩種方式,androidfragment使用add方法切換時:載入Fragment1Fragment1 onCreateFragment1 onCreateViewFragment1 onStartFragment1 onResume用以下代碼切到Fragment2: FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.hide(Fragment1);
Time of Update: 2016-05-28
VS 2015 update2 裝xamarin後,編輯axml檔案無智能提示的解決方案。,xamarinaxml1、從github網上下載xsd檔案。地址:https://github.com/atsushieno/monodroid-schema-gen;2、如果你是以ie或edge瀏覽器下載的,一定要又鍵這個壓縮包,看屬性,,如果有紅框內的屬性,一定要選上解鎖,否則vs因安全性無法開啟從這個解壓出來的檔案。3、解壓這個壓縮包。從中拷貝兩個檔案 android-layout-xml.xsd,
Time of Update: 2016-05-29
安卓虛擬機器adb shell sqlite3資料庫,安卓sqlite3 adb shell 串連: //http://www.cnblogs.com/xiaobo-Linux/ Android把資料都存放在data/data目錄下。我們使用cd命令轉到data/data目錄下:cd
Time of Update: 2016-05-28
android學習筆記----JNI中的c控制java,android----jni物件導向的底層實現 java作為物件導向進階語言,可對現實世界進行建模。和面向過程不同的是物件導向軟體的編寫不是流程的堆積,而是對商務邏輯的多視角分解和分類。其過程大致為: 1)、將知識分解成不同粒度的小概念。 &
Time of Update: 2016-05-27
Android按鈕的四種點擊事件,android按鈕四種本文記錄一下按鈕的四種點擊事件第一種public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
Time of Update: 2016-05-27
android bitmap和資料流的互轉,androidbitmapBitmap aa = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);InputStream input = datastream(aa);//把bitmap轉換為流Bitmap bitmap = transformation(input);//把流轉換為bitmap public InputStream datastream
Time of Update: 2016-05-27
Android 表徵圖尺寸與設計,android表徵圖尺寸範例和圖解外框:整體大小 ↑ 邊框:表徵圖留白大小 ↓表徵圖:外表徵圖的大小 ↑ 陰影:陰影特效大小 ↓圖形:內表徵圖的大小 ↑ 可選視圖權重:使用兩種類型的圖形尺寸可以達到統一的視覺權重(可選), 一般是針對表徵圖有凸出的情況,會有一個內部會有一個更小的尺寸大小
Time of Update: 2016-05-27
Android實戰--簡訊發送器,android簡訊發送首先設計介面<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android: