Skip to content

Instantly share code, notes, and snippets.

Avatar
🙈
Focusing

hglf hotstu

🙈
Focusing
  • une
  • Chengdu China
View GitHub Profile
@hotstu
hotstu / deployArtifactory.gradle
Created May 14, 2019
deploy Android aar package to private artifactory repo/本脚本将编译后的aar上传私有artifactory仓库
View deployArtifactory.gradle
//本脚本将编译后的aar上传私有artifactory仓库
//first config ~/.gradle/gradle.properties
//artifactory_contextUrl=http\://127.0.0.1\:8080/artifactory
//artifactory_user=anmin
//artifactory_repo_release=libs-release-local
//artifactory_password=password
//artifactory_repo_snapshot=libs-snapshot-local
//
//then in you root project's build.gradle:
//import below in project.gradle
@hotstu
hotstu / NioFile.java
Created Jun 11, 2020
Java Nio File channel code including write/read/copy/lock/map
View NioFile.java
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
public class NioFile {
@hotstu
hotstu / NotificationChannelBuilder.kt
Last active May 14, 2019
NotificationChannelBuilder, DSL style android notification channel builder powered by kotlin, simple way to support Android O notification channels
View NotificationChannelBuilder.kt
/**
* @author hglf <a href="https://github.com/hotstu">hglf</a>
* @since 5/13/19
* @desc
*/
class Config {
val chidren: ArrayList<NotificationChannelGroup> = ArrayList()
}
//NOTE: extension properies are resolved static, so here is a little mem leak, call clean() when every thing is done
val extendPenddingChannels = HashMap<NotificationChannelGroup, ArrayList<NotificationChannel>>()
@hotstu
hotstu / CountingFileRequestBody.java
Created Mar 21, 2016 — forked from eduardb/CountingFileRequestBody.java
Uploading a file with a progress displayed using OkHttp
View CountingFileRequestBody.java
public class CountingFileRequestBody extends RequestBody {
private static final int SEGMENT_SIZE = 2048; // okio.Segment.SIZE
private final File file;
private final ProgressListener listener;
private final String contentType;
public CountingFileRequestBody(File file, String contentType, ProgressListener listener) {
this.file = file;
@hotstu
hotstu / genymotionwithplay.txt
Created Mar 18, 2016 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
View genymotionwithplay.txt
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)