Skip to content

Instantly share code, notes, and snippets.

View chrishuan9's full-sized avatar
🎯
Focusing

Chris Huang chrishuan9

🎯
Focusing
View GitHub Profile
@chrishuan9
chrishuan9 / gist:3184370
Created July 26, 2012 20:40
Numberpicker.java
/*
* Copyright (c) 2010, Jeffrey F. Cole
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
@chrishuan9
chrishuan9 / gist:3184373
Created July 26, 2012 20:40
TimePicker
/*
* Copyright (C) 2011 Morphoss Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@chrishuan9
chrishuan9 / gist:3192782
Created July 28, 2012 10:14
50/50 Layout Split with RelativeLayout in Android by using an invisible View and centering it
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<View android:id="@+id/strut"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_centerHorizontal="true"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
@chrishuan9
chrishuan9 / gist:3236162
Created August 2, 2012 10:41
DateFormat.java
import java.text.*;
import java.util.*;
public class DateFormat {
public static void main(String args[]) {
String s;
Format formatter;
@chrishuan9
chrishuan9 / listADB
Last active January 2, 2016 16:09
List your Android Debugging Devices
<SDK>$ adb devices
List of devices attached
02ccbd8c093efac2 device
@chrishuan9
chrishuan9 / startADBtcpip
Created January 9, 2014 02:17
This command restarts adb in tcp/ip mode for connecting to mobile phones via wifi
<SDK>$ adb tcpip 5555
restarting in TCP mode port: 5555
@chrishuan9
chrishuan9 / ADBconnect
Created January 9, 2014 02:20
Connecting ADB to your phone
<SDK>$ adb connect 10.1.1.161 #replace 10.1.1.161 with your phone's ip address
connected to 10.1.1.161:5555
@chrishuan9
chrishuan9 / gist:8328376
Created January 9, 2014 02:22
Listing ADB Devices connected over WiFi
<SDK>$ adb devices
List of devices attached
10.1.1.161:5555 device
@chrishuan9
chrishuan9 / listInstalledPackagesAndroid
Created January 9, 2014 02:30
Dumping package list of installed applications on your android device
>$ adb shell pm list packages
#will give you a list of all installed package names.
#You can then use dumpsys | grep -A18 "Package \[my.package\]" to grab the package information such as version identifiers etc
@chrishuan9
chrishuan9 / gist:8389104
Last active September 6, 2022 07:49
playing with awk
chris@opteron:~$ ls -la | awk '{ print $1 $9 }'
total
drwx------.
drwxr-xr-x..
drwx------.aptitude
-rw-------.bash_history
-rw-r--r--.bash_logout
-rw-r--r--.bashrc
drwx------.config
drwxr-xr-x.flexget