Skip to content

Instantly share code, notes, and snippets.

benli.shi beilly

Block or report user

Report or block beilly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@beilly
beilly / OkHttp3Stack.java
Last active Feb 13, 2017
Volley Stack with OkHttp3,and it will trusting all certificates. You can remove "allowAllSSLOkHttp(builder);" if you do't want to trusting all.
View OkHttp3Stack.java
package com.benli.app.utils.net;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.toolbox.HttpStack;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.StatusLine;
@beilly
beilly / InputTools.java
Last active Apr 25, 2016
键盘管理器
View InputTools.java
package com.benli.app.utils;
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import java.util.Timer;
import java.util.TimerTask;
@beilly
beilly / ToastUtil.java
Last active Apr 25, 2016
Android Toast 工具类,可关闭支持线程中和延时效果。
View ToastUtil.java
package com.benli.app.utils;
import android.content.Context;
import android.os.Handler;
import android.view.View;
import android.widget.Toast;
/**
* @ClassName: ToastUtil
* @Description: TODO(...)
@beilly
beilly / DeviceUuidFactory.java
Last active Feb 19, 2019
实现在设备上更通用的获取设备唯一标识
View DeviceUuidFactory.java
package com.benli.app.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
View huawei_CheckStyle
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!-- Generated by RHY @will_awoke -->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
@beilly
beilly / LauncherActivity_OnCreate
Created Aug 26, 2016
解决4.4机器上面按home键返回桌面后恢复需要重新走launcher页面的bug
View LauncherActivity_OnCreate
if (!isTaskRoot()) {
Intent intent = getIntent();
String action = intent.getAction();
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && action != null && action.equals(Intent.ACTION_MAIN)) {
finish();
return;
}
}
@beilly
beilly / AndroidBug5497Workaround.java
Created Aug 31, 2016
WebView adjustResize windowSoftInputMode breaks when activity is fullscreen.Depent on https://github.com/madebycm/AndroidBug5497Workaround
View AndroidBug5497Workaround.java
package com.vcredit.utils;
import android.app.Activity;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
/**
* Created by shibenli on 2016/8/31.
@beilly
beilly / AdapterHolder.java
Created Sep 19, 2016
通用Adapter与ListView滚动时不加载图片的封装,摘自http://www.kymjs.com/code/2015/04/28/01/
View AdapterHolder.java
/*
* Copyright (c) 2014, 张涛.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@beilly
beilly / AndroidComment.java
Created Oct 8, 2016
android跳转到应用市场评论
View AndroidComment.java
try {
Uri uri = Uri.parse("market://details?id="
+ BuildConfig.APPLICATION_ID);//需要评分的APP包名
Intent intent5 = new Intent(Intent.ACTION_VIEW, uri);
intent5.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent5);
} catch (Exception e) {
TooltipUtils.showToastL(this, getString(R.string.common_no_function));
}
@beilly
beilly / FakeX509TrustManager.java
Last active Sep 11, 2019
Volley Stack with default HttpsURLConnection, and it will trusting all certificates
View FakeX509TrustManager.java
package com.beilly.utils.net;
import android.content.Context;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
You can’t perform that action at this time.