This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDK_HOME_PATH="$HOME" | |
SDK_PATH="$SDK_HOME_PATH/android-sdk-linux" | |
# Needs to be updated when new releases are made | |
SDK_DOWNLOAD_URL="http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz" | |
curl --location $SDK_DOWNLOAD_URL | tar -xz -C $SDK_HOME_PATH | |
# Just install platform-tools, build-tools & Android-19 | |
# Filter names are from `android list sdk -e -a` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://creativecommons.org/licenses/by-sa/4.0/ | |
Creative Commons Attribution-ShareAlike 4.0 International Public License | |
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. | |
Section 1 – Definitions. | |
Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can place it in the root build.gradle | |
allprojects { | |
tasks.withType(JavaForkOptions) { | |
// Forked processes like GradleWorkerMain for tests won't steal focus! | |
jvmArgs '-Djava.awt.headless=true' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
... | |
deviceProvider new AwesomeDeviceProvider(getAdbExe()) | |
} | |
class AwesomeDeviceProvider extends com.android.builder.testing.ConnectedDeviceProvider { | |
AwesomeDeviceProvider(File adbLocation) { | |
super(adbLocation) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yourapp; | |
import java.io.File; | |
public final class RootStatus { | |
private static RootStatus instance; | |
private final boolean rooted; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The Factory | |
public final class VehicleFactory { | |
// private constructor => can't be instanciated, final can't be extended since the constructor is not reachable for a subclass | |
private VehicleFactory (){ | |
// no-op | |
} | |
public static Vehicel Vehicle produceVehicle(String name, String manufacturer, int horsepowerInPS){ | |
return new Vehicle(name, manufacturer, horsepowerInPS); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="vertical"> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:id="@+id/group_image" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// your code | |
apply from: "build-plugins/idea-gradle-sources.gradle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
@REM Jack is only available from build tools version 21.1.0 and up. Install/Update via SDK Manager | |
SET BUILD_TOOLS_VERSION=21.1.2 | |
java -jar %ANDROID_HOME%/build-tools/%BUILD_TOOLS_VERSION%/jack.jar %1 %2 %3 %4 %5 %6 %7 %8 %9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
// .. set up build flavors etc here | |
//instead of "app-release.apk" this method will rewrite the name to | |
// "MyCoolCompany-MyGreatProduct-v<defaultConfig.versionName>-RELEASE.apk which is much better suited for archiving and overall handling | |
// To restore the default behavior just delete the whole block below | |
applicationVariants.all { variant -> | |
def apk = variant.outputFile; |
NewerOlder