Skip to content

Instantly share code, notes, and snippets.

@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 {
@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 / 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 / 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;
final OnVisibilityChangedListener searchVisibilityChangedListener = new OnVisibilityChangedListener() {
@Override
public void onShown(final FloatingActionButton fab) {
super.onShown(fab);
}
@Override
public void onHidden(final FloatingActionButton fab) {
super.onHidden(fab);
floatingActionButton.setImageResource(R.drawable.ic_search_white_24dp);
@jaredsburrows
jaredsburrows / gist:26bd0fe9f4c1dc7b3c37
Last active March 19, 2016 20:41
Java Integration Tests
// https://github.com/gradle/gradle/blob/master/subprojects/docs/src/samples/java/withIntegrationTests/build.gradle
// http://stackoverflow.com/questions/33751260/setting-up-integration-tests-in-android-gradle-based-project
// https://github.com/gradle/gradle/blob/21608d9b173fa53056563180575ec8c92df55dc7/gradle/integTest.gradle
apply plugin: 'java'
repositories {
mavenCentral()
}