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 static boolean isDeviceTablet(String deviceId, int screenHeight, int screenWidth) { | |
try { | |
Process getDensity; | |
if (deviceId != null) { | |
getDensity = new ProcessBuilder("adb", "-s", deviceId, "shell", "getprop", "ro.sf.lcd_density").start(); | |
} else { | |
getDensity = new ProcessBuilder("adb", "shell", "getprop", "ro.sf.lcd_density").start(); | |
} | |
getDensity.waitFor(); | |
int deviceDpi = Integer.parseInt(convertStreamToString(getDensity.getInputStream()).replaceAll("[^0-9]", "")); |
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
# first turn off accelerometer controlling the orientation | |
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0 | |
# then set orientation | |
shopt -s nocasematch | |
if [ "$ORIENTATION" == "portrait" ] | |
then | |
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0 | |
elif [ "$ORIENTATION" == "landscape" ] | |
then |
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
adb shell setprop persist.sys.timezone ${TIMEZONE} |
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
RERUN_OPTIONS=$(sed -e "s|com/|classpath:com/|g" rerun.txt) | |
eval $(echo mvn clean test $(echo -D$(printf cucumber.options=\""$RERUN_OPTIONS"\"\ "$ARGS"))) |
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
eval $(echo mvn clean test $(echo -D$(printf cucumber.options=\"--tags\ "$TAGS"\"\ "$ARGS"))) |
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
getDevices () { | |
DEVICES=($(adb devices | grep "device$" | sed -e "s|device||g")) | |
for i in {1..9} | |
do | |
FOUND=0 | |
for j in ${DEVICES[@]} | |
do | |
if [ "$j" == "192.168.56.10${i}:5555" ] | |
then | |
FOUND=1 |
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
#include <iostream> | |
#include <limits> | |
using namespace std; | |
int main(){ | |
char var[10]; | |
bool valid = false; | |
while(!valid){ | |
cout << "Enter a string 9 characters long: "; |