自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(38)
  • 收藏
  • 关注

原创 Xstream解析XML文件

private class GetDataTask extends AsyncTask<Void, Void, List<User>> { @Override protected List<User> doInBackground(Void... params) { i++; List<User> list=null;

2016-04-29 21:17:21 903

原创 网页缩放

实现布局中的代码 我们需要加载网页的webView控件<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" an

2016-04-29 21:08:38 809

原创 PullToRefresh实现上拉加载下拉刷新

//下面我们用GridView做展示 PullToRefresh可以用于多种组件的上拉加载下拉刷新 让我们看一下gridView的布局<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" and

2016-04-28 17:13:22 288

原创 实现按两次退出应用

//实现点击两次退出应用就是在主类中实现onKeyDown方法 public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if ((System.currentTimeMillis() - mExitTime) >

2016-04-28 16:59:36 302

原创 版本更新

//今天就让我们来学习一下版本更新 首先我们给出一个按钮实现检验版本号 也就是布局中的代码<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="ma

2016-04-28 11:15:53 566

原创 文件下载

我们实现的效果是点击button按钮实现文件的开始下载 所以我们布局中的代码 也就显而易见了 让我们来一起看一下布局中的实现代码啊!<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" a

2016-04-25 21:10:31 517

原创 WebView加载网页-进度显示-网络上传图片并压缩

布局中的实现代码<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="

2016-04-24 20:35:25 1423

原创 歌词同步显示

布局中的实现代码<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="

2016-04-23 08:28:39 756

原创 自定义圆盘式view

//首先大家最关心的就是效果到底是怎样的 ,那么我们就先来看一下效果;实现上面的效果 我们需要自定义的view 那么下面展示的就是自定义view中的实现代码import android.content.Context;import android.content.res.TypedArray;import android.graphics.Bitmap;import android.gr

2016-04-23 08:13:15 1095

原创 SearchView搜索过滤

实现的xml文件 今天我们引入SearchView控件这个是实现搜索的一个控件<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent

2016-04-22 21:05:06 2100

原创 图片超链接

图片超链接就是 点击图片可以跳转 主要使用的是隐式意图的跳转来实现,主要的实现代码如下: 布局中的实现代码<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout

2016-04-21 21:19:43 700

原创 Android如何防止apk程序被反编译

作为Android应用开发者,不得不面对一个尴尬的局面,就是自己辛辛苦苦开发的应用可以被别人很轻易的就反编译出来。Google似乎也发现了这个问题,从SDK2.3开始我们可以看到在android-sdk-windows\tools\下面多了一个proguard文件夹proguard是一个java代码混淆的工具,通过proguard,别人即使反编译你的apk包,也只会看到一些让人很难看懂的代码,从而达

2016-04-21 21:06:00 349

原创 反编译流程

在学习Android开发的过程你,你往往会去借鉴别人的应用是怎么开发的,那些漂亮的动画和精致的布局可能会让你爱不释手,作为一个开发者,你可能会很想知道这些效果界面是怎么去实现的,这时,你便可以对改应用的APK进行反编译查看。下面是我参考了一些文章后简单的教程详解。(注:反编译不是让各位开发者去对一个应用破解搞重装什么的,主要目的是为了促进开发者学习,借鉴好的代码,提升自我开发水平。)测试环境:

2016-04-21 20:58:39 2360

原创 SurfaceView取景拍照

//布局中的实现代码<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

2016-04-19 12:00:50 673

原创 SurfaceView取景

xml中的布局文件<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=

2016-04-19 11:49:16 396

原创 录制视频

//布局中的实现代码<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

2016-04-19 11:19:53 510

原创 文字生成二维码

//布局中的实现代码<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

2016-04-19 11:13:36 1049

原创 Android中视频录制常见问题

初始化过程主要包括View,Data以及Listener三部分。在初始化View时,添加摄像头预览,添加倒计时文本组件,设置初始状态UI组件的可见;初始化Data时,从Intent中获取初始数据;初始化Listener时,分别对录制触发按钮,保存/取消视频录制按钮以及视频预览界面添加监听。 当系统初始化成功后,等待用户按下录制按钮,因此在录制按钮的监听中,需要完成以下功能:录制,计时,更新

2016-04-18 20:46:36 2046

原创 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_height="

2016-04-18 19:49:22 662

原创 ViewPager滑动--RadioButton标识滑动到第几页

//下面我们举一个三张导航页面的例子 我们先看看布局文件 贯穿整个页面的是ViewPager 上面还有三个小圆点使用的是RadioButton <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"

2016-04-18 15:25:52 1106

原创 自定义圆图片(2)

第一步首先自定义一个类继承ImageViewimport android.content.Context;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphics.Paint;import android.graphics.PorterDuff;import android.g

2016-04-17 21:03:52 342

原创 侧滑菜单的简单实现展示

工程中我们使用的是SlidingMenu.jar包文件 需要提前准备好jar包 点击按钮实现侧滑菜单的显示和隐藏 布局中的代码实现<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" and

2016-04-17 20:23:14 534

原创 字符串反转

public class DaoXu { public static void main(String[] args) { String a="abcdef"; //字符串反转 String b=new StringBuffer(a).reverse().toString(); System.out.println(b);

2016-04-17 20:00:46 304

原创 白天夜间模式切换(2)

主类中的实现代码 这个切换模式不需要主题的选择切换import android.support.v7.app.ActionBarActivity;import android.content.Context;import android.content.SharedPreferences;import android.content.SharedPreferences.Editor;imp

2016-04-17 19:58:41 1910

原创 白天夜间模式切换

点击button实现模式的切换 布局中的代码<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:

2016-04-17 19:47:27 1202

原创 Split分割字符串

java工程中主方法中的实现代码package com.baidu.split;import java.io.BufferedReader;import java.io.File;import java.io.FileReader;import java.io.IOException;public class Split { public static void main(Strin

2016-04-17 19:20:52 402

原创 HttpClient请求数据的封装

这个是一个封装类 封装起来的好处是什么地方需要请求网络数据 什么地方调用这个类中的方法就好了 不用每个地方都写一次联网请求的方法。在别的地方 我们通过类名点.方法名调用 然后传递给封装类一个URL就OK了。快试试吧!public class MyHttpClient { public List<javabean最外层的类名> myClient(String uri){

2016-04-17 19:15:14 1080

原创 系统自带播放器播放视频

xml布局中什么都不需要实现 只需要 在主方法中实现一下代码即可import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.os.Environment;public class MainActivity e

2016-04-16 08:54:52 1056

原创 SurFaceView视频播放

//xml布局文件<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=

2016-04-16 08:50:38 386

原创 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="

2016-04-15 20:30:50 477

原创 ContentResolver查询系统音乐文件

//下面实现的是内容提供者查询的系统的音乐文件我们通过适配器展示在列表上面 获得音乐文件的名称 歌者 路径 import java.util.ArrayList;import java.util.List;import com.example.adapter.MusicAdapter;import com.example.bean.Music;import android.app.

2016-04-14 19:35:08 1496

原创 走马灯效果总结

android:ellipsize实现跑马灯效果总结 首先我们要实现走马灯这样一个效果,通常来说都是在TextView这个控件中来实现的,而且其中的文字一定是单行显示,如果多行显示,那走马灯效果也就失去了存在的意义。另外,在EditText中使用走马灯没有必要,也不合理,实际上对于EditText来说android:ellipsize这个属性只有对于设置在android:hint中的文字的时候是有

2016-04-14 19:08:55 2998

原创 全选反选取消选择及删除勾选结算

//主页面的布局xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_heigh

2016-04-14 13:39:12 1839

原创 ViewPager导航图片——简单实现方法

//首先展示的是布局文件中的代码<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="matc

2016-04-12 21:03:46 516

原创 ScrollView嵌套ListView——解决滑动冲突问题

//布局中的代码实现 一个简单的布局设置 演义滑动冲突<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" androi

2016-04-12 20:49:52 14389 2

原创 ScrollView嵌套ListView——求解listView的高度

布局中的实现代码<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="matc

2016-04-12 20:35:53 562

原创 文字超链接—布局实现和代码实现

1:布局实现 //主类中的实现代码import android.app.Activity;import android.os.Bundle;import android.text.SpannableString;import android.text.method.LinkMovementMethod;import android.widget.TextView;public class

2016-04-11 21:00:52 1852

原创 自定义圆图片

自定义类中的代码:package com.example.image;import android.content.Context;import android.graphics.Bitmap;import android.graphics.Paint;import android.graphics.PorterDuff.Mode;import android.graphics.Porter

2016-04-11 20:03:52 500

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除