58

I downloaded the Android studio and installed it. When I launched it, it's all "graphical". My screen reader is reading nothing on it.

I'd prefer if I could use my Notepad app, but the "stand alone" tutorials are too tiresome, and not many tutorials on the web have instructions making apps using Notepad. I wanted to know if there is an alternate IDE, or another way to code Android apps?

The Java IDE Eclipse is also not very compatible with my screen reader. I use JAWS screen reader by Freedom Scientific. I used to code Java desktop software using my Notepad, so I'm familiar with programming using Notepad.

Also, if I somehow figure out how to make Android apps using Notepad, how am I going to test them? Do I need a phone? I'm sorry for all these beginner questions, but I'm a beginner :)

halfer
  • 19,824
  • 17
  • 99
  • 186
jeet
  • 745
  • 3
  • 10
  • 15

4 Answers4

17

You can follow this link: http://developer.android.com/tools/building/building-cmdline.html If you only want to build, not run, you don't need a phone. If you want test without a phone you can use an emulator by running"AVD Manager.exe" in Android SDK folder.

yelliver
  • 5,648
  • 5
  • 34
  • 65
10

The good thing since the transition to android studio is that now the building of an android project is done using Gradle and can be piloted entirely by command line. So technically, you don't need an IDE at all.

Basically, every project has at least a build.gradle file that contains the instructions to build it. You only have to launch Gradle with the appropriate command to compile your app.

Yelliver mentionned the tools to build the app from the command line, there are also tools to create the project structure and the basic build files: http://developer.android.com/tools/projects/projects-cmdline.html (this documentation appears not to be entirely up-to-date, though, as it mentions the old project.properties format)

Having a phone to run your app is certainly going to be nicer and faster to develop. The emulator is far from perfect, quite slow, and sometimes not responsive. It is also easier to install other apps on your phone than on the emulator, in case your app interacts with other apps.

Small Boy
  • 147
  • 1
  • 8
njzk2
  • 38,969
  • 7
  • 69
  • 107
7

I wrote two small scripts for Android development without using Android Studio. They are building apk and installing it on the connected device and opening the logcat with the output of the installed application. This two scripts not even near to complete when to think all the features of the Android Studio but they are allowing to at least run the project on your phone.

Enes Aldemir
  • 93
  • 3
  • 5
1

Command-Line based Development Environments for Building and Debugging Android Applications

Summarized -- Based on the original question and the request of the bounty benefactor, this post shall elucidate:

  • How to create an Android project from Command-Line Interface (CLI), with the correct directory structure?
  • How to establish a CLI based development environment for building and debugging Android applications?

1. Creating Android Projects

Firstly, one has to note, that the exact structure of an Android project mostly depends on the used IDE, e.g. Android Studio, Eclipse, IntelliJ, and the build systems it supports, e.g. Gradle, Maven, Ant. However nobody is forced to use any of these. In contrary, one doesn't need to use any of them, as I explained and applied in my article "Mobile Development: APK Building on Mobile".

So there is actually no "correct" physical structure for an Android project, only a logical one like depicted in Fig.1.

Logical structure of an Android application project Fig.1. Logical structure of an Android application project

Nevertheless one can assume, that one would want to create an Android Studio alike project structure. Alas, as pointed out in the Android Development Documentation for the android tool, and discussed in the Stackoverflow thread "How to create an Android project from the command line", the once for this purpose provided android tool has become deprecated and isn't part of the official command-line tools anymore. All its functionality has been delegated to other tools. The automatic creation of Android projects is now done using Android Studio itself, as the official documentation says.

So for that there's no replacement on the CLI for now. One would have to create such kind of a project structure manually, or copy an existing Android Studio project as a basis.

2. Establishing a CLI based Development Environment

2.1. On Linux, Windows and MacOS

The Android Developer Documentations on the Android SDK Command-line Tools and the corresponding Release Notes are the first addresses for the documentation of the tools, considering setup, usage options and further notes.

The basic steps to setup a CLI based APK development environment are as follows.

  1. Set the environment variables as described in the documentation.
  2. Download the cmdline-tools, which include core tools as sdkmanager to manage the SDK components, avdmanager for emulators, as well as debugging and tuning tools like r8 and lint.
  3. Use sdkmanager to install the following packages:
    • build-tools -- Contains basic toolchain programs like aapt, apksigner, and d8.
    • platforms -- Contains the Android platform, i.e. API level, you want to develop for. Note, that you can use several platforms in parallel at need.
    • platform-tools -- Contains instruments, e.g. the important adb, that interface with the corresponding Android platform. Choose the platform-tools according to the before selected platforms packages.
    • ndk -- Needed for performant native programming.
  4. Use avdmanager to manage the Android device emulators of the Android SDK.
  5. If required, also install gradle according to the Installation guide. Gradle can then be used from CLI, as described in its Command-Line Interface user guide.

2.2. On Android

One can actually develop mobile applications right on a mobile device. Therefore one has to install the terminal emulator Termux on it. Installation and usage don't need rooting of the device. Its repositories provide packages for many purposes, inter alia all necessary tools for APK building.

Then there are two approaches to achieve a CLI based development within Termux.

One is to achieve essentially the same setup as on a desktop, like described above, by following meticulously this guide. Note, that this will need at least 6GB free storage, easily up to 10GB and more, on your mobile device.

Another is to use the free APK building tool apkbuilder. It is my slim solution which requires all in all, so with all necessary components, less than 800MB, and no further configuration. Works without restrictions considering the project's structure and complexity. Supports also projects using native C/C++ code besides Java. Kotlin support is envisaged for the next version. The complete guide for installation and usage is located here.

Epilogue

Several roads lead to Rome. Free available tools allow a purely CLI based development of Android applications both in desktop environments, and even on mobile devices themselves. Have fun!

Krokomot
  • 3,208
  • 2
  • 4
  • 20