Skip to content

Instantly share code, notes, and snippets.

View wuyexiong's full-sized avatar

哈哈熊仔 wuyexiong

  • Shenzhen, China
View GitHub Profile
import android.util.SparseArray;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
public class Main {
public static class MyCustomClass {
public int a;
#!/bin/bash
# This is a wrapper for adb. If there are multiple devices / emulators, this script will prompt for which device to use
# Then it'll pass whatever commands to that specific device or emulator.
# Run adb devices once, in event adb hasn't been started yet
BLAH=$(adb devices)
# Grab the IDs of all the connected devices / emulators
IDS=($(adb devices | sed '1,1d' | sed '$d' | cut -f 1 | sort))
/*
**┏┓ ┏┓
*┏┛┻━━━━━━━━━┛┻┓
*┃ ┃
*┃ ━ ┃
*┃ ┳┛ ┗┳ ┃
*┃ ┃
*┃ ``` ┻ ```┃
*┃ ┃
*┗━┓ ┏━┛
@wuyexiong
wuyexiong / MD5.java
Created June 5, 2014 07:28
Android下.文件MD5校验工具
import android.text.TextUtils;
import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.security.MessageDigest;
@wuyexiong
wuyexiong / AndroidBug5497Workaround.java
Last active November 6, 2022 07:49
Android How to adjust layout in Full Screen Mode when softkeyboard is visible全屏状态下,输入法不能将输入框自动适配屏幕的解决方案
import android.app.Activity;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
/**
* 讨论组:https://code.google.com/p/android/issues/detail?id=5497
* 解决方案:http://stackoverflow.com/questions/7417123
package com.cyrilmottier.android.resourcesadditions;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/**
* @author Cyril Mottier
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
// enables hardware accelerated rounded corners
// original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/
<manifest ...>
...
<!-- Make sure your app (or individual activity) uses the
theme with the custom attribute defined. -->
<application android:theme="@style/AppTheme" ...>
...
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="config_app_name">AVélib</string>
<string name="config_authority">com.cyrilmottier.android.avelib.citybikes</string>
<string name="config_com.google.android.maps.v2.api_key">XXX</string>
</resources>
@wuyexiong
wuyexiong / CloneExample1.java
Created September 12, 2013 04:14
Java 浅拷贝深拷贝,以及深拷贝优化。我草,碉堡了。
package deepcopy;
import java.util.Vector;
public class CloneExample1 {
public static void main(String[] args) {
// Make a Vector
Vector original = new Vector();