This file contains hidden or 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 org.glucosio.android.tools; | |
| import android.Manifest; | |
| import android.app.Activity; | |
| import android.content.pm.PackageManager; | |
| import android.os.Environment; | |
| import android.support.v4.app.ActivityCompat; | |
| import android.util.Log; | |
| import android.widget.Toast; |
This file contains hidden or 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
| #!/bin/sh | |
| # Install brew | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| # Apple hides old versions of stuff at https://developer.apple.com/download/more/ | |
| # Install the latest XCode (8.0). | |
| # We used to install the XCode Command Line Tools 7.3 here, but that would just upset the most recent versions of brew. | |
| # So we're going to install all our brew dependencies first, and then downgrade the tools. You can switch back after | |
| # you have installed caffe. | |
| # Install CUDA toolkit 8.0 release candidate | |
| # Register and download from https://developer.nvidia.com/cuda-release-candidate-download |
This file contains hidden or 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
| #!/bin/bash | |
| cat << EOF | |
| ########################################################### | |
| # Workaround adb disconnecting issue on macOS Sierra | |
| # | |
| # More info: | |
| # https://code.google.com/p/android/issues/detail?id=219085 | |
| # credits to: [email protected], [email protected] | |
| ########################################################### |
This file contains hidden or 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
| #!/bin/bash | |
| cat << EOF | |
| ########################################################### | |
| # Workaround adb disconnecting issue on macOS Sierra | |
| # | |
| # More info: | |
| # https://code.google.com/p/android/issues/detail?id=219085 | |
| # credits to: [email protected], [email protected] | |
| ########################################################### |
This file contains hidden or 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
| ADB=${ANDROID_HOME}/platform-tools/adb | |
| HPROF_CONV=${ANDROID_HOME}/platform-tools/hprof-conv | |
| # customized functions | |
| # dump droid heap | |
| function droid_hd() { | |
| PACKAGE_NAME=$1 | |
| TIME=$(date +"%Y%m%d_%H%M%S") | |
| FILE_NAME="${PACKAGE_NAME}-${TIME}-heap.hprof" |
This file contains hidden or 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
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.slf4j.MDC; | |
| //Logging | |
| LoggerFactory.getLogger(MainActivity.class).warn("Hello"); | |
| //Add optional fields in onCreate method (in Activity or Application): | |
| MDC.put("version_android", Build.VERSION.RELEASE); |
OlderNewer