Java 如何在不使用 Android Studio 的情况下制作 Android 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32643297/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 12:53:56  来源:igfitidea点击:

How to make an Android app without using Android Studio?

javaandroid

提问by jeet

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

我下载了 Android Studio 并安装了它。当我启动它时,它都是“图形化的”。我的屏幕阅读器没有读取任何内容。

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?

如果我可以使用我的记事本应用程序,我更愿意,但“独立”教程太累人了,而且网络上没有多少教程有使用记事本制作应用程序的说明。我想知道是否有替代 IDE 或其他编写 Android 应用程序的方法?

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.

Java IDE Eclipse 也与我的屏幕阅读器不太兼容。我使用 Freedom Scientific 的 JAWS 屏幕阅读器。我曾经使用记事本编写 Java 桌面软件,所以我熟悉使用记事本编程。

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 :)

另外,如果我以某种方式弄清楚如何使用记事本制作 Android 应用程序,我将如何测试它们?我需要电话吗?对于所有这些初学者问题,我很抱歉,但我是初学者:)

回答by yelliver

You can follow this link: http://developer.android.com/tools/building/building-cmdline.htmlIf 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.

你可以点击这个链接:http: //developer.android.com/tools/building/building-cmdline.html如果你只想构建而不是运行,你不需要手机。如果您想在没有手机的情况下进行测试,您可以通过在 Android SDK 文件夹中运行“AVD Manager.exe”来使用模拟器。

回答by njzk2

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.

过渡到 android studio 后的好处是,现在 android 项目的构建是使用 Gradle 完成的,并且可以完全通过命令行进行操作。因此,从技术上讲,您根本不需要 IDE。

Basically, every project has at list a build.gradlefiles that contains the instructions to build it, and you only have to launch Gradle with the appropriate command to compile your app.

基本上,每个项目都有一个列表build.gradle文件,其中包含构建它的说明,您只需使用适当的命令启动 Gradle 即可编译您的应用程序。

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.propertiesformat)

Yelliver 提到了从命令行构建应用程序的工具,还有用于创建项目结构和基本构建文件的工具:http: //developer.android.com/tools/projects/projects-cmdline.html(本文档不过,似乎并不完全是最新的,因为它提到了旧project.properties格式)

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.

有一部手机来运行你的应用程序肯定会更好更快地开发。模拟器远非完美,速度很慢,有时没有响应。在您的手机上安装其他应用程序也比在模拟器上安装更容易,以防您的应用程序与其他应用程序交互。

回答by Enes Aldemir

I wrote two small scriptsfor 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.

我在没有使用 Android Studio 的情况下为 Android 开发编写了两个小脚本。他们正在构建 apk 并将其安装在连接的设备上,并使用已安装应用程序的输出打开 logcat。这两个脚本在考虑 Android Studio 的所有功能时甚至还没有完成,但它们至少允许在您的手机上运行该项目。