Skip to content

Instantly share code, notes, and snippets.

@dmytrodanylyk
dmytrodanylyk / description.md
Last active June 20, 2022 15:00
Where this dependency comes from?

Did you ever have android build failed​ issue because of dependency resolution?

… or you were curious where all these old rxjava dependencies come from?

You can pretty easy track the module causing issues via following gradle command.

gradlew :root-module:dependencyInsight \
--configuration debugRuntimeClasspath \ // or debugCompileClasspath
--dependency io.reactivex:rxjava:1.1.0 > dependencies.txt // saves result to 'dependencies.txt' file
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@koral--
koral-- / strings.xml
Created January 14, 2018 18:13
XML entity in strings.xml
<!DOCTYPE resources [
<!ENTITY foo "Foo">
]>
<resources>
<string name="app_name">&foo;</string>
<string name="busy_warning">Sorry, &foo; is working hard, please try again in a moment.</string>
<string name="trademark">&foo; is a registerd trademark, all rights reserved.</string>
</resources>
@Arinerron
Arinerron / permissions.txt
Last active March 27, 2024 04:59
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
public class NetworkLogUtility {
public static void logFailure(Call call, Throwable throwable){
if(call != null){
if (call.isCanceled())
Timber.e("Request was cancelled");
Request request = call.request();
if(request != null){
HttpUrl httpUrl = request.url();
@TouchBoarder
TouchBoarder / MainActivity.java
Created April 9, 2016 12:15 — forked from lisawray/MainActivity.java
Vector drawables from XML with the Android support library 23.3.0
package com.xwray.vectorbinding;
import android.databinding.BindingAdapter;
import android.databinding.DataBindingUtil;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
@mannodermaus
mannodermaus / LoganSquareConverter.java
Last active September 16, 2021 12:28
LoganSquare Retrofit Converter
package retrofit.converter;
import com.bluelinelabs.logansquare.LoganSquare;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import retrofit.converter.ConversionException;
import retrofit.converter.Converter;
@chrisbanes
chrisbanes / SystemUiHelper.java
Last active March 2, 2024 18:57
SystemUiHelper
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@rivol
rivol / Util.java
Last active November 29, 2017 06:54
get retrofit error response's body
package com.gateme3.app.util;
import android.location.Location;
import android.location.LocationManager;
import android.util.Log;
import com.gateme3.app.db.PurchasedItem;
import com.gateme3.app.db.Venue;
import java.io.ByteArrayOutputStream;
@prcaen
prcaen / MyActivity.java
Created January 8, 2014 09:11
The Android ActionBar Tips
// How make the ActionBar title clickable on Android under API 11 (1/2)
private static final boolean API_LEVEL_UNDER_11 = android.os.Build.VERSION.SDK_INT < 11;
private boolean navigationDrawerEnabled = true; // Useful if your app need navigation drawer
@Override
protected void onCreate(Bundle savedInstanceState) {
if (API_LEVEL_UNDER_11) {
getSupportActionBar().setCustomView(R.layout.partial_actionbar);
getSupportActionBar().setDisplayShowCustomEnabled(true);