原创 08-27 GridView(點中後,圖片被矇住)、Toast(點擊後顯示提示的內容,一會兒自動消失)、Dialog(點擊後顯示對話框)

GridView(點中後,圖片被矇住<蒙板>) //**layout_gridview.xml** <RelativeLayout xmlns:android="http://schemas.android.com/apk/r

原创 08-03 網絡通信(UDP) URL XML解析器 JSON、DOM、SAX 枚舉

網絡通信(UDP) //**MySend** public class MySend { public static void main(String[] args) { try {

原创 07-30 數組

一維數組定義 int[] array1=new int[10]; Scanner scanner=new Scanner(System.in); for (int i = 0;

原创 08-01 接口 異常 文件IO流

抽象類 public abstract class Animal { public abstract void voice(); public abstract void run(); } public cla

原创 07-29 循環

水仙花數 打印100-1000水仙花數 for(int i=100;i<1000;i++){ int a=i/100; int b=(i-a*100)/10;

原创 08-02 文件IO流 網絡通信(TCP) 集合 泛型

文件寫入、讀出 public class Test { public static void main(String[] args) { File file=new File("d://s.txt");

原创 Volley

doGet方法 private void doGet() { // RequestQueue requestQueue= Volley.newRequestQueue(getApplicationCon

原创 動畫效果

Animation(淡入淡出,平移,旋轉,縮放) //動畫組合 AnimationSet animationSet=new AnimationSet(false);

原创 09-15 Camera (攝像機),SoundPool(播放提示音等小音頻),VideoView(播放視頻),SurfaceView(播放視頻),MediaRecorder(錄製音頻)

Camera(攝像機) //**activitymian.xml** LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:

原创 09-09 Service(續)、UI主線程、AsyncTask(UI主線程)

Service(續) ###IntentService 每次只執行一個服務,其餘服務等待,適合後臺耗時操作 //**MyIntentService(class文件)** public class MyIntentService ext

原创 09-10 MediaPlayer

MediaPlayer //**activity_main.xml** <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmln

原创 08-25 convertView、ViewHolder、MyfruitPractice、divider、Header

convertView、ViewHolder //convertView爲了避免重複創建id,減少了加載的時間,佔用內存比較少 //如果不用,每條數據都會生成一個view,使用兩者,如果屏幕顯示10個,生成14個左右的view,循環使

原创 08-27 GridView(點中後,圖片被矇住<蒙板>)、Toast(點擊後顯示提示的內容,一會兒自動消失)、Dialog(點擊後顯示對話框)

GridView(點中後,圖片被矇住<蒙板>) //**layout_gridview.xml** <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/a

原创 08-26 Spinner、AutoCompleteTextView、GridView、Gallery、ExpandableListView

Spinner(下拉菜單) //**layout_spinner.xml** <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

原创 08-24 CheckBox、ImageView、ArrayAdapter、SimpleAdapter、自定義Adapter

CheckBox //**layout_checkbox.xml** <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas