Time of Update: 2013-12-11
嘿嘿,書接上回,android有兩種設定主題到方法,一種就是通過修改manifest檔案,一種就是在通過修改我們的java代碼;主題的自訂設定和樣式的自訂設定類似。首先我們先來自定兩個主題檔案。 在res/values/style.xml添加如下代碼: <style name="MyTheme1"
Time of Update: 2013-12-11
● 首先記憶體方面,可以參考Android堆記憶體也可自己定義大小 和 最佳化Dalvik虛擬機器的堆記憶體配置 ● 基礎類型上,因為Java沒有實際的指標,在敏感運算方面還是要藉助NDK來完成。Android123提示遊戲開發人員,這點比較有意思的是Google推出NDK可能是協助遊戲開發人員,比如OpenGL ES的支援有明顯的改觀,本地代碼操作圖形介面是很必要的。 ●
Time of Update: 2013-12-11
以後打算做android自動化測試,今天發現了一個很不錯的工具,以後回去研究一下:下面是下載的地址http://code.google.com/p/robotium/downloads/list 這是配置方法:一、確保環境1.已經安裝eclipse2.Eclipse已經配置好android相關環境3.存在已經建立模擬器 二、步驟1.啟動Eclipse執行New --> Project --> Android Project --> Create
Time of Update: 2013-12-11
在Android 模擬器中可以對Android手機作業系統進行適當的修改,增加各種功能,以滿足使用者的需求。那麼今天我們會為大家帶來Android Jni的相關使用方法,以方便大家對這一系統的解讀。Android的應用程式(Dalvik VM)中使用JNI(Java Native Interface)調用C/C++開發的共用庫。 開發環境 (eclipse + Android ADT) WindowsXP
Time of Update: 2013-12-11
(一)自訂View類 import android.content.Context;import android.content.res.TypedArray;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.util.AttributeSet;import android.view.View; public
Time of Update: 2013-12-11
Robotium代碼解析:[java] /* * This is an example test project created in Eclipse to test NotePad which is a sample * project located in AndroidSDK/samples/android-11/NotePad * * * You can
Time of Update: 2013-12-11
[html] [html] package com.mrzhu.edittest; import android.app.Activity; import android.os.Bundle; import android.view.ViewGroup; import android.widget.RelativeLayout;
Time of Update: 2013-12-11
如下: 兩個類,一個繼承Activity的類,一個繼承EditText的類,一個xml檔案 繼承Activity的類: [html] import android.app.Activity; import android.os.Bundle; public class EditTestActivity extends Activity { /**
Time of Update: 2013-12-11
首先,在activity 類中(activity.java),我們可以看到兩個變數,分別是: private Window mWindow; private WindowManager mWindowManager;這兩個變數在attach函數中進行賦值, mWindow =
Time of Update: 2013-12-11
ListView這個控制項使用的非常普遍,關於它的基本介紹,我們來看一下API中的介紹:Class OverviewA view that shows items in a vertically scrolling list. The items come from the ListAdapter associated with this
Time of Update: 2013-12-11
android的捷徑比較簡單,就是發一個系統的廣播,然後為捷徑設定Intent---package com.xikang.android.slimcoach.utils;/** * @author huiych * 建立捷徑 * @created 2013-02-21 * */import android.content.Intent;import android.os.Parcelable;import
Time of Update: 2013-12-11
——————————————————————————————————&mdash
Time of Update: 2013-12-11
在Android手機的AppWidget上如何開啟一個Activity?一、onUpdate()函數中 //建立一個Intent對象 Intent intent = new Intent(context,MyActivity.class); intent.setAction(broadCastString); //設定pendingIntent的作用 PendingIntent pendingIntent = PendingIntent.
Time of Update: 2013-12-11
效果展示如下:再看布局檔案如下:[html] <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
Time of Update: 2013-12-11
原問題描述:我想在android應用中獲得以下的效果: 背景圖片我使用一個nine-patch png圖片。我用一個text view 來實現但結果出來不是這個,應該怎麼辦?解決方案:用一個TextView?難道每次換內容的話都要弄那前、後和中間的空格?[java] <RelativeLayout android:id="@+id/relativeLayout1"
Time of Update: 2013-12-11
當啟動一個Service時,他預設都是運行在主線程的,如果Service將要運行非常耗時或者可能被阻塞的操作時,應用程式將會被掛起,甚至會出現ANR錯誤。為了避免這一問題,應該在Service中重新啟動一個新的線程來進行這些操作。但有一個更好的方法那就是用IntentService
Time of Update: 2013-12-11
原問題描述:我在android應用程式中設定了通知功能。每當我接收到一個通知時,未讀通知的數量就累計。使用 notification.number 函數,代碼如下:[java] NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Notification notification =
Time of Update: 2013-12-11
android listView
Time of Update: 2013-12-11
這個是對android4.0.3增加ethernet我是直接拿過來對android4.0.4增加,過程中有些是不同的,錯誤比較容易解決這裡我就不作具體說明了。只是其中有一點需要修改的在這個地方:2. system\core\libnetutils\dhcp_utils.c的
Time of Update: 2013-12-11
1.使用dom解析xml檔案除了使用 SAX可以解析XML檔案,大家也可以使用熟悉的DOM來解析XML檔案。 DOM解析XML文 件時,會將XML檔案的所有內容以文檔樹方式存放在記憶體中,然後允許您使用DOM