7

There are a couple of tutorials or even questions here about creating an application for Android. But I was wondering, if I just want to compile an application from the available source on Github, I'm not going to develop anything, do I need to install the Android SDK, Eclipse with ADT plugin, and the SDK tools and platforms?

In GNU/Linux you just have to install the build tools and dependency libraries, not an IDE, which is generally for doing the development. How would you proceed in compiling the APK? Not that I want it to be like GNU/Linux, but what are the required tools just for compiling? And do I need to downgrade my Java version to 6 when I'm compiling for Android 4.1.2 (if Java is needed)?

Also, there are no build instructions on the source, including a few steps on your answer would be highly appreciated!

closed as off-topic by bmdixon, Matthew Read Apr 4 '15 at 20:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about writing and publishing Android apps, writing custom ROMs, and other topics that are primarily of concern to developers are off-topic. Consider taking advantage of other resources that may be appropriate for your question." – bmdixon, Matthew Read
If this question can be reworded to fit the rules in the help center, please edit the question.

9

The minimal requirements for building an Android app are usually the Android SDK and ant. Then, you are able to build the majority1 of projects with the following steps.

  • If there is no build.xml generate it

android update project -p . -n $PROJECT_NAME -s

  • Then build the project with

ant debug

which will create an .apk signed with your debug key.

All other dependencies range from the used VCS (e.g. git), over the required 3rd party libraries, up to other required build tools (e.g. Android NDK).

1 Why did I write majority? Because there is no definitive answer for such a question, as it simply depends on the used build system and the overall build setup of the project.

Let's have a look at F-Droid's metadata, which is a big database of build recipes for FOSS Android apps. You will find that there are many ways how an Android app can be build. For example goo.TeaTimer has a very clean and short build recipe, namely none, which defaults basically to F-Droid using ant debug to create the .apk. On the other hand, org.transdroid.full requires a few more steps to create the .apk: First the transdroid core library needs to be created, that is the ant -f ../lib/build.xml line in prebuild, then options are disabled with the sed command. Now the final .apk can be built.

  • I've updated my answer. Note that prebuild is F-Droid specific. It's the directive for commands that are run in the pre-build stage. – Flow Jan 3 '14 at 18:54
  • Your command doesn't work because it lacks a AndroidManifest.xml, and the error from running is "Unable to load key from Google Drive, retrying: null" – Teresa e Junior Jan 4 '14 at 21:06
  • The command was incorrect rendered. I've edited it. It's the same command F-Droid and I use within my Android project to generate build.xml. I've took a closer look at keepshare: It uses sbt (simple build tool) and is a good example for a project which does not use ant but instead some other build tool. Therefore the commands and tools to build the project differ. – Flow Jan 4 '14 at 21:32
  • 1
    Your answer still isn't relevant for Keepshare. The real answer is provided in comment #3. – daithib8 Jan 6 '14 at 20:32
  • 1
    That's right. I think more users benefit from an general answer compared to a specific one. OP already figured out that SBT is the used build tool. – Flow Jan 6 '14 at 20:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.