Skip to content

Instantly share code, notes, and snippets.

@jaredsburrows
jaredsburrows / MainActivity
Created February 11, 2014 19:25
Send Feedback
import java.io.PrintWriter;
import java.io.StringWriter;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ApplicationErrorReport;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
@jaredsburrows
jaredsburrows / GoogleFeedbackUtils
Created February 11, 2014 19:26
GoogleFeedbackUtils - Google's Feedback
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Binder;
import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException;
import android.util.Log;
@jaredsburrows
jaredsburrows / Java Client
Created March 9, 2014 20:44
Basic Client and Server in Java
import java.io.BufferedInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.net.Socket;
public class Client {
public static void main(final String[] argv) throws Exception {
final File folder = new File(System.getProperty("user.dir"));
android.applicationVariants.all { variant ->
if (variant.install) {
tasks.create(name: "run${variant.name.capitalize()}", type: Exec,
dependsOn: variant.install) {
group = 'Run'
description "Installs and Runs the APK for ${variant.description}."
def getMainActivity = { file ->
new XmlSlurper().parse(file).application.activity.find {
it.'intent-filter'.find { filter ->
return filter.action.find {
##########################################################################################
# App Compat
#
# https://code.google.com/p/android/issues/detail?id=78377
# https://github.com/albertvaka/kdeconnect-android/blob/master/proguard-rules.pro
# http://stackoverflow.com/questions/24809580/noclassdeffounderror-android-support-v7-internal-view-menu-menubuilder
##########################################################################################
-keep class !android.support.v7.internal.view.menu.*MenuBuilder*, android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
@jaredsburrows
jaredsburrows / gist:fced94509051888022e9
Created October 24, 2015 00:22 — forked from kriegerd/gist:4688748
Multi artifact UploadArchives from a Gradle build file.
artifacts {
archives file: 'A.jar', name: 'A', type: 'jar'
archives file: 'B.jar', name: 'B', type: 'jar'
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: "dav:https://myRepo.com/release/") {
@jaredsburrows
jaredsburrows / JsonApiConverter.java
Created December 15, 2015 09:33 — forked from Gregadeaux/JsonApiConverter.java
JSONAPI Converter for RetroFit with RxJava and RetroLambda
package ai.cometandroid.network;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.internal.LinkedHashTreeMap;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@jaredsburrows
jaredsburrows / HelpActivity.java
Created January 2, 2016 04:07
Google Feedbacl Utilities
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chromoting;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chromoting.jni;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.ui;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.Log;
import android.view.SurfaceView;