自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 java单例模式

非常感谢一下两位作者的贡献转载自:http://www.cnblogs.com/hxsyl/archive/2013/03/19/2969489.html一.问题引入  偶然想想到的如果把Java的构造方法弄成private,那里面的成员属性是不是只有通过static来访问呢;如果构造方法是private的话,那么有什么好处呢;如果构造方法是private的话,会不更好的封

2016-04-10 13:20:46 435

转载 Android获取内存信息

【文章来源】http://blog.csdn.net/hudashi/article/details/7050897 查看内存使用的方式有很多种,但是各个方式查看到的结果可能会有微略不同。方式一,Running services通过手机上Running services的Activity查看,可以通过Setting->Applications->Running se

2015-09-07 19:04:47 444

转载 Linux平台Cpu使用率的计算

转自:http://www.blogjava.net/fjzag/articles/317773.htmlLinux平台Cpu使用率的计算proc文件系统/proc文件系统是一个伪文件系统,它只存在内存当中,而不占用外存空间。它以文件系统的方式为内核与进程提供通信的接口。用户和应用程序可以通过/proc得到系统的信息,并可以改变内核的某些参数。由于系统的信息,如进程,是动态改变的,所以

2015-09-07 15:56:06 441

转载 使用WindowManager实现悬浮窗

public class MainActivity extends Activity { WindowManager windowManager; WindowManager.LayoutParams layoutParams; DisplayMetrics displayMetrics; TextView button; @Override p

2015-09-06 15:38:03 2492 1

原创 Robotium Instrumentation run failed due to 'java.lang.ClassNotFoundException'

创建了一个Robotium测试工程,运行的时候提示 Instrumentation run failed due to 'java.lang.ClassNotFoundException' 试了很多解决方法,下面把解决方案汇总下,说不定以后也会出现同样的问题。1.没有加入JUnit4的测试包Build Path -> Configure Build Path -> Liabraries 添

2015-08-03 13:31:39 843

原创 EverydayWord总结

1.使用fragment,主类要定义为public,否则会出现java.lang.IllegaAccessException:access to class not allowed异常   解决方案地址:http://blog.csdn.net/lonelyroamer/article/details/79075012.RelativeLayout里面定义的EidtText设置宽度为mat

2015-07-14 18:38:52 507

原创 使用canvas画曲线

Draw类package com.example.drawtestone;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Path;imp

2015-07-06 10:36:05 749

原创 获得日期的前几天或者后几天

/** * get before data * @param c Calendar object * @param num want to get the number of days * @return ArrayLsit of days */ public ArrayList getBeforDay(Calendar c,int num) { ArrayList d

2015-07-06 10:34:19 516

原创 java 从zip包中复制文件

/** * 从zip包中把AndroidManifest.xml文件拷贝出来 * @param file * @param fileName */ public void copyMainfest(File file) { ZipFile zipFile = null; ZipInputStream zipInput = null; ZipEntry zipEntry

2015-06-21 17:56:29 2018

原创 Java正则表达式匹配

Pattern p = Pattern.compile("android:name=\"(.*?)\"(.*?)android:value=\"(.*?)\"");Matcher m = p.matcher("");while(m.find()){ //group(0)代表整句,group(1)代表第一个匹配的字符串,以此类推 System.out.println(m.group(1)+m.g

2015-06-21 17:50:02 436

原创 Java运行cmd命令

public void apktool(){ apkFile = new File(apkFilePath); String debugFilePath = apkFile.getParent() + "\\debug"; debugFile = new File(debugFilePath); if(!debugFile.exists()){ debugFile.mkdir

2015-06-21 17:44:18 471

原创 Jenkins配置脚本打渠道包

1.Jenkins环境搭建博客;http://my.oschina.net/u/930967/blog/2990582.生成build.xml方法:sdk/tools目录下输入命令行:android update project -p 3.工程根目录下创建ant.properties文件key.store = key文件存放路径key.alias = key的别名key

2015-06-03 10:20:02 1834

转载 android studio解决Execution failed for task ':app:compileDebugAidl': aidl is missing

原文地址:http://stackoverflow.com/questions/29766830/execution-failed-for-task-appcompiledebugaidl-aidl-is-missing/2981307616down voteIn my case I downloaded version 22 of Andr

2015-06-01 14:00:56 2738

原创 Service1

简介:Service是Android四大组件之一,运行在后台执行耗时操作并且不提供用户界面。其他组件(如Activity)可以通过startService启动该组件,也可以通过BindService启动并绑定该组件进行通信。使用场景:后台下载文件,播放音乐等。注意:Service运行在主线程中,他不会创建属于自己的线程,也不是运行在独立的线程中,所以,在使用的时候,需要自己创建线程,而

2015-05-20 14:48:20 498

转载 Android图像处理之Bitmap类

田海立@CSDN2011/09/08 Bitmap是Android系统中的图像处理的最重要类之一。用它可以获取图像文件信息,进行图像剪切、旋转、缩放等操作,并可以指定格式保存图像文件。本文从应用的角度,着重介绍怎么用Bitmap来实现这些功能。 一、Bitmap的生成1.1 BitmapFactory decode出Bitmap    Bit

2015-05-19 17:48:33 1200

转载 Android中Cursor类的概念和用法

使用过 SQLite 数据库的童鞋对 Cursor 应该不陌生,如果你是搞.net 开发你大可以把Cursor理解成 Ado.net 中的数据集合相当于dataReader。今天特地将它单独拿出来谈,加深自己和大家对Android 中使用 Cursor 的理解。关于 Cursor在你理解和使用 Android Cursor 的时候你必须先知道关于 Cursor 的几件事情:

2015-05-18 18:45:12 315

转载 android Intent机制详解

什么是IntentIntent是一种运行时绑定(run-time binding)机制,它能在程序运行过程中连接两个不同的组件。通过Intent,你的程序可以向Android表达某种请求或者意愿,Android会根据意愿的内容选择适当的组件来完成请求。比如,有一个Activity希望打开网页浏览器查看某一网页的内容,那么这个Activity只需要发出WEB_SEARCH_ACTIO

2015-05-18 18:21:53 395

原创 不同activity通过Application实现全局变量共享

Application类package com.example.contextone;import android.annotation.SuppressLint;import android.app.Application;//多个组件之间实现数据共享,context可以作为全局信息共享的桥梁public class App extends Application{ privat

2015-05-18 15:44:07 716

转载 Android中Context详解 ---- 你所不知道的Context

本文原创 ,转载必须注明出处 :http://blog.csdn.net/qinjuning               前言:本文是我读《Android内核剖析》第7章 后形成的读书笔记 ,在此向欲了解Android框架的书籍推荐此书。            大家好,  今天给大家介绍下我们在应用开发中最熟悉而陌生的朋友-----C

2015-05-18 14:18:35 583

原创 Android数据库SQLite

继承SQLiteOpenHelperpackage com.example.dbtest;import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteDatabase.CursorFactory;import andr

2015-05-18 10:07:04 450

转载 Activity生命周期

package com.example.activitytestone;import android.support.v7.app.ActionBarActivity;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.Menu;import

2015-04-13 13:15:44 310

原创 WebView一

package com.example.webviewtestone;import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.net.http.SslError;import android.os.Bundle;import android.util

2015-04-09 15:25:06 305

空空如也

空空如也

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

TA关注的人

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