原创 使用異步任務下載--瘋狂android講義實例

package com.example.android_test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStrea

原创 使用ExpandableListActivity實現可展開的Activity

package com.example.android_test; import android.app.ExpandableListActivity; import android.os.Bundle; import android.

原创 ClipDrawable製作圖片漸進效果

建立ClipDrawable,標籤clip,並指定一張圖片 <?xml version="1.0" encoding="utf-8"?> <clip xmlns:android="http://schemas.android.com/ap

原创 創建Tab頁面,建立可切換分頁Activity

創建Tab_Layout,繼承自TabActivity package com.example.android_test; import android.app.TabActivity; import android.content.

原创 android簡單的多人聊天程序--藉助Bmob後臺數據庫

有接觸過Bmob的同學可以參考下~ 思路:程序每隔5s向服務器請求刷新一次數據,將刷新結果顯示在TextView上。 佈局文件: <?xml version="1.0" encoding="utf-8"?> <LinearLayout

原创 Android 從網上下載圖片並顯示到ListView上

首先我們要準備好圖片的數據,就是一些網站上圖片的地址 拿到之後就可以直接來寫了 package com.example.androidnet; import java.io.File; import java.io.FileOut

原创 使用Bitmap遍歷Assets目錄下圖片

佈局文件: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

原创 android 自定義View繪製計時器

package com.example.drawView; import java.text.DecimalFormat; import java.util.Timer; import java.util.TimerTask; im

原创 ScrollView嵌套ListView只顯示一行

http://www.cnblogs.com/zhwl/p/3333585.html

原创 url.openStream()和url.openConnection().getInputStream()兩者區別

http://blog.csdn.net/ewili/article/details/8799693 下面是url.openStream()的源碼: public final InputStream openStream() throws

原创 使用資源

樣式資源: <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android">

原创 下載好自動安裝

private void installApk(File file) { Intent intent=new Intent(); intent.setAction("android.intent.action.VIEW");

原创 android打開相冊選取圖片或打開相機拍照並進行裁剪

首先是打開本地相冊選取圖片: Intent albumIntent = new Intent(Intent.ACTION_PICK);//打開系統的相冊 albumIntent.setType("image/*");

原创 解決android調用系統相機拍照保存時onActivityResult中data爲null的問題

調用系統相機照相的代碼: boolean isNull=false;//判斷照相機返回數據是否爲空 Intent getImageByCamera = new Intent("android.media.action.IMAG

原创 使用PopupWindow由下向上彈出自定義窗口

final View view = getLayoutInflater().inflate(R.layout.pop_dialog, null); PopupWindow pop = new PopupWindow(view, ViewG