Time of Update: 2018-12-03
ListView的SimpleAdapter有很好的擴充性,可以定義各種不同的布局,可以放片、Button、CheckBox等等,本文實現一個帶有前後表徵圖的列表視圖: 列表中item的組成:(R.id.img_pre)( R.id.text )(R.id.img) 首先定義用來顯示列表中item的layout檔案list_item2.xml:<?xml version="1.0"
Time of Update: 2018-12-03
主要將如何UI設計器設計TableLayout + TableRow,由於實際應用中,經常需要在代碼裡往TableLayout添加資料(9宮圖也可以用TableLayout做出來),本文就是介紹這方面的簡單使用方法<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation=
Time of Update: 2018-12-03
tomcat6.0 伺服器2、android虛擬器下載檔案如下載伺服器上檔案: 測試.MP3下載路徑:http://112.240.110.232:8080/MP3player/流星雨.mp3解決辦法:1.先在設定伺服器編碼:找到Tomcat安裝目錄下的server.xml檔案(Tomcat
Time of Update: 2018-12-03
1。普通的Menu 先來看看最簡單的Menu怎樣實現。 在主Activity中覆蓋onCreateOptionsMenu(Menu menu)方法。@Overridepublic boolean onCreateOptionsMenu(Menu menu) {// TODO Auto-generated method stub// menu.add(0,1,1,R.string.exit);// menu.add(0,2,2,R.string.about);
Time of Update: 2018-12-03
<1>簡介一個在平面上可顯示多個條目的可滾動的視圖組件,該組件中的條目通過一個ListAdapter和該組件進行關聯。比如實現九宮格圖,用GridView是首選,也是最簡單的。<2>XML屬性屬性:android:columnWidth 設定列的寬度。關聯的方法為:setColumnWidth(int)android:gravity
Time of Update: 2018-12-03
<1>簡介android中有一種expandablelistview,可以擴充的listview,就是那種點擊一下可以擴充出子項,再點一下收縮回去的顯示list。一個視圖顯示項目的垂直滾動的兩級列表。這不同於ListView,允許有兩級列表。分組能單獨地被擴充出到顯出它的子項目。各子項目來自ExpandableListAdapter相關的View。<2>重要方法 expandGroup(int groupPos) :在分組列表視圖中展開一組,
Time of Update: 2018-12-03
//呼叫瀏覽器Uri uri = Uri.parse("");Intent it = new Intent(Intent.ACTION_VIEW,uri);startActivity(it);//顯示某個座標在地圖上Uri uri = Uri.parse("geo:38.899533,-77.036476");Intent it = new Intent(Intent.Action_VIEW,uri);startActivity(it);//顯示路徑Uri uri =
Time of Update: 2018-12-03
MediaRecorder生命週期<1>簡介使用 MediaRecorder 類進行媒體採樣,包括音頻和視頻。MediaRecorder 作為狀態機器運行。您需要設定不同的參數,比如源裝置和格式。設定後,可執行任何時間長度的錄製,直到使用者停止。<2>MediaRecorder
Time of Update: 2018-12-03
在使用自訂布局時經常會碰見這樣的問題:edit = (EditText) findViewById(R.id.edit);並不能擷取到控制項對象;在後面代碼中使用edit時會報錯,null 指標異常。意思是edit 為null。解決方案:LayoutInflater factory = LayoutInflater.from(MyDialogActivity.this);final View view = factory.inflate(R.layout.dialog, null);edit
Time of Update: 2018-12-03
HandWritingActivity.javapackage xiaosi.handWriting;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import
Time of Update: 2018-12-03
日期:2010-11-22文章類型:原創作者:Ethan.zhao轉帖請聲明出處。前言:加密解密的鬥爭自從有軟體以來就從來沒有停止過,也將繼續延續下去。當然,Android Apk應用也不能例外。下面,我們將對Android平台的Apk加密解密進行探討。本系列旨在利用加密解密的思想探討Android
Time of Update: 2018-12-03
原文來自:http://hualang.iteye.com/blog/1059428今天做一個東西的時候,用PS做了幾個圖片,但是更改了尾碼,於是出現了錯誤:錯誤描述:一開始是eclipse上的項目處出現錯誤,但是找檔案夾裡卻沒有一點錯誤,但在控制帶確輸出了大量的如下的紅色錯誤資訊[2011-05-26 12:44:51 - ImageViewTest] libpng error: Not a PNG file[2011-05-26 12:44:51 - ImageViewTest]
Time of Update: 2018-12-03
Android應用中有時為了實現某些特殊的功能或效果,往往需要使用一些Google隱藏的API(加有@hide標記的public類、方法或常量),例如PolicyManager。 使用Android隱藏的API主要有兩種辦法:1.利用Java反射機制,使用反射的方法得到隱藏API;2.使用源碼編譯時間產生的全編譯過的classes.jar包。 舉例說明,下面的代碼如果直接使用會報錯。 mWindowManager =
Time of Update: 2018-12-03
原圖 代碼:package com.color;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import
Time of Update: 2018-12-03
開發一個在手機案頭上顯示的外掛程式需要3個步驟: 1. 繼承AppWidgetProvider 2. 編寫widget的介面xml, 編寫mywidget屬性xml 3. AndroidManifest.xml 註冊外掛程式 以自增的數字為例。 1. 繼承AppWidgetProvider public class MyWidgetProvider extends AppWidgetProvider {
Time of Update: 2018-12-03
Android中不支援layout的xml 直接使用TTF等自訂字型
Time of Update: 2018-12-03
gallery: 圖片填充的方法與Spinner類似,也是使用setAdapter()方法。但是這個使用的是自訂的Adapter,並且這個Adapter要繼承於BaseAdapter。Gallery定義與資料填充及監聽事件: Gallery g = (Gallery) findViewById(R.id.mygallery); /* 添加一ImageAdapter並設定給Gallery對象 */ g.setAdapter(new ImageAdapter(this));
Time of Update: 2018-12-03
最近正在android上使用RChart畫曲線圖,由於資料要動態更新,所以要設定更新的時間間隔。摸索了很長時間,今天終於可以了。引用的assets都是RChart demo例子中的東西,我只是修改了重新整理時間。RChart demo在我的資源裡,關於動態顯示資料,大家要記得在Listener裡面添加時間的語句,例如:ChartAndroidImage.assets=getAssets(); chartPanel = new
Time of Update: 2018-12-03
第四章
Time of Update: 2018-12-03
第七章