Time of Update: 2018-12-05
一. 簡單一實例srcpackage cn.android.lyj;import android.app.Activity;import android.app.Dialog;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import
Time of Update: 2018-12-05
http://blog.csdn.net/hustspy1990/article/details/6725298 這個屬性用於控制控制項的大小,當LinearLayout布局是垂直布局的時候,它就控制高度的大小;當LinearLayout布局是水平布局的時候,它就控制寬度的大小。<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/ap
Time of Update: 2018-12-05
在寫 AndroidManifest.xml 的時候,到底什麼時候要給 Activity 添加android.intent.category.DEFAULT 過濾器呢? Android treats all implicit intents passed to startActivity() as if they contained at least one category: "android.intent.category.DEFAULT" (the CATEGORY_DEFAULT
Time of Update: 2018-12-05
Android 2.0.1 SDK是在2.0版本上做了小幅改進,主要加入了Bluetooth支援,API Level為6。 主要的API改變: 1.移除了ACTION_CONFIGURATION_CHANGED動作的過濾在androidmanifest.xml檔案,如果應用程式需要捕獲,需要在程式啟動時使用 registerReceiver(BroadcastReceiver, IntentFilter).方法來註冊; 2. 改變了ACTION_REQUEST_ENABLE 和 ACTION_
Time of Update: 2018-12-05
這個是查看網上的資料及android sdk 開發範例書上的例子之後做出來的,基本上是粘過來的,只是添加了幾句代碼。下面是代碼: public static String uploadBitmap1(String urlString,byte[] imageBytes){String endString = "/r/n";String twoHyphen = "--";String boundary = "*****";try {URL url = new
Time of Update: 2018-12-05
經過兩天努力 終於成功移植FFMPEG0.7.6到 ADNROID中 下面是在移植過程遇到的問題 ,歡迎轉載 請註明出處tools: ffmpeg-0.7.6 android-ndk-r4b ubuntu 10.11路徑:root\android\android-ndk-r4b\samples\FFMPEG\jni\ffmpeg-0.7.6移植過程需要注意幾點 : 1 :修改libavutil/libm.h中靜態方法 前面的static全部去掉 2:修改ffmpeg-0.7.6中./
Time of Update: 2018-12-05
public enum Config { // these native values must match up with the enum in SkBitmap.h ALPHA_8 (2), RGB_565 (4), ARGB_4444 (5), ARGB_8888 (6); Config(int ni) { this.nativeInt = ni;
Time of Update: 2018-12-05
ExpandableListView是android中可以實現下拉list的一個控制項,具體的實現方法如下:首先:在layout的xml檔案中定義一個ExpandableListView <LinearLayout android:id="@+id/linearLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" androidrientati
Time of Update: 2018-12-05
方法一: Canvas類用來實現繪製.通過組合使用Canvas類的成員函數可以實現隨心隨欲地繪製圖片的任何部分.Canvas.clipRect:設定顯示地區 Canvas.drawBitmap:繪製例子:Bitmap b=BitmapFactory.decodeStream("圖片編號", null);//讀取圖片...Canvas c = null;//執行個體Canvasc.save();//記錄原來的canvas狀態c.clipRect(100,100,200,300);//顯示從(100
Time of Update: 2018-12-05
sqlite3: 一個SQLite資料庫的命令列介面 原文地址:http://www.sqlite.org/sqlite.html SQLite庫包含一個名字叫做sqlite3的命令列,它可以讓使用者手工輸入並執行面向SQLite資料庫的SQL命令。本文檔提供一個樣使用sqlite3的簡要說明。 開始 啟動sqlite3程式,僅僅需要敲入帶有SQLite資料庫名字的"sqlite3"命令即可。如果檔案不存在,則建立一個新的(資料庫)檔案。然後
Time of Update: 2018-12-05
在利用android訪問本機伺服器是需要設定許可權:<uses-permission android:name="android.permission.INTERNET"></uses-permission>其他許可權為:我學習的過程中總結了一些經常涉及到的許可權,供樓主參考一下:添加WiFi以及訪問網路的許可權: <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"
Time of Update: 2018-12-05
onFinishInflate() 當View中所有的子控制項 均被映射成xml後觸發onMeasure(int, int) 確定所有子項目的大小onLayout(boolean, int, int, int, int) 當View分配所有的子項目的大小和位置時觸發onSizeChanged(int, int, int, int) 當view的大小發生變化時觸發onDraw(Canvas) view渲染內容的細節onKeyDown(int, KeyEvent) 有按鍵按下後觸發onKeyUp(
Time of Update: 2018-12-05
package com.dialog;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.DialogInterface;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import
Time of Update: 2018-12-05
上一篇我們用了MyLocationOverlay,他會依照Wi-Fi或是GPS的定位資訊自行更新。但如果是我們自己想要監聽這些資訊,就必須利用LocationManager了。但首先我們必須要求使用者啟用相關功能才可以。 下面的程式碼是判斷使用者是否啟用了GPS定位,若是沒啟用,詢問是否需要開啟,使用者若選擇確定,則開啟設定介面:LocationManager locationManager = (LocationManager)
Time of Update: 2018-12-05
在.net裡System.Text.Encoding.Default.GetBytes(strdata)漢字,假名都是佔兩個位元組。 但是在android裡,originalChar.getBytes().length UFT-8編碼格式下,漢字和假名都是佔三個位元組。下面列出各編碼格式下字元的位元組數:英文字母:A位元組數:1;編碼:GB2312位元組數:1;編碼:GBK位元組數:1;編碼:GB18030位元組數:1;編碼:ISO-8859-1位元組數:1;編碼:UTF-8位元組數:4;編碼:
Time of Update: 2018-12-05
一些小問題,不大!但是足夠讓你花上一天或者一個禮拜的時間去解決!原創文章:轉載請註明作者:geolo。和文章出處:http://itmanito.com/geolo/?p=381.Android中的ListView無法點擊事件
Time of Update: 2018-12-05
昨天看了一下progressbar,今天總結一下。ProgressBar這個類在/froyo/frameworks/base/core/java/android/widget/ProgressBar.java當你去new一個ProgressBar的時候需要傳進去參數,我們從這裡看一下它執行的流程。本篇的主要意圖還是告訴你如何修改style去改變樣式,如果你想diy自己的ProgressBar,相信對作移植的朋友有所協助。ProgressBar.java public
Time of Update: 2018-12-05
剛接觸Android,一切就緒之後,點運行卻出現:[2010-09-29 11:02:37 - UIandroid] res/layout/main.out.xml:0: Originally defined here.[2010-09-29 11:02:37 - UIandroid] E:/android/UIandroid/res/layout/main.out.xml:1: error: Error parsing XML: no element found[2010-09-29 11:0
Time of Update: 2018-12-05
http://www.javaeye.com/topic/465371在main.xml或者自己定義的*.xml檔案中建立一個TabHost,需要兩個元素TabWidget和FrameLayout 通常會把這兩個元素放到LinearLayout中。FrameLayout作為改變內容content用的。注意:TabWidget和FrameLayout
Time of Update: 2018-12-05
本文轉自:http://blog.sina.com.cn/s/blog_569a151b0100nmym.html 一、預習Makefile二、Android編譯系統的層次三、Android編譯系統的常用設定檔四、 Android編譯系統的流程五、Android編譯系統的使用 一、預習Makefile Makefile的規則: target... : prerequisites