Can I develop Android apps without an IDE?

前端 未结 5 1905
说谎
说谎 2021-01-31 08:38

Is it possible to develop Android apps using only the Android SDK, without any IDE like Android Studio?

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 09:24

    Yes, see the Google SDK documentation.

    However, with the current toolchain and documentation it'll be an uphill struggle. I'm trying to do this too (for a dev who lives in Vim and Unix tools, Android Studio is needlessly slow and bloated).

    The main issues I've found so far:

    1. The SDK documentation gives instructions to create an Ant-driven project, but the SDK is now geared towards using Gradle. If you're working through the Google documentation in a linear fashion, you'll find subsequent lessons have you issue Gradle build instructions. For your Ant-built project.

    2. There is very little documentation on how to actually create a Gradle-built project from the command line. The command line I use is:

      android create project --target android-22 --name MyProjectName --path my_project/ --activity MyProject --package com.example.android.myproject --gradle --gradle-version 1.2.2

      The --gradle-version actually refers to the Gradle Android plugin version, not the version of Gradle itself. Finding this out wasn't easy.

    3. Even if you get it to create a project properly, it probably won't build without further manipulation. One of the generated files (project/build.gradle) has an invalid directive name (runProguard - I'm guessing it's now deprecated). That must be changed to minifyEnabled before the project will build. And using the Gradle plugin 1.2.2, the file project/gradle/wrapper/gradle-wrapper.properties has the Gradle distribution incorrectly listed as gradle-1.2.2-all.zip. This should be gradle-2.2.1-all.zip.

      These are files generated by the SDK with errors.

    4. The documentation is focussed on IDE-based development. Once you get past the initial few pages on creating and managing a project using the command line, it's very IDE-focussed.

      Instructions on things like changing an app Theme are difficult or impossible to follow as they omit steps that the IDE performs for you.

    In general, fully IDE-less development for Android (at least in Java, using the official SDK) is very painful. And my personal opinion is that IDE-based development is equally painful (slow, bloated, ugly on high-DPI screens under Linux and evidently full of magic that's a pain to replicate on the command line).

    Edit: I should add that the above refers to using SDK tools v24.2, SDK Platform-tools v22, SDK Build-tools v22.01 and Android API 22 (5.1.1).

提交回复
热议问题