Skip to content

Instantly share code, notes, and snippets.

View slashthinking's full-sized avatar

macliu slashthinking

  • wilddog
  • Beijing
View GitHub Profile
@slashthinking
slashthinking / gist:4556559
Created January 17, 2013 15:06
weixin 同步的代码。可以看到有很多种同步策略。
public enum SyncmlEngine$SyncType
{
private int value;
static
{
SYNC_SLOW_SYNC = new SyncType("SYNC_SLOW_SYNC", 2, 201);
SYNC_ONE_WAY_FROM_CLIENT = new SyncType("SYNC_ONE_WAY_FROM_CLIENT", 3, 202);
SYNC_REFRESH_FROM_CLIENT = new SyncType("SYNC_REFRESH_FROM_CLIENT", 4, 203);
@slashthinking
slashthinking / gist:4556574
Created January 17, 2013 15:08
同步的异常,以及同步采用的压缩方式。
public class SyncmlEngine
{
public static final int TCC_ERR_NONE = 0;
public static final int TCC_ERR_SYNC_ALERT_FAIL = -32217;
public static final int TCC_ERR_SYNC_DEVICE_FULL = -32220;
public static final int TCC_ERR_SYNC_INVALID_CREDENTIALS = -32215;
public static final int TCC_ERR_SYNC_LARGE_OBJECT_ERROR = -32219;
public static final int TCC_ERR_SYNC_LARGE_OBJECT_SIZE_MISMATCH = -32218;
public static final int TCC_ERR_SYNC_LOGIC = -32221;
public static final int TCC_ERR_SYNC_TARGET_MISMATCH = -32214;
@slashthinking
slashthinking / gist:4556577
Created January 17, 2013 15:08
tt同步的数据内容。。。 真tmd的全
package com.tencent.tccsync;
public enum ITccSyncDbAdapter$DbAdapterType
{
private int value;
static
{
CONTACT = new DbAdapterType("CONTACT", 1, 1);
EVENT = new DbAdapterType("EVENT", 2, 2);
@slashthinking
slashthinking / qq NetworkConst
Last active December 11, 2015 06:08
网络协议
摘自微信代码
public static String APN_3GNET;
public static String APN_3GWAP;
public static String APN_777;
public static String APN_CMNET;
public static String APN_CMWAP;
public static String APN_CTNET;
public static String APN_CTWAP;
public static final String APN_NET = "Net";
ConnectivityManager connectivity = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivity != null) {
// 获取网络连接管理的对象
NetworkInfo info = connectivity.getActiveNetworkInfo();
if (info != null && info.isConnected()) {
// 判断当前网络是否已经连接
if (info.getState() == NetworkInfo.State.CONNECTED) {
if(info.getTypeName().equals("WIFI")){
@slashthinking
slashthinking / gist:4701959
Created February 3, 2013 14:14
qq源码中的获取屏幕截屏的代码,很有意思。
public static Bitmap screenshot(Context paramContext)
{
boolean bool = sLoadSO;
Bitmap localBitmap = null;
if (bool);
try
{
byte[] arrayOfByte = getFrameBuffer();
localBitmap = null;
if (arrayOfByte == null)
@slashthinking
slashthinking / WatchDogPushReceiver.java
Last active December 21, 2015 09:13
微信代码研究
package com.tencent.mm.modelstat;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.tencent.mm.sdk.platformtools.l;
import com.tencent.mm.sdk.platformtools.q;
import com.tencent.mm.t.a.i;
import com.tencent.mm.t.au;
@slashthinking
slashthinking / line.java
Last active November 24, 2016 06:52
LINE研究
package jp.naver.android.npush.register;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import jp.naver.android.npush.common.Logger;
import jp.naver.android.npush.common.NPushIntent;
public class NPushMessaging
package com.facebook.analytics;
import android.app.ActivityManager;
import android.app.ActivityManager.MemoryInfo;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="49466"
android:versionName="2.0.3-release"
android:installLocation="0"
package="com.facebook.orca"
>
<uses-sdk
android:minSdkVersion="8"