- 博客(15)
- 收藏
- 关注
原创 android之JSON 进行网络数据交换
什么是JSON JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,易于阅读和编写,同时也易于机器解析和生成,非常适合于服务器与客户端的交互。JSON 采用与编程语言无关的文本格式,但是也使用了类C 语言的习惯,这些特性使JSON 成为理想的数据交换格式。和 XML 一样,JSON 也是基于纯文本的数据格式。由于 JSON 天生是为 Jav
2014-08-22 09:43:40 1341 2
转载 正则表达式使用详解
简单的说,正则表达式是一种可以用于模式匹配和替换的强有力的工具。其作用如下:测试字符串的某个模式。例如,可以对一个输入字符串进行测试,看在该字符串是否存在一个电话号码模式或一个信用卡号码模式。这称为数据有效性验证。替换文本。可以在文档中使用一个正则表达式来标识特定文字,然后可以全部将其删除,或者替换为别的文字。根据模式匹配从字符串中提取一个子字符串。可以用来在文本或输入字段中查找特定文
2014-08-18 09:37:57 422
原创 android产生随机数
public void getCharAndNumr() { // String val = "",va=""; String a="",b="",c="",d=""; Random random = new Random(); // for(int i = 0; i < 1; i++) //
2014-08-14 20:08:21 1914
原创 java即时在线聊天(一)
import java.awt.Frame;public class ChatClient extends Frame { /** * @param args */ public static void main(String[] args) { new ChatClient().lanchFrame(); } public void lanchFrame() {
2014-08-09 22:37:42 4687
原创 android之取得电池电量
BatteryInfoBroadcastReceiver.javapackage com.example.batteryproject;import android.app.Activity;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;imp
2014-08-06 20:33:14 556
原创 Android存储之操作sdcard
package com.example.file;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.PrintStream;import java.util.Scan
2014-08-05 11:23:55 485
原创 Android之文件存储
package com.example.file;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.PrintStream;import android.os.Bundle;import android.app.Activity;import android.vie
2014-08-05 10:10:00 379
原创 Android之存储
package com.example.shardprefencesproject;import android.app.Activity;import android.content.SharedPreferences;import android.os.Bundle;import android.view.Menu;public class MainActivity exten
2014-08-04 17:51:35 435
原创 Android之Toast
MainActivity.javapackage com.example.toastproject;import android.os.Bundle;import android.app.Activity;import android.content.DialogInterface;import android.view.Menu;import android.view.View
2014-08-04 16:31:39 326
原创 Android之Service
Service是Android的四大组件之一Service与Activity一样,也有一个从启动到销毁的过程,但Service的这个过程比Activity简单得多。Service启动到销毁的过程只会经历如下3个阶段: 创建服务 开始服务 销毁服务 一个服务实际上是一个继承自Service的类,当服务经历上面3个阶段后,会分别调用Servi
2014-08-04 11:47:23 732
原创 容器之Collection接口
import java.util.ArrayList;import java.util.Collection;public class Test { public static void main(String[]args){ Collection c=new ArrayList(); c.add("hello"); c.add(new Name("f1","11"));
2014-08-03 19:30:08 336
原创 java常用类之string
public class Test { public static void main(String[]args){ String s1="hello"; String s2= "word"; String s3="hello"; System.out.println(s1==s3); s1=new String("hello"); s2=new String("hell
2014-08-03 18:41:09 369
原创 java之this关键字
public class Leaf { int i=0; Leaf (int i){this.i=i;} Leaf increament(){ i++; return this; } void print(){System.out.println("i="+i);} public static void main(String[]args){ Leaf leaf
2014-08-03 12:20:15 386
原创 再谈Dialog
package com.example.dialog;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.DialogInterface;import android.os.Bundle;import android.
2014-08-02 21:44:12 369
原创 dialog简单描述
package com.example.dialog;import android.os.Bundle;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.view.Menu;public class MainA
2014-08-02 20:03:40 465
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人