Time of Update: 2018-12-05
1. 首先啟動android模擬器。2. 開啟cmd命令列視窗。 輸入 adb
Time of Update: 2018-12-05
// 放大縮小圖片public static Bitmap zoomBitmap(Bitmap bitmap, int w, int h) {int width = bitmap.getWidth();int height = bitmap.getHeight();Matrix matrix = new Matrix();float scaleWidht = ((float) w / width);float scaleHeight = ((float) h /
Time of Update: 2018-12-05
Android編譯系統的架構: 分析Android編譯系統,你會發現,Android編譯系統完成的並不僅僅是對目標(主機)系統二進位檔案、java應用程式的編譯、連結、打包等,而且還有包括產生各種依賴關係、確保某個模組的修改引起相依賴的檔案的重新編譯連結,甚至還包括目標檔案系統的產生,設定檔的產生等,因此Android編譯系統具有支援多架構(linux-x86、windows、arm等)、多語言(彙編、C、C++、Java等)、多目標、多編譯方式。這些目標和結構決定其架構也很重要。
Time of Update: 2018-12-05
這兩個方法是網上拷別人的,分別用來得到可用記憶體和記憶體總數,這樣我們就可用得到了已用記憶體數。private long getAvailMemory(Context context){// 擷取android當前可用記憶體大小ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);MemoryInfo mi = new
Time of Update: 2018-12-05
brightness(亮度)是window中的一個屬性 修改亮度需要取得window屬性方法為: WindowManager.LayoutParams layoutParams = getWindow().getAttributes(); layoutParams.screenBrightness = b;// b是亮度getWindow().setAttributes(layoutParams); b是一個浮點數 從0~1
Time of Update: 2018-12-05
ScrollView01.java: package com.ScrollView01;import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.view.KeyEvent;import android.view.View;import android.widget.Button;import android.widget.LinearLayout;import
Time of Update: 2018-12-05
Android 中壁紙管理主要由 WallpaperManager 這個類負責 Provides access to the system wallpaper. With WallpaperManager, you can getthe current wallpaper, get the desired dimensions for the wallpaper, set thewallpaper, and more. Get an instance of WallpaperManager
Time of Update: 2018-12-05
DatePicker01.java: package com.DatePicker01;import java.util.Calendar;import android.app.Activity;import android.app.DatePickerDialog;import android.app.TimePickerDialog;import android.os.Bundle;import android.view.View;import
Time of Update: 2018-12-05
原文地址:http://www.cmath.net/read.php?tid=57在開始讀這篇文章之間,介意你先閱讀Android開發入門(四)之介面Activity。Activity之間的跳轉分為兩種一種是顯示的,另一種是隱式跳轉,推介使用隱式跳轉,不過本文兩種都會講解。在Android開發入門(四)之介面Activity中源碼中已包含了顯式跳轉。首先在Android開發入門(四)之介面Activity中已有一個Activity,這裡需在再建一個Activity。第一步:在項目中res/lay
Time of Update: 2018-12-05
首先,設定要覆蓋在最上方的dialog的view<?xml version="1.0" encoding="utf-8"?><RelativeLayout android:background="@drawable/navigater_bg" android:padding="0.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://
Time of Update: 2018-12-05
Chronometr是一個簡單的定時器,你可以給它一個開始時間,並以此定時,或者如果你不給它一個開始時間,它將會使用你的時間通話開始。預設情況下它會顯示在當前定時器的值得形式"分:秒" 或"MM:SS", 或者可以使用set(字串)的定時器值到一個任一字元串重要屬性android:format 定義時間的格式如: hh:mm:ss重要方法setBase(long base)//設定倒計時定時器setFormat(String
Time of Update: 2018-12-05
CheckBox,也就是多項選擇。Android中提供了ChechBox控制項,使用起來非常方便。CheckBox效果main.xml源碼<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
Time of Update: 2018-12-05
public class ShortcutUtil {/** * 建立捷徑 * * @param context */public static void createShortcut(Context context, Class<?> target) {// <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />Intent intent = new
Time of Update: 2018-12-05
Android 原始碼獲得過程中,repo sync經常失敗的解決辦法: 主要參見:http://www.tonypig.net/?p=9998 ,感謝作者; 1. 修改repo 將REPO_URL中的git:修改為http:2. 在你要下載原始碼的目錄(這裡是 Android_SOURCE) 中,運行指令碼:repo init -u http://android.git.kernel.org/platform/manifest.git -b
Time of Update: 2018-12-05
編譯ANDROID系統的基本順序如下, 初始化 使用envsetup.sh指令碼來初始化環境。$ source build/envsetup.sh或者$ . build/envsetup.sh選擇編譯目標 使用lunch命令來選擇編譯目標。確切的配置可以作為參數傳進去,如:$ lunch full-eng上面的例子是一個針對emulator的完整的編譯,包括所有的調試資訊都是使能的。如果不帶參數運行lunch,將會提示選擇編譯目標。所有的編譯目標使用BUILD-BUILDTYPE的格式來指定,
Time of Update: 2018-12-05
【問題】在官方下的android SDK的安裝包,運行時,出現:Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: HTTPS SSL error. You might want to force download through HTTP in the settings. 【解決方案】在安裝的頁面中,修改代理配置:1. Settings裡Http Proxy
Time of Update: 2018-12-05
覺得字串可能長短不一,不能完全顯示,老大說讓做成滾動效果那種,本來以為很難,不過萬能的baidu告訴我不難,如下而已:TextView加三行屬性android:singleLine="true"android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" ps:下面這個layout我驗證過,可以滾動的<?xml
Time of Update: 2018-12-05
首先我要非常感謝原文的作者 TipzTV ,在模擬器上安裝 google market
Time of Update: 2018-12-05
效果比5月份那份代碼和諧了一點,但仍有待改進,現在我將代碼發上來。 完整項目可以去http://simdanfeg.download.csdn.net/處下載(1)Activity類package sim.feel;import java.io.IOException;import java.io.InputStream;import android.app.Activity;import android.content.res.AssetManager;import
Time of Update: 2018-12-05
1. java中對多線程存取控制可使用關鍵字synchronized 下面將以Producer Consumer模型介紹android中線程同步的使用。步驟:建立一android project,修改main activity如下:代碼:package com.test.thread;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class MultiThread