Skip to content

Instantly share code, notes, and snippets.

View xxnjdlys's full-sized avatar

xxnjdlys xxnjdlys

  • China Beijing
  • 14:44 (UTC +08:00)
View GitHub Profile
@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'
@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'
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
# 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
@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();
}
}
@xxnjdlys
xxnjdlys / gist:d5ee7f5f21732460491a
Created September 28, 2014 05:23
funny comments
/**
*
*----------Dragon be here!----------/
*    ┏┓   ┏┓
*   ┏┛┻━━━┛┻┓
*   ┃       ┃
*   ┃   ━   ┃
*   ┃ ┳┛ ┗┳ ┃
*   ┃       ┃
*   ┃   ┻   ┃
@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 / 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 / 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 / gradle.properties
Created September 24, 2014 06:46
Make Android Studio build more faster.
## TODO: To make android studio build more faster ...
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# The Gradle daemon aims to improve the startup and execution time of Gradle.