Time of Update: 2018-12-05
很多開發人員都是從j2me或j2ee上過來的,對於記憶體的使用和理解並不是很到位,Android開發網本次給大家一些架構上的指導,防止出現豆腐渣工程的出現。Android作為以Java語言為主的智能平台對於我們開發一些高效能和品質的軟體來說瞭解Android程式記憶體管理機制是必須的。 Android的Dalvik
Time of Update: 2018-12-05
IPC架構分析 Binder,Service,Service manager
Time of Update: 2018-12-05
Android電話系統之概述篇
Time of Update: 2018-12-05
今天學習Menu控制項比較簡單,直接上代碼了。首先是布局檔案:<?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"
Time of Update: 2018-12-05
原文地址:http://developer.android.com/training/advanced.htmlAdvanced Training contains a variety of classes that teach you best practices in Android development. These classes simplify the steps required to enhance your app with powerful platform
Time of Update: 2018-12-05
I continued to look into Android's new Overscroll functionality introduced in Gingerbread and discovered some more interesting things. The functionality to make a a view scroll beyond its limits and then bounce back (almost exactly like iOS) is
Time of Update: 2018-12-05
安卓系統檔案夾結構詳解核system\\app這個裡面主要存放的是常規下載的應用程式,可以看到都是以APK格式結尾的檔案。在這個檔案夾下的程式為系統預設的組件,自己安裝的軟體將不會出現在這裡,而是\\data\\檔案夾中。下面是詳細的介紹:\\system\\app\\AlarmClock.apk 鬧鐘 \\system\\app\\AlarmClock.odex\\system\\app\\Browser.apk
Time of Update: 2018-12-05
ExpandableListView顧名思義既是可擴充的ListView,我們可用來實現菜單設定之類的功能。前些時間做項目用到了,現在給大家分享一下 ExpandableListView的實現方式。先上:展開後:布局檔案如下:<?xml version="1.0" encoding="utf-8"?><LinearLayout
Time of Update: 2018-12-05
Java中的SoftReference即對象的軟引用。如果一個對象具有軟引用,記憶體空間足夠,記憶體回收行程就不會回收它;如果記憶體空間不足了,就會回收這些對象的記憶體。只要記憶體回收行程沒有回收它,該對象就可以被程式使用。軟引用可用來實現記憶體敏感的快取。使用軟引用能防止記憶體泄露,增強程式的健壯性。 SoftReference的特點是它的一個執行個體儲存對一個Java對象的軟引用,該軟引用的存在不妨礙垃圾收集線程對該Java對象的回收。也就是說,一旦SoftReference儲存了對一個
Time of Update: 2018-12-05
private ArrayList<ContactBean> getAllContacts() { ArrayList<ContactBean> arrayList = new ArrayList<ContactBean>(); phoneMap = new HashMap<String, Boolean>(); //擷取本機連絡人 Cursor cur =
Time of Update: 2018-12-05
我們知道很多軟體都有設定功能表項目如墨跡天氣等的設定介面。當設定裡有很多選項這時我們可以選擇使用ListView實現。布局檔案如下:<?xml version="1.0" encoding="utf-8"?><LinearLayout
Time of Update: 2018-12-05
通常我們需要在使用者的螢幕上展示更多的資訊,但是使用者的螢幕大小是有限的,那麼我們如何利用有限的空間來展示更多的資訊呢?Android為我們提供了SlidingDrawer類,協助我們輕鬆實現想要的效果。諸如在墨跡天氣中的墨跡推薦,360安全衛士中都有所體現。下面我們就來學習SlidingDrawer類,實現上述效果::未展開時:展開後:下面看代碼:首先是布局檔案:<?xml version="1.0" encoding="utf-8"?><LinearLayout
Time of Update: 2018-12-05
2.3SDK的兩個新特點:1.剛安裝上2.3時,查看sdk目錄,發現在<SDK_PATH>\tools下新增了一檔案夾“proguard”,如,我就在想是不是Google終於官方對proguard考慮進去了。理論上,對java的混淆都是可以的,但關鍵在於如何編寫proguard的混淆指令碼。 2.使用SDK2.3後,建立的工程下和之前相比,都會多了一個檔案“proguard.cfg”。一開啟,相當驚喜,這就是混淆所需的proguard指令碼啊。如: 其代碼如下:view
Time of Update: 2018-12-05
Android的Wifi,預設情況下是不接受組播的,見:http://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html預設情況下,應用是不接收組播資訊的,這樣要接收處理的報文太多,很快就會把電池用盡。要知道行動裝置(特指電話一類的,平板要好得多)目前最重要的因素是電量。要想開啟組播功能,有以下幾個步驟:在Manifest檔案中加入:android.permission.CHANGE_WI
Time of Update: 2018-12-05
1. 淡入淡出效果overridePendingTransition(R.anim.fade, R.anim.hold);2. 放大淡出效果overridePendingTransition(R.anim.my_scale_action,R.anim.my_alpha_action);3. 轉動淡出效果overridePendingTransition(R.anim.scale_rotate,R.anim.my_alpha_action);4.
Time of Update: 2018-12-05
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" >
Time of Update: 2018-12-05
SharedPreferences是Android平台上一個輕量級的儲存類,主要是儲存一些常用的配置比如視窗狀態,一般在Activity中 重載視窗狀態onSaveInstanceState儲存一般使用SharedPreferences完成,它提供了Android平台常規的Long長 整形、Int整形、String字串型的儲存,它是什麼樣的處理方式呢?SharedPreferences類似過去Windows系統上的ini設定檔,但是它分為多種許可權,可以全域共用訪問,android123提示最
Time of Update: 2018-12-05
//main.xml如下:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" >
Time of Update: 2018-12-05
1 布局<ScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" > <TextView android:id="@+id/result" android:layout_width="fill_parent" android:layout_height="wrap_content"
Time of Update: 2018-12-05
//服務和訪問者在同一進程,所以叫本地服務//訪問者:package cn.com.localquery;import cn.com.service.ILocalQuery;import cn.com.service.LocalQueryService;import android.app.Activity;import android.content.ComponentName;import android.content.Intent;import