![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
源码
tiankongzaiweixiao
这个作者很懒,什么都没留下…
展开
-
Volley的使用
package com.example.myvolley;import org.json.JSONObject;import android.graphics.Bitmap;import android.os.Bundle;import android.support.v4.util.LruCache;import android.support.v7.app.ActionBarAc原创 2015-03-22 22:23:05 · 400 阅读 · 0 评论 -
Menu
1.SubMenu<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_heig原创 2014-01-17 09:31:42 · 639 阅读 · 0 评论 -
Notification
1.状态栏通知package com.example.android_notification;import android.annotation.SuppressLint;import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import原创 2014-01-23 15:53:49 · 517 阅读 · 0 评论 -
Service
1.Service的第一个例子<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_原创 2014-01-20 13:44:19 · 471 阅读 · 0 评论 -
ViewPager
1.第一个ViewPager<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout原创 2014-01-15 15:46:03 · 556 阅读 · 0 评论 -
Gallery
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_par原创 2014-01-14 12:02:43 · 943 阅读 · 0 评论 -
ViewStub
1.用ViewStub实现动态加载<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="v原创 2014-01-15 16:48:57 · 493 阅读 · 0 评论 -
ListView
1.用ArrayAdapter为ListView加载数据<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"原创 2014-01-15 10:09:08 · 548 阅读 · 0 评论 -
ImageSwitcher
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_p原创 2014-01-14 16:37:16 · 501 阅读 · 0 评论 -
圆角ImageView
package com.example.ui;import android.R;import android.content.Context;import android.content.res.TypedArray;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphic原创 2014-02-07 15:12:35 · 872 阅读 · 0 评论 -
圆形ImageView且设置动态生成的image
1.继承ImageView实现CircleImageViewpackage com.example.ui;import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; im原创 2014-02-07 16:22:17 · 812 阅读 · 0 评论 -
Dom创建XML
.转载 2014-09-16 07:02:04 · 440 阅读 · 0 评论 -
屏幕万能适配
在Android开发中比较头疼的是Android的分辨率问题,那么这里给大家介绍个万能办法,这个办法的优点是可以实现万能适应,给开发和美工设计提供了依据,但是对开发来说代码量也不少,具体办法:(1)获取屏幕的尺寸[mw_shl_code=java,true]WindowManager windowManager = (WindowManager) getSystemSe转载 2014-08-24 21:17:45 · 770 阅读 · 1 评论 -
PullToRefresh使用详解
正在刷新 刷新后 一、导入Library下载源码后(https://github.com/chrisbanes/Android-PullToRefresh),里面有个Library工程,添加工程到Eclipse中;转载 2014-05-09 14:45:59 · 672 阅读 · 0 评论 -
Tabhost
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"原创 2014-04-11 16:44:14 · 545 阅读 · 0 评论 -
VideoView播放视频
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_p原创 2014-02-19 14:20:13 · 685 阅读 · 0 评论 -
获取屏幕或者控件的宽度高度
// 获取屏幕宽高(方法1)int screenWidth = getWindowManager().getDefaultDisplay().getWidth(); // 屏幕宽(像素,如:480px)int screenHeight = getWindowManager().getDefaultDisplay().getHeight(); // 屏幕高(像素,如:800p)Log.e(TA转载 2014-02-10 08:38:59 · 569 阅读 · 0 评论 -
IM里的语音录制与播放
只实现了语音录制,然后点击ImageView播放动画的同时播放语音package com.example.example03;import java.io.File;import java.io.IOException;import android.app.Activity;import android.app.AlertDialog;import android.app.Ale原创 2014-02-11 08:31:57 · 1516 阅读 · 0 评论 -
Spinner适配器为ArrayAdapter或者SimpleAdapter
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_par原创 2014-01-14 15:29:13 · 1092 阅读 · 0 评论 -
获取屏幕和组件高度宽度
// 获取屏幕宽高(方法1)int screenWidth = getWindowManager().getDefaultDisplay().getWidth(); // 屏幕宽(像素,如:480px)int screenHeight = getWindowManager().getDefaultDisplay().getHeight(); // 屏幕高(像素,如:800p)Log.e(TA转载 2014-01-14 08:27:58 · 997 阅读 · 0 评论 -
HorizontalScrollView
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="m原创 2014-01-14 09:25:08 · 515 阅读 · 0 评论 -
HttpUtils--Post
package http;import java.beans.Encoder;import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.io.Unsupported原创 2013-12-23 16:40:07 · 2773 阅读 · 0 评论 -
EditText
1.用EditText添加图片表情package com.example.android_editview01;import java.lang.reflect.Field;import java.util.Random;import android.os.Bundle;import android.app.Activity;import android.graphics.Bit原创 2014-01-09 09:54:47 · 514 阅读 · 0 评论 -
HttpUtils--httpClient
package com.my.http;import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.UnsupportedEncodingExcep原创 2013-12-24 09:55:01 · 803 阅读 · 0 评论 -
AutoCompleteTextView和MultiAutoCompleteTextView
1.AutoCompleteTextView和MultiAutoCompleteTextViewpackage com.example.android_antocompleteexpandablelist;import android.os.Bundle;import android.app.Activity;import android.view.Menu;import andro原创 2014-01-09 14:30:50 · 522 阅读 · 0 评论 -
HttpUtils--Get
package com.my.http;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.HttpURLConnection;import原创 2013-12-23 11:52:26 · 1356 阅读 · 0 评论 -
TextView
package com.example.android_textview01;import android.os.Bundle;import android.app.Activity;import android.text.Html;import android.text.method.LinkMovementMethod;import android.view.Menu;impor原创 2014-01-07 14:19:51 · 937 阅读 · 0 评论 -
AsyncTask<String, Integer, Bitmap>异步加载
package com.example.android_asynctask;import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.io.IOException;import java.io.InputStream;import org.apache.http.HttpR原创 2013-12-31 13:18:05 · 1289 阅读 · 0 评论 -
handler<1>
package com.example.android_handler;import java.io.IOException;import java.io.InputStream;import org.apache.http.HttpResponse;import org.apache.http.client.ClientProtocolException;import org.ap原创 2013-12-31 15:15:56 · 531 阅读 · 0 评论 -
SeekBar
1.用SeekBar显示刻度<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_h原创 2014-01-10 15:13:06 · 689 阅读 · 0 评论 -
Button
1.Button的各种监听package com.example.android_button;import android.os.Bundle;import android.app.Activity;import android.graphics.Color;import android.view.KeyEvent;import android.view.Menu;import原创 2014-01-10 08:34:17 · 447 阅读 · 0 评论 -
ScrollView
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_conten原创 2014-01-14 09:23:40 · 525 阅读 · 0 评论 -
AnalogClock和TimePickerDialog、DatePickerDialog
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_par原创 2014-01-13 15:22:58 · 589 阅读 · 0 评论 -
DatePicker与TimePicker
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_par原创 2014-01-13 12:19:39 · 704 阅读 · 0 评论 -
ImageView
1.用ImageView的scaleType放置图片<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" andr原创 2014-01-10 16:38:10 · 560 阅读 · 0 评论 -
Android五种数据传递方法汇总
Android开发中,在不同模块(如Activity)间经常会有各种各样的数据需要相互传递,我把常用的几种方法都收集到了一起。它们各有利弊,有各自的应用场景。我现在把它们集中到一个例子中展示,在例子中每一个按纽代表了一种实现方法。1. 利用Intent对象携带简单数据利用Intent的Extra部分来存储我们想要传递的数据,可以传送int, long,转载 2013-12-27 16:24:11 · 680 阅读 · 0 评论 -
XML解析——SAX
Myhandler.java该class负责解析package xml;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import org.xml.sax.Attributes;import org.xml.sax.SAXException;impo原创 2013-12-27 15:25:43 · 517 阅读 · 0 评论 -
ToggleButton
使用ToggleButton实现组件的布局方向<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:l原创 2014-01-10 10:36:02 · 518 阅读 · 0 评论 -
RadioButton
RadioButton结合RadioGroup实现单项选择<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" a原创 2014-01-10 10:09:42 · 473 阅读 · 0 评论 -
获取手机设备的唯一码(IMIE)
public void fetch_status(){ TelephonyManager tm = (TelephonyManager) this .getSystemService(Context.TELEPHONY_SERVICE);// String str = ""; str += "DeviceId(IMEI) = " + tm.getDev转载 2013-12-29 10:12:49 · 995 阅读 · 0 评论