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
import android.os.Build; | |
import android.os.Trace; | |
import android.support.annotation.NonNull; | |
/** | |
* A wrapper for {@link Trace}, which is unavailable on SDK versions under 18 (Jelly Bean MR2). | |
* Using any methods of this class on versions below 18 will result in a runtime exception. | |
*/ | |
public class Tracer { | |
private static final int REQUIRED_SDK = Build.VERSION_CODES.JELLY_BEAN_MR2; |
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
import java.util.ArrayList; | |
import java.util.Collection; | |
/** | |
* An {@link ArrayList} implementation that does not accept null values. Attempts to add | |
* <code>null</code> using any of the add methods will result in an {@link IllegalArgumentException} | |
* being thrown. Attempts to addAll from a Collection that contains null elements will also result | |
* in an exception. | |
* <p/> | |
* Here's why: <a href="https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained">UsingAndAvoidingNullExplained</a> |
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
# A command line utility for automatically connecting ADB (Android Debug Bridge) to a USB connected Android device | |
# Records the status of the wifi interface on the device | |
adb shell ifconfig wlan0 > line | |
if [ "$?" -gt 0 ] | |
then | |
echo "Couldn't read IP address from device. Is it connected via USB?" | |
exit 1 | |
fi |