Coder Social home page Coder Social logo

android-build-type-demo's Introduction

android-build-type-demo

This is a simple Android project to show how to use build types with the Gradle based build system. This project can be imported into Android Build Studio but not Eclipse (as of this commit).

#Custom Build Types The Android plugin for Gradle allows the creation of custom build types. Here, a new build type dev is created that inherits all of the properties from the default debug build type.

android {
    compileSdkVersion 18
    buildToolsVersion "18.0.1"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }

    buildTypes {
        dev.initWith(buildTypes.debug)
    }
}

This now allows for a new src tree to be created in the project structure:

BuildTestApp
-->
    src
    -->
	    dev
		main

Here, the dev source tree contains only one file, and that is a strings.xml file. When building for the dev build type these strings will override any existing strings in the main build type and append any strings that do not already exist.

#Environment Setup The only requirement is to have ANDROID_HOME defined as an environment variable.

#Building

##Building With Gradle Wrapper The gradle wrapper allows anyone to run gradle commands without having to install Gradle on their machine. The gradle wrapper is included with every new Android Build Studio project and can be also run from the command line. By default, the gradle wrapper (gradlew.exe) is in the root of the project directory.

##Build with Dev API keys To build the app with API keys for a dev environment, run the command:

gradlew assembleDev

##Build with Production API keys To build the app with API keys for a production environment, run the command:

gradlew assemble

android-build-type-demo's People

Contributors

sababado avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.