自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 Android中解析XML

XML在各种开发中都广泛应用,Android也不例外。作为承载数据的一个重要角色,如何读写XML成为Android开发中一项重要的技能。今天就由我向大家介绍一下在Android平台下几种常见的XML解析和创建的方法。在Android中,常见的XML解析器分别为SAX解析器、DOM解析器和PULL解析器,下面,我将一一向大家详细介绍。SAX解析器:SAX(Simple API

2015-05-21 23:23:48 395

转载 Android Application的作用

学习android挺长时间了,但是对于Appliction还不是很了解。今天花一些时间研究了一下Application。 What is ApplicationApplication和Actovotu,Service一样是android框架的一个系统组件,当android程序启动时系统会创建一个 application对象,用来存储系统的一些信息。通常我们是不需要指定一

2015-04-11 17:53:54 430

转载 Android开源项目分类汇总

目前包括:Android開源項目第一篇——個性化控件(View)篇  包括ListView、ActionBar、Menu、ViewPager、Gallery、GridView、ImageView、ProgressBar、TextView、ScrollView、TimeView、TipView、FlipView、ColorPickView、GraphView、UI Style、其他

2015-03-11 13:29:08 1349

转载 BitmapFactory.Options详解

怎样获取图片的大小?思路很简单:首先我们把这个图片转成Bitmap,然后再利用Bitmap的getWidth()和getHeight()方法就可以取到图片的宽高了。新问题又来了,在通过BitmapFactory.decodeFile(String path)方法将突破转成Bitmap时,遇到大一些的图片,我们经常会遇到OOM(Out Of Memory)的问题。怎么避免它呢?这就用

2015-03-08 13:36:46 377

转载 Java输入输出流

目录(?)[-]1什么是IO2数据流的基本概念1 数据流2 输入流Input  Stream 3 输出流数据流分类3 标准IO命令行参数标准输入输出数据流4javaIO层次体系结构5 非流式文件类--File类6 JavaIO流类库io流的四个基本类io流的具体分类7 字节流InputStreamOutputStream 1 InputStrea

2015-03-07 15:32:09 414

转载 android:layout_gravity和android:gravity的区别

1.首先来看看android:layout_gravity和android:gravity的使用区别。android:gravity:这个是针对控件里的元素来说的,用来控制元素在该控件里的显示位置。例如,在一个Button按钮控件中设置如下两个属性,android:gravity="left"和android:text="提交",这时Button上的文字“提交”将会位于Bu

2015-02-13 12:55:01 377

转载 Android之Handler更新UI总结

方法一:(java习惯,在android平台开发时这样是不行的,因为它违背了单线程模型)刚刚开始接触android线程编程的时候,习惯好像java一样,试图用下面的代码解决问题   new Thread( new Runnable() { public void run() { myView.invalidate();

2015-02-09 22:48:10 524

原创 Sublime Text 2&3中文乱码

由于Sublime Text  2& 3不支持例如GB2312, GBK, BIG5, EUC-KR, EUC-JP, 等编码,所以就需要ConvertToUTF8这个插件,下载下来,解压ConvertToUTF8文件,由于Sublime Text 2&3 内嵌的Python限制,ConvertToUTF8 可能无法正常工作。所以就要安装Codecs33这个插件来解决这个问题,下载这个压缩

2015-01-30 15:06:13 570

转载 URL,URLConnection,HttPURLConnection的使用

URLConnection与HttPURLConnection都是抽象类,无法直接实例化对象。其对象主要通过URL的openconnection方法获得。值得注意的是:1.openConnection方法只创建URLConnection或者HttPURLConnection实例,但是并不进行真正的连接操作。并且,每次openConnection都将创建一个新的实例。2.openCo

2015-01-25 22:55:58 478

转载 详解android:scaleType属性

android:scaleType是控制图片如何resized/moved来匹对ImageView的size。ImageView.ScaleType / android:scaleType值的意义区别:CENTER /center  按图片的原来size居中显示,当图片长/宽超过View的长/宽,则截取图片的居中部分显示CENTER_CROP / centerCrop  按

2014-12-23 14:55:21 375

原创 Android学习笔记之获取手机屏幕大小

由于各种手机的屏幕大小不一,所以开发是不能准确地写死了屏幕大小,然而android开发中可以通过几行代码就可以获取手机屏幕大小。获取方法(一)WindowManager wm = (WindowManager) getContext() .getSystemService(Context.WINDOW_SERVICE); int width=wm.g

2014-12-19 23:03:53 481

原创 SQLiteOpenHelper的用法

SQLiteOpenHelper类是数据库读取的一个助手类。他是一个抽象类。通过它可以获得可读或可写的数据库对象。如getReadableDatabase(),getWritableDatabase(),通过该对象可以对数据库进行操作。还有就是通过复写回调函数onCreate(),和onUpgrade(),可以在创建和升级数据库时进行操作。SQLiteOpenHelper的实现代码pack

2014-12-19 22:45:33 805

转载 LayoutInflater的使用

在实际工作中,事先写好的布局文件往往不能满足我们的需求,有时会根据情况在代码中自定义控件,这就需要用到LayoutInflater。LayoutInflater在Android中是“扩展”的意思,作用类似于findViewById(),不同的是LayoutInflater是用来获得布局文件对象的,而findViewById()是用来获得具体控件的。LayoutInflater经常在Ba

2014-11-22 16:13:32 443

原创 用MediaPlayer实现在线音乐播放

使用MediaPlayer播放音乐,基本步骤:(1)

2014-10-10 17:06:44 7464

原创 Android调节声音的基本步骤

在Android系统中使用AudioManager类调节声音的基本步骤:通过系统服务huo

2014-09-28 22:51:52 854

原创 实现音频功能的接口

Android 系统顶层的音频应用功能是通过专用的jie

2014-09-28 11:07:09 843

转载 ARM异常中断

原博客地址:http://blog.csdn.net/gameit/article/details/17464389一、ARM中异常中断的类型:异常中断名称含义复位(Reset)当处理器复位引脚有效时,系统产生复位异常中断,程序跳转到复位异常中断处理程序处执行。复位异常中断通常用在下面几种情况:1、系统加电时2、系统复

2014-04-02 22:13:23 687

原创 Catch That Cow BFS

DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K

2014-03-11 11:05:09 461

原创 Dungeon Master BFS

DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one un

2014-03-10 20:32:36 461

原创 Oil Deposits DFS水题

DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid

2014-03-07 22:37:05 527

原创 Lake Counting DFS水题

DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains

2014-03-07 22:19:48 503

原创 The Pilots Brothers' refrigerator

DescriptionThe game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refrigerator door. Every handle can

2014-03-07 21:12:49 539

原创 Tempter of the Bone DFS+奇偶剪枝

Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He

2014-02-28 21:12:40 521

原创 操作格子 线段树

问题描述有n个格子,从左到右放成一排,编号为1-n。共有m次操作,有3种操作类型:1.修改一个格子的权值,2.求连续一段格子权值和,3.求连续一段格子的最大值。对于每个2、3操作输出你所求出的结果。输入格式第一行2个整数n,m。接下来一行n个整数表示n个格子的初始权值。接下来m行,每行3个整数p,x,y,p表示操作类型,p=1时表示修改格

2014-02-26 21:21:48 584

原创 Flip Game

DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying

2014-02-17 21:37:06 688 1

原创 yum install gcc安装时出现的问题

今天用虚拟机安装了fedora 18,然后在安装gcc时出现冲突。后来用rm 删除也不行,最后发帖求助是说fedora的软件有自己的包管理yum所以对软件的安装和删除用yum就好了,最后用yum remove audityum install gcc解决了。

2013-11-29 23:21:24 5560

原创 棋盘问题 DFS

Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n

2013-11-29 22:18:49 510

原创 Curling 2.0 DFS+回溯+减枝

DescriptionOn Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a squa

2013-11-27 23:38:51 493

原创 Children of the Candy Corn DFS+BFS

Language:DefaultChildren of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8492 Accepted: 3722DescriptionThe cornfield maze is a po

2013-11-19 17:27:53 711

原创 Find them, Catch them 并查集

DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to i

2013-11-10 22:57:32 500

原创 A Bug's Life 并查集

DescriptionBackground Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of t

2013-11-08 21:00:22 502

原创 The Suspects 并查集

DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best s

2013-10-30 22:06:16 607

原创 家族 并查集

描述若某个家族人员过于庞大,要判断两个是否是亲戚,确实还很不容易,现在给出某个亲戚关系图,求任意给出的两个人是否具有亲戚关系。规定:x和y是亲戚,y和z是亲戚,那么x和z也是亲戚。如果x,y是亲戚,那么x的亲戚都是y的亲戚,y的亲戚也都是x的亲戚。格式输入格式第一行:三个整数n,m,p,(n以下m行:每行两个数Mi,Mj,1接下来p行:每行两

2013-10-30 21:29:22 721

原创 Ubiquitous Religions 并查集

Ubiquitous ReligionsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 21090 Accepted: 10387DescriptionThere are so many different religions in the world t

2013-10-30 21:14:20 512

原创 A Knight's Journey 解题报告

题目大意:            骑士在一个棋盘上走,是否能全部遍历整个棋盘,他是按"日"方式走的.    重点是按字典顺序输出的                                                           解题思路:       dfs+回溯,横行为字母,纵行为数字。#include #include #define

2013-10-30 21:03:58 2927

空空如也

空空如也

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

TA关注的人

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