2013年3月5日

拼音检索

摘要: package com.zhf.FastContactSearchWithAlphabeticBarDemo;import java.util.ArrayList;import java.util.Collections;import java.util.HashMap;import java.util.List;import java.util.Set;import java.util.regex.Pattern;import com.zhf.FastContactSearchDemo.R;import android.app.Activity;import android.content. 阅读全文

posted @ 2013-03-05 10:54 _star 阅读(318) 评论(0) 推荐(0)

瀑布list

摘要: item的xml<?xml version="1.0" encoding="utf-8"?><com.dodowaterfall.widget.FlowView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/waterfall_image" android:layout_width="wrap_content" android:layout_height="wra 阅读全文

posted @ 2013-03-05 10:46 _star 阅读(277) 评论(0) 推荐(0)

异步加载

摘要: package com.example.threadpool;import java.io.IOException;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import java.util.ArrayList;import java.util.List;import java.util.concurrent.ExecutorService;import java.util.concurrent.Executors;import java.util.concurrent.Th 阅读全文

posted @ 2013-03-05 10:42 _star 阅读(206) 评论(0) 推荐(0)

图案锁 九宫格

摘要: package com.star.applock.custview;import com.star.applock.R;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Paint.Cap;import android. 阅读全文

posted @ 2013-03-05 10:21 _star 阅读(203) 评论(0) 推荐(0)

Math.

摘要: Math.floorfloor -- 原意 地板。数学函数,求一个浮点数的地板,就是求一个最接近它的整数,它的值小于或等于这个浮点数。例如:Math.floor(0.60) -- 0Math.floor(0.40) -- 0Math.floor(5) -- 5Math.floor(5.1) -- 5Math.floor(-5.1) -- -6Math.floor(-5.9) -- -6round 取整public static int round(float f) { // check for NaN if (f != f) { return 0; } return (int) floor(f 阅读全文

posted @ 2013-03-05 10:20 _star 阅读(158) 评论(0) 推荐(0)

UDP send receive

摘要: package com.thunder.fingerpaint;import java.io.IOException;import java.io.UnsupportedEncodingException;import java.net.DatagramPacket;import java.net.DatagramSocket;import java.net.InetAddress;import java.net.SocketException;import java.net.UnknownHostException;import android.content.Context;import 阅读全文

posted @ 2013-03-05 10:10 _star 阅读(385) 评论(0) 推荐(0)

android 单例模式

摘要: 1.普通方法4.public class SingletonB { 5. 6. /** 7. * 单例对象实例 8. */ 9. private static SingletonB instance = null; 10. 11. public synchronized static SingletonB getInstance() { 12. if (instance == null) { 13. instance = new SingletonB(); 14. } 15. ... 阅读全文

posted @ 2013-03-05 10:07 _star 阅读(207) 评论(0) 推荐(0)

方法锁 全局锁

摘要: 全局锁import java.util.concurrent.locks.Lock;import java.util.concurrent.locks.ReentrantLock; private static Lock lock=new ReentrantLock();; public void print(String string) { lock.lock(); for(int i =0;i<5;i++){ Log.v("XXX", string+"= start"+i); //System.out.prin... 阅读全文

posted @ 2013-03-05 10:03 _star 阅读(207) 评论(0) 推荐(0)

http get post

摘要: private String HttpClientGet(String url) { String urlname = url; BufferedReader br = null; String result=""; try { URL urlread = new URL(urlname); URLConnection conn = urlread.openConnection();// 打开和URL之间的连接 conn.setRequestProperty("ac... 阅读全文

posted @ 2013-03-05 10:00 _star 阅读(308) 评论(0) 推荐(0)

2013年3月4日

APK加载第三方APK

摘要: //将资源考入手机SDCARDprivate void copyBigDataBase() throws IOException { InputStream myInput; String outFileName = Path + "/" + Name; OutputStream myOutput = new FileOutputStream(outFileName); byte[] buffer = new byte[1024]; int length; myInput = AIDLActivity.this... 阅读全文

posted @ 2013-03-04 10:44 _star 阅读(297) 评论(0) 推荐(0)

导航