Skip to content

Instantly share code, notes, and snippets.

View jaredrummler's full-sized avatar

Jared Rummler jaredrummler

View GitHub Profile

Android Auto SDK

Getting started

Setup your build environment

  • Install the latest version of the Android SDK. Make sure the following packages are present in the Android SDK:
    • Android SDK Build-tools 25.0.2
    • Android SDK Platform 24
  • Latest Android Support Repository
@jaredrummler
jaredrummler / COPYRIGHT_NOTICE_TEMPLATES.md
Last active February 3, 2025 15:19
Copyright templates for Intellij IDEA
@jaredrummler
jaredrummler / Reflect.kt
Last active June 25, 2019 20:47
Java reflection made easy using Kotlin
import java.lang.reflect.*
object Reflect {
private val cache = mutableMapOf<String, AccessibleObject>()
/**
* Get a method from a class
*
* @param obj
[
{
"pid":1629121,
"fn":"Jaylen",
"ln":"Adams",
"conf":"East",
"ta":"ATL",
"tn":"Atlanta Hawks",
"num":"10",
"pos":"G",

Cyanea

A theme engine for Android.
Themes are immutable, possibilities are beautiful.

License

@jaredrummler
jaredrummler / ANDROID_RESOURCE_HACK.md
Last active June 25, 2019 20:49
Hackity hack hack hack; Android resource attack
fun Resources.getValue(id: Int, resolveRefs: Boolean = true) = TypedValue().also {
  try {
    (if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
      Resources::class.java.getDeclaredField("mResourcesImpl").apply {
        isAccessible = true
      }.get(this)
    } else this)?.run obj@{
      this::class.java.getDeclaredMethod("getValue",
 Int::class.java, TypedValue::class.java, Boolean::class.java).apply {
@jaredrummler
jaredrummler / artifactory-push.gradle
Last active June 25, 2019 21:58
Helper to upload Gradle Android Artifacts to Maven repositories — https://github.com/chrisbanes/gradle-mvn-push
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.jaredrummler.usagestatsperm">
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions"/>
<application
android:allowBackup="true"
@jaredrummler
jaredrummler / Prefs.kt
Created May 15, 2018 05:20
Yet another SharedPreference helper written in Kotlin
import android.annotation.SuppressLint
import android.content.Context
import android.content.SharedPreferences
import android.preference.PreferenceManager
class Prefs(
private val preferences: SharedPreferences,
private val encryptor: StringEncryptor? = null,
private val obfuscator: Obfuscator? = null
) {
@jaredrummler
jaredrummler / AndroidManifest.xml
Last active June 25, 2019 21:01
Setup a FileProvider for Android with paths for root, external storage, and internal app files
<manifest package="com.jaredrummler.android.common"
xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<provider
android:name="com.jaredrummler.android.files.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data