Skip to content

Instantly share code, notes, and snippets.

View shahzar's full-sized avatar

Shahzar Ahmed shahzar

View GitHub Profile
@shahzar
shahzar / FullScreenDialog.java
Last active July 22, 2016 10:31
Android Dialog Fragment which takes almost full screen space.
public static class CreateItemDialog extends DialogFragment {
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
return super.onCreateView(inflater, container, savedInstanceState);
}
@Override
@shahzar
shahzar / get_db.sh
Last active November 15, 2016 07:56
Script to Pull Android SQLite Database from phone. (Supports non-rooted devices too)
#!/bin/bash
#
#
# Script to pull SQLite database from an Android device/emulator
# By: Shahzar Ahmed
#
#
#
echo "============================"
echo "=== SQLite DB Pull Script =="
@shahzar
shahzar / TruecallerLikePopup.md
Last active February 21, 2017 05:36
Custom dialog similar to that of Truecaller's.

Truecaller like pop-up dialog

The Activity ...

public class PopupActivity extends AppCompatActivity {

    public static PopupActivity instance;

    @Override

protected void onCreate(@Nullable Bundle savedInstanceState) {

@shahzar
shahzar / connectViaWifi.sh
Last active May 16, 2018 09:47
Bash script to connect device via adb over wifi
#!/bin/bash
adb tcpip 5555
sleep 2
ip=`adb shell ifconfig | awk '/inet addr:/{print $2}' | awk -F: '/addr:/{print $2}' | tail -n 1`
echo Connecting at IP $ip
echo Detatch device and press [ENTER] to continue
read
adb connect $ip