加载中
RecyclerView.Adapter

刚刚逛了一下github看到的,觉得很赞 所以记录分享一下 原文地址:https://github.com/nkzawa/socket.io-android-chat import android.content.Context; import android.support.v7.widget...

2015/01/22 09:40
1W
自定义ScrollView里面包含ListView

/** * ScrollView反弹效果的实现 */ public class MyScrollView extends ScrollView {   private View inner;// 孩子View   private float y;// 点击时y坐标   private Rect normal = new ...

2014/02/11 10:22
530
Android 保存浏览记录 SharedPreTools

public class SharedPreTools { //单键值存储---------------------------- public static String readShare(String sharename,String key) { SharedPreferences user = EdjApp.getI...

2014/02/08 10:08
108
Android应用程序创建桌面快捷方式

public static final String READ_SETTINGS_PERMISSION = "com.Android.launcher.permission.READ_SETTINGS"; public static final String INSTALL_SHORTCUT_PERMISSION = "com.android.lau...

SMS Library in Android

import android.app.Activity; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.ContentValues; import android.content.Context; im...

2014/01/24 13:43
159
返回键与moveTaskToBack的使用

public class TestActivity extends Activity { //... // Working for all API levels @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == Key...

2014/01/23 11:43
3.7K
Multipart HTTP Requests

public String multipartRequest(String urlTo, String post, String filepath, String filefield) throws ParseException, IOException {   HttpURLConnection connection = null;   DataOutp...

2014/01/23 11:34
66
每次打开应用时检查更新

public class Test extends Activity { private Handler mHandler; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState...

2014/01/23 11:29
35
监听listview item兼容于checkbox/textview/imageview

package com.o1.android.view; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.view.LayoutInflater; import android.view.View; i...

获取安装的应用程序名称、包名称、版本和图标

class PInfo { private String appname = ""; private String pname = ""; private String versionName = ""; private int versionCode = 0; private Drawable icon; ...

2014/01/23 10:52
312
Encrypt/Decrypt Strings(加密/解密字符串)

/** * Usage: * <pre> * String crypto = SimpleCrypto.encrypt(masterpassword, cleartext) * ... * String cleartext = SimpleCrypto.decrypt(masterpassword, crypto) * </pre> * ...

2014/01/23 10:49
4.1K
双击返回退出

private static long back_pressed; @Override public void onBackPressed() { if (back_pressed + 2000 > System.currentTimeMillis()) super.onBackPressed(); else Toas...

2014/01/23 10:41
28
Android GPS Location with Listener

/**** * GPS Process * * First of all call listener of Location * then checking for GPS_PROVIDER * if not available then check for NETWORK_PROVIDER * and if its also not a...

网络操作代码(NetWork)

/** * 返回网络是否可用 */ public static boolean isNetworkAvailable(Context context) { ConnectivityManager connectivity = (Connectivity...

2014/01/20 14:51
161
获取设备(Device)操作

/** * 获得设备型号 * @return */ public static String getDeviceModel() { return Build.MODEL; } /** * 获得...

2014/01/20 14:41
71
文件操作(File)

//创建文件 public static boolean createFile(File file, boolean deleteOnExists) throws IOException { if ( file . exists ()) { if ...

2014/01/20 14:33
36

没有更多内容

加载失败,请刷新页面

没有更多内容

返回顶部
顶部