Skip to content

Instantly share code, notes, and snippets.

Nexus 4

  • D/Simple (13903): auto
  • D/Simple (13903): infinity
  • D/Simple (13903): normal
  • D/Simple (13903): macro
  • D/Simple (13903): continuous-picture
  • D/Simple (13903): continuous-video

Galaxy Nexus

@twaddington
twaddington / adb-tcpip.md
Last active December 16, 2015 00:49
Android wireless debugging.
$ adb tcpip 5555
$ adb connect <device-ip-address>:5555

# Reset for usb
$ adb usb
@twaddington
twaddington / android-notify-vibrate.md
Created April 10, 2013 23:04
Controlling the vibrate behavior of Android notifications.
    AudioManager audioManager =
            (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    switch (audioManager.getRingerMode()) {
        case AudioManager.RINGER_MODE_NORMAL:
            if (mVibrate) {
                defaults |= Notification.DEFAULT_VIBRATE;
            }
            defaults |= Notification.DEFAULT_SOUND;
 break;
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.3'
}
}

MyProject/settings.gradle

include ':app', ':libraries:ActionBarSherlock:library'

MyProject/build.gradle

// The buildscript object bootstraps the Android build
buildscript {
    repositories {

mavenCentral()

@twaddington
twaddington / gist:5862667
Created June 25, 2013 21:37
Samsung Galaxy S4 - Camera supported picture sizes
D/Simple (23737): 4128x3096
D/Simple (23737): 4128x2322
D/Simple (23737): 3264x2448
D/Simple (23737): 3264x1836
D/Simple (23737): 2048x1536
D/Simple (23737): 2048x1152
D/Simple (23737): 1280x720
D/Simple (23737): 640x480
@twaddington
twaddington / HttpUtils.java
Last active December 28, 2015 20:39
Create a sane user agent string for network enabled Android applications.
/*
* Copyright 2013 Tristan Waddington. All rights reserved.
*
* 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
/*
* Copyright 2013 Simple Finance Corporation. All rights reserved.
*
* 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
@twaddington
twaddington / gist:7819524
Last active December 30, 2015 10:59
Cropping screens for Google Play

Google Play

You can easily use ImageMagick to strip the status and navigation bar off of your Google Play images.

Nexus 5

# Top and bottom
$ convert screen.png -crop +0+76 -crop +0-145 +repage screen_crop.png

Bottom only

@twaddington
twaddington / charities.md
Created December 12, 2013 19:15
Charitable Giving