Skip to content

Instantly share code, notes, and snippets.


Ty Smith tyvsmith

View GitHub Profile
tyvsmith /
Last active Aug 29, 2015
Android ListAdapter using custom ViewGroup over ViewHolder pattern
public class App {
public String id;
public String name;
public String icon_url;
public String toString() {
return name;

Keybase proof

I hereby claim:

  • I am tyvsmith on github.
  • I am tsmith ( on keybase.
  • I have a public key whose fingerprint is 6844 9AB2 4FC5 ECE7 78B7 31F9 AF0C C86E D089 D7EB

To claim this, I am signing this object:

tyvsmith /
Last active Sep 4, 2015
Composed View Holder with decoupled OnClickListener
package com.example.ui.utils;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
tyvsmith / AndroidManifest.xml
Created May 24, 2011
RESTclient-Android Blog entries
View AndroidManifest.xml
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".ui.Main" android:label="@string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<receiver android:name=".receiver.BootReceiver">
tyvsmith / AsyncBusinesNoteStoreClient notebook
Last active Dec 14, 2015
Listing notebooks using the AsynNoteStoreClient
View AsyncBusinesNoteStoreClient notebook
//Creating the business note store makes network requests
//to validate the auth token for the business
new OnClientCallback<AsyncBusinessNoteStoreClient>() {
public void onSuccess(final AsyncBusinessNoteStoreClient client) {
//This is running in the UI Thread
client.listNotebooks(new OnClientCallback<List<Notebook>() {
tyvsmith / CrashReporting
Created Aug 13, 2013
Report Custom events to Crashlytics without actually killing the process.
View CrashReporting
public class CrashReporting {
public static class GenericReportingException extends Exception {
public GenericReportingException(){}
public GenericReportingException(String str){
tyvsmith /
Created Jul 22, 2013
"`classes.dex` method count helpers. Requires smali/baksmali from and dexdump from the build-tools in the Android SDK be on your PATH." Use this to keep track of methods and fields in your apk. They are both limited to 65536. Example use: $ source; $ dex-field-count classes.dex; Original method scrip…
function dex-method-count() {
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
function dex-method-count-by-package() {
dir=$(mktemp -d -t dex)
baksmali $1 -o $dir
for pkg in `find $dir/* -type d`; do
smali $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
tyvsmith / EvernoteIntentActions
Last active Jan 9, 2017
Some helpful intents for interacting with the Evernote Android app.
View EvernoteIntentActions
public static final String SEARCH_NOTES = "com.evernote.action.SEARCH_NOTES";
public static final String VIEW_NOTE_LIST = "com.evernote.action.VIEW_NOTELIST";
public static final String NOTE_PICKER = "com.evernote.action.NOTE_PICKER";
public static final String VIEW_NOTE = "com.evernote.action.VIEW_NOTE";
public static final String NEW_NOTE = "com.evernote.action.CREATE_NEW_NOTE";
public static final String EDIT_NOTE = "com.evernote.action.EDIT_NOTE";
public static final String UPDATE_NOTE = "com.evernote.action.UPDATE_NOTE";
public static final String DELETE_NOTE = "com.evernote.action.DELETE_NOTE";
tyvsmith /
Last active Oct 26, 2018
If you have multiple Android apps that need to report to the same Crashlytics app endpoint. This allows overriding the package name that Crashlytics discovers and reports.
public class MyApp extends Application {
private final String PACKAGE="";
public void onCreate() {
Crashlytics.start(new CrashContextWrapper(this, PACKAGE));