Giter Site home page Giter Site logo

minimal-android-project's Introduction

minimal-android-project

This repository explores how simple it can be to set up a valid, working Android project. You will need:

  • One .java activity source file, placed in its appropriate package directory
  • One AndroidManifest.xml
  • One build.gradle
    • Certainly this is optional, as you can build the project using command line tools from the Android SDK. But let's not complicate things unnecessarily.

For more in-depth information about this repository, see my blog post.

How to build

$ git clone https://github.com/czak/minimal-android-project.git
$ gradle installDebug

The app will be installed on all devices accessible to adb.

Notes

This project makes a few assumptions about your environment in order to build correctly:

  • You have gradle 2.10 installed - there is no Gradle Wrapper included.
  • You have JAVA_HOME set up. If you have java in your path, you should be good to go.
  • You have ANDROID_HOME set to the root folder of your Android SDK installation.
  • SDK and build tools versions are hardcoded in build.gradle to 23 and 23.0.2, respectively.

Additionally, the folder structure relies on the source set convention expected by the Gradle Android plugin:

project
 ├── build.gradle
 └── src
     └── main
         ├── AndroidManifest.xml
         └── java
             └── pl
                 └── czak
                     └── minimal
                         └── MainActivity.java

Contact

Suggestions on how to minimize this further are welcome!

minimal-android-project's People

Contributors

czak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

minimal-android-project's Issues

Adding gradle-wrapper fails

I was trying to add gradle-wrapper for this project according to this instruction: https://docs.gradle.org/current/userguide/gradle_wrapper.html

So I ran the following command in the project directory:
gradle wrapper --gradle-version 2.0
and got an error:

scadge@scadge-Inspiron-3537 ~/minimal-android-project $ gradle wrapper --gradle-version 2.0

FAILURE: Build failed with an exception.

* Where:
Build file '/home/scadge/minimal-android-project/build.gradle' line: 10

* What went wrong:
A problem occurred evaluating root project 'minimal-android-project'.
> Failed to apply plugin [id 'com.android.application']
   > Gradle version 2.2 is required. Current version is 3.0. If using the gradle wrapper, try editing the distributionUrl in /home/scadge/minimal-android-project/gradle/wrapper/gradle-wrapper.properties to gradle-2.2-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.962 secs

I'm not sure that creating wrapper should work with this minimal project, so this is rather a question than a bug report. I was just hoping to create a minimal-android-project-with-gradle-wrapper and would appreciate any help :)

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.