This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0' | |
//classpath 'com.github.dcendents:android-maven-plugin:1.2' | |
apply plugin: 'com.android.library' | |
apply plugin: 'com.github.dcendents.android-maven' | |
apply plugin: 'com.jfrog.bintray' | |
version '1.5.0' | |
android { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.m | |
// AutoLayoutDemo | |
// | |
// Created by Ting Sun on 6/17/15. | |
// Copyright (c) 2015 sunting. All rights reserved. | |
// | |
#import "ViewController.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//发送get请求 | |
func get(url string) string { | |
response, err := http.Get(url) | |
if err != nil { | |
fmt.Printf("%s", err) | |
os.Exit(1) | |
} else { | |
defer response.Body.Close() | |
contents, err := ioutil.ReadAll(response.Body) | |
if err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.android.bluetoothleadvertiser; | |
import android.bluetooth.BluetoothAdapter; | |
import android.bluetooth.BluetoothDevice; | |
import android.bluetooth.BluetoothGatt; | |
import android.bluetooth.BluetoothGattCharacteristic; | |
import android.bluetooth.BluetoothGattDescriptor; | |
import android.bluetooth.BluetoothGattServer; | |
import android.bluetooth.BluetoothGattServerCallback; | |
import android.bluetooth.BluetoothGattService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private BluetoothGattCallback mGattCallback = new BluetoothGattCallback() { | |
@Override | |
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { | |
super.onConnectionStateChange(gatt, status, newState); | |
Log.v(TAG, "Connection State Changed: " + (newState == BluetoothProfile.STATE_CONNECTED ? "Connected" : "Disconnected")); | |
if (newState == BluetoothProfile.STATE_CONNECTED) { | |
setState(State.CONNECTED); | |
gatt.discoverServices(); | |
} else { | |
setState(State.IDLE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"os" | |
) | |
var ( | |
fileInfo *os.FileInfo | |
err error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum RecognitionTaskType implements Parcelable { | |
HOTWORD, | |
OFFLINE, | |
ONLINE, | |
MIX, | |
RECORD_ONLY; | |
@Override | |
public int describeContents() { | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String getCurrentProcessName() { | |
String processName = ""; | |
int pid = android.os.Process.myPid(); | |
ActivityManager manager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE); | |
for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) { | |
if (processInfo.pid == pid) { | |
processName = processInfo.processName; | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Recycle src of ImageView | |
private static void recycleImageViewBitMap(ImageView imageView) { | |
if (imageView != null) { | |
BitmapDrawable bd = (BitmapDrawable) imageView.getDrawable(); | |
rceycleBitmapDrawable(bd); | |
} | |
} | |
private static void rceycleBitmapDrawable(BitmapDrawable bitmapDrawable) { | |
if (bitmapDrawable != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.zc.logger.util; | |
import java.io.BufferedInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipOutputStream; |