Skip to content

Instantly share code, notes, and snippets.

@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@dmarcato
dmarcato / Main.java
Last active May 21, 2020 10:25
De/Serialization of generic SparseArray using Gson library
import android.util.SparseArray;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
public class Main {
public static class MyCustomClass {
public int a;
/**
* apply this plugin after doing all dependency and repo stuff. It will create two idea 'libraries' per subproject
* and add them to your .iml files
*
* Forked from https://gist.github.com/360092
*
* Plugin-ified and made to support multiple modules per root build.gradle and multiple build.gradles per idea project.
*/
class IntelliJSync implements Plugin<Project> {
def sep = File.separator