- 浏览: 20428 次
- 性别:
- 来自: 北京
最新评论
文章列表
1、动画结束的时候不要执行remove操作
2、activity trance pant的使用注意事项
3、TV系统时间不准确
4、三元表达式和字符串相加的问题
5、handler message没移除的问题
很少写多表查询的语句,请教宏利得到的
select m.msg as msg_content, m.type as msg_type, m.time as msg_time, m.state as msg_state, m.has_read as has_read, u.id as friend_user_id,u.name as friend_user_name,u.avatar as friend_user_avatar from message as m, user as u where m.user_id = ? and m.friend_user_id = u.id grou ...
public abstract class StringUtil {
/**
* 产生一个随机的字符串
*
* @param 字符串长度
* @return
*/
public static String getRandomString(int length) {
String base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
Random random = new Random();
StringBuffer ...
public class AESHelper {
/** 算法/模式/填充 **/
private static final String CipherMode = "AES/ECB/PKCS5Padding";
/** 创建密钥 **/
private static SecretKeySpec createKey(String password) {
byte[] data = null;
if (password == null) {
password = "";
}
StringBuff ...
public class FileUtil {
/**
* 删除文件
*
* @param context
* 程序上下文
* @param fileName
* 文件名,要在系统内保持唯一
* @return boolean 存储成功的标志
*/
public static boolean deleteFile(Context context, String fileName) {
return context.deleteFile(fileName);
}
/* ...
public class DownloadUtils {
private static final int CONNECT_TIMEOUT = 10000;
private static final int DATA_TIMEOUT = 40000;
private final static int DATA_BUFFER = 1024 * 10;
public interface DownloadListener {
public void downloading(int progress);
public void downloaded();
...
public class ImageUtil {
public static final String TAG = ImageUtil.class.getSimpleName();
/**
* 判断图片是否需要翻转(正方向的不用翻转)
*
* @param fileName
* @return
*/
public static boolean needRotate(Context context, String fileName) {
try {
ExifInterface exif = new ExifInterface ...
boolean isHome = isHome(context, getHomes(context));
private static List<String> getHomes(Context context) {
List<String> names = new ArrayList<String>();
PackageManager packageManager = context.getPackageManager();
// 属性
Intent intent = new Intent(Int ...
/**
* 获取能启动intent的app信息
*
* @param context
* @param intent
* @return
*/
public static List<ResolveInfo> getAppsForIntent(Context context,
Intent intent) {
PackageManager packageManager = context.getPackageManager();
// 属性
List<ResolveInfo> resolveInfo ...
public class LogUtil {
public static final String DEFAULT_TAG = "debug";
public static boolean showLog = Constants.Config.DEVELOPER_MODE;
public static void v(String logText) {
if (showLog) {
Log.v(DEFAULT_TAG, String.valueOf(logText));
}
}
public static void v ...
public class KeyboardUtil {
public static void hideSoftInput(Activity acitivity) {
InputMethodManager imm = (InputMethodManager) acitivity
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(acitivity.getWindow().getDecorView()
.getApplicationWindowToken ...
public class IDCardUtil {
public static boolean isValidIdCard(String idCard) {
if (idCard == null) {
return false;
}
Pattern p = Pattern.compile("(\\d{17}[0-9a-zA-Z]|\\d{14}[0-9a-zA-Z])");
return p.matcher(idCard).matches();
}
public static String getBirthday ...
http://android-developers.blogspot.com/2011/11/jni-local-reference-changes-in-ics.html这个网址fanqiang才能访问。下面是复制的内容
JNI Local Reference Changes in ICS
[This post is by Elliott Hughes, a Software Engineer on the Dalvik team. — Tim Bray]
If you don’t write native code that uses JNI, you can stop ...
1、首先定义4个动画文件。
slide_left_in.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="300"
android:fromXDelta="-100%p"
...
自带的CookieStore只能在内存里边管理cookie,但是有的时候需要把cookie保存到文件里边。
为了长久保存cookie,自定义了BasicCookieStore,当添加cookie的时候,都保存到数据库,初始化的时候再从数据里边恢复cookie。
1、自定义的CookieStore
public class CustomCookieStore extends BasicCookieStore {
public CustomCookieStore() {
super();
try {
List<Cookie> cookies = Cook ...