Skip to content

Instantly share code, notes, and snippets.

View xxnjdlys's full-sized avatar

xxnjdlys xxnjdlys

  • China Beijing
  • 03:59 (UTC +08:00)
View GitHub Profile
@xxnjdlys
xxnjdlys / build.gradle
Created September 24, 2014 06:51
Manifest-merger gradle version > 1.10
/**
* see http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger for help
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
@xxnjdlys
xxnjdlys / Miscellaneous.java
Created September 24, 2014 09:32
getIPAddress
/**
* Get IP address from first non-localhost interface
* @param useIPv4 true=return ipv4, false=return ipv6
* @return address or empty string
*/
public static String getIPAddress(boolean useIPv4) {
try {
List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface intf : interfaces) {
List<InetAddress> addrs = Collections.list(intf.getInetAddresses());
@xxnjdlys
xxnjdlys / WebViewDemo.java
Created September 26, 2014 02:50
this is a sample for webview .
package com.wukongtv.wkremote.client;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.webkit.WebSettings;
@xxnjdlys
xxnjdlys / gist:d5ee7f5f21732460491a
Created September 28, 2014 05:23
funny comments
/**
*
*----------Dragon be here!----------/
*    ┏┓   ┏┓
*   ┏┛┻━━━┛┻┓
*   ┃       ┃
*   ┃   ━   ┃
*   ┃ ┳┛ ┗┳ ┃
*   ┃       ┃
*   ┃   ┻   ┃
@xxnjdlys
xxnjdlys / ImageLoader.java
Created September 28, 2014 08:37
singleton class instance , use volatile
private volatile static ImageLoader instance;
/** Returns singleton class instance */
public static ImageLoader getInstance() {
if (instance == null) {
synchronized (ImageLoader.class) {
if (instance == null) {
instance = new ImageLoader();
}
}
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
# Optimizations: If you don't want to optimize, use the
# proguard-android.txt configuration file instead of this one, which
# turns off the optimization flags. Adding optimization introduces
# certain risks, since for example not all optimizations performed by
# ProGuard works on all versions of Dalvik. The following flags turn
# off various optimizations known to have issues, but the list may not
# be complete or up to date. (The "arithmetic" optimization can be
package com.wukongtv.wkremote.client.Util;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.nfc.Tag;
import android.util.Log;
/**
* Created by sadieyu
@xxnjdlys
xxnjdlys / build.gradle
Created November 13, 2014 09:09
build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
apply plugin: 'com.android.application'
@xxnjdlys
xxnjdlys / build.gradle
Created December 4, 2014 15:19
RELEASE APKS
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
apply plugin: 'com.android.application'
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:/Users/zhangpe/AppData/Local/Android/android-studio/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here: