|
| 1 | +.. _tutorial-getting_started_with_androidide: |
| 2 | + |
| 3 | +Getting started with AndroidIDE |
| 4 | +=============================== |
| 5 | + |
| 6 | +This tutorial walks through the process of installing the build tools like |
| 7 | +JDK, Android SDK, etc. in AndroidIDE. |
| 8 | + |
| 9 | +.. _tutorial-getting_started_with_androidide-intro: |
| 10 | + |
| 11 | +Introduction |
| 12 | +------------ |
| 13 | + |
| 14 | +AndroidIDE is a feature-rich Integrated Development Environment (IDE) for developing Gradle-based Android |
| 15 | +applications on Android devices. The IDE offers an impressive range of features, including Gradle support, a |
| 16 | +Termux-based terminal with necessary packages, advanced Java and XML code completions. |
| 17 | + |
| 18 | +AndroidIDE is available for download from the `AndroidIDE website <https://androidide.com>`_ or |
| 19 | +from `GitHub releases <https://github.com/AndroidIDEOfficial/AndroidIDE/releases>`_. |
| 20 | + |
| 21 | +In this tutorial, we're going to walk through the steps required to setup the AndroidIDE build tools on your device. |
| 22 | + |
| 23 | +.. _tutorial-getting_started_with_androidide-minreq: |
| 24 | + |
| 25 | +Minimum requirements |
| 26 | +-------------------- |
| 27 | + |
| 28 | +Before installing and using AndroidIDE, it is essential to ensure that your device meets the minimum requirements to run |
| 29 | +the application. |
| 30 | + |
| 31 | +* Supported CPU - You must ensure that your device has a CPU architecture that is supported by AndroidIDE. The following |
| 32 | + CPU architecture is supported by AndroidIDE: |
| 33 | + |
| 34 | + - ``arm64-v8a`` - 64-bit ARM. |
| 35 | + - ``armeabi-v7a`` - 32-bit ARM. |
| 36 | + - ``x86_64`` - 64-bit ``x86``. |
| 37 | + |
| 38 | +* Enough **available** RAM - You will be working with the Gradle build system. Depending on the size of your project, |
| 39 | + you'll need enough **free RAM** so that the Gradle Daemon is not killed by the system. A minimum of **1.5GB - 2GB free |
| 40 | + RAM** is recommended. |
| 41 | + |
| 42 | +* Enough storage space - A minimum of 4GB free storage space is required. You'll need enough space for various Gradle |
| 43 | + distributions and dependencies, according to your project configuration. After the basic setup, around 1GB of space is |
| 44 | + used by AndroidIDE (without any dependencies or distributions installed). |
| 45 | + |
| 46 | +An internet connection is required for the initial setup. A **WiFi connection** is recommended. |
| 47 | + |
| 48 | +.. _tutorial-getting_started_with_androidide-install: |
| 49 | + |
| 50 | +Install AndroidIDE |
| 51 | +------------------ |
| 52 | + |
| 53 | +The first step is to install the latest AndroidIDE APK. You could download the APK from the following sources : |
| 54 | + |
| 55 | +* `The AndroidIDE Website <https://androidide.com>`_ |
| 56 | +* `GitHub Releases <https://github.com/AndroidIDEOfficial/AndroidIDE/releases>`_ |
| 57 | +* `GitHub Actions <https://github.com/AndroidIDEOfficial/AndroidIDE/actions>`_ only if you're willing to try out the |
| 58 | + latest, **unstable** builds. |
| 59 | +* `F-Droid <https://f-droid.org/packages/com.itsaky.androidide/>`_ |
| 60 | + |
| 61 | +.. warning:: |
| 62 | + F-Droid and GitHub builds are incompatible with each other! If you have already installed AndroidIDE from GitHub and if |
| 63 | + you try to install AndroidIDE from F-Droid, it won't be installed. Same goes for installing GitHub builds over F-Droid builds. |
| 64 | + |
| 65 | +Please make sure that you download the files only from the **trusted** sources above. Installing it from unknown sources |
| 66 | +may pose a security risk to your device. |
| 67 | + |
| 68 | +.. _tutorial-getting_started_with_androidide-basic_setup: |
| 69 | + |
| 70 | +Basic setup |
| 71 | +----------- |
| 72 | + |
| 73 | +Before getting started with building projects, you need to install the basic build tools which are necessary for the IDE |
| 74 | +to function properly. |
| 75 | + |
| 76 | +When you open the application for the first time, you'll be presented with the onboarding screen which will guide you to installing |
| 77 | +AndroidIDE and ask you for the following permissions : |
| 78 | + |
| 79 | +* **Storage** - Required to work with files on the File System. |
| 80 | +* **Install packages** - Required for installing apps built with AndroidIDE. |
| 81 | +* **Post Notifications** - For Android 13 and above, you need to grant the ``POST_NOTIFICATION`` permission. This will be |
| 82 | + used to show notifications on your device. |
| 83 | + |
| 84 | +There are three methods to install AndroidIDE: |
| 85 | + |
| 86 | +* Automated installation |
| 87 | + |
| 88 | + - Configure your installation with the GUI. This simply executes the ``idesetup`` script in the terminal. Once the installation is |
| 89 | + complete, it will automatically navigate you to the home screen. |
| 90 | + |
| 91 | + .. note:: |
| 92 | + Automated installation option is only available in **v2.7.0-beta** and newer. |
| 93 | + |
| 94 | +* Manual installation |
| 95 | + |
| 96 | + - ``idesetup`` script - provides you various options to install the tools. |
| 97 | + See :ref:`installation with idesetup <tutorial-getting_started_with_androidide-install_with_idesetup>`. |
| 98 | + |
| 99 | + - Fully manual - manually install the tools by yourself. Choose this if you have already downloaded the tools or if you want to install |
| 100 | + custom tools in AndroidIDE. This can also be beneficial if you frequently re-install AndroidIDE. |
| 101 | + :doc:`See the manual installation guide </tutorials/manual-installation>`. |
| 102 | + |
| 103 | +After you have granted the permissions, you'll be navigated to `Setup tools` screen which you can use to configure the installation. |
| 104 | +For example, you can choose to install `JDK 21` instead of `JDK 17` which is installed by default. |
| 105 | + |
| 106 | +The below images show the SDK installation GUI and the terminal activity respectively : |
| 107 | + |
| 108 | + |
| 109 | +.. raw:: html |
| 110 | + |
| 111 | + <div class="grid grid-cols-2 gap-2 overflow-x-auto"> |
| 112 | + <div class="flex flex-row items-start"> |
| 113 | + <img |
| 114 | + src="/_static/images/screenshots/installation_setup_tools.png" |
| 115 | + class="block mx-auto" |
| 116 | + width="250px" |
| 117 | + alt="Setup tools screen"/> |
| 118 | + <img |
| 119 | + src="/_static/images/screenshots/terminal.png" |
| 120 | + class="block mx-auto" |
| 121 | + width="250px" |
| 122 | + alt="Terminal"/> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | + |
| 126 | +.. _tutorial-getting_started_with_androidide-install_with_idesetup: |
| 127 | + |
| 128 | +Install the build tools with ``idesetup`` |
| 129 | +----------------------------------------- |
| 130 | + |
| 131 | +The AndroidIDE terminal includes the ``idesetup`` command which downloads and installs the required build tools for your |
| 132 | +device. It is a simple shell script which downloads the required files from |
| 133 | +the `androidide-tools <https://github.com/AndroidIDEOfficial/androidide-tools>`_ GitHub repo and extracts them at their |
| 134 | +proper location. It also installs the ``openjdk-17`` package. |
| 135 | + |
| 136 | +There are various options available in the script which you can use to customize the installation. However, **the |
| 137 | +default settings are always recommened**. To see the list of available options, you could execute the ``idesetup -h`` |
| 138 | +which should print an output similar to the following : |
| 139 | + |
| 140 | +.. code-block:: |
| 141 | +
|
| 142 | + AndroidIDE build tools installer |
| 143 | + This script helps you easily install build tools in AndroidIDE. |
| 144 | +
|
| 145 | + Usage: |
| 146 | + idesetup -s 33.0.1 -c -j 17 |
| 147 | + This will install Android SDK 33.0.1 with command line tools and JDK 17. |
| 148 | +
|
| 149 | + Options : |
| 150 | + -i Set the installation directory. Defaults to $HOME. |
| 151 | + -s Android SDK version to download. |
| 152 | + -c Download Android SDK with command line tools. |
| 153 | + -j Choose whether to install JDK 17 or JDK 21. |
| 154 | + -m Manifest file URL. Defaults to 'manifest.json' in 'androidide-tools' GitHub repository. |
| 155 | +
|
| 156 | + For testing purposes: |
| 157 | + -a CPU architecture. Extracted using 'uname -m' by default. |
| 158 | + -p Package manager. Defaults to 'pkg'. |
| 159 | + -l Name of curl package that will be installed before starting installation process. Defaults to 'libcurl'. |
| 160 | +
|
| 161 | + -h Prints this message. |
| 162 | +
|
| 163 | +In case you get an error saying ``bash: idesetup: command not found``\ , you could manually download and install the script |
| 164 | +with the following command : |
| 165 | + |
| 166 | +.. code-block:: |
| 167 | +
|
| 168 | + wget https://raw.githubusercontent.com/AndroidIDEOfficial/androidide-tools/main/scripts/idesetup -O $SYSROOT/bin/idesetup && chmod +x $SYSROOT/bin/idesetup |
| 169 | +
|
| 170 | +Now, **execute the following command** to start the build tools installation. |
| 171 | + |
| 172 | +.. code-block:: |
| 173 | +
|
| 174 | + idesetup -c |
| 175 | +
|
| 176 | +Once you execute the command, it'll print a summary of the configuration which you need to confirm. **Type ``y`` and press |
| 177 | +Enter** to confirm the configuration. The script will then start the installation procedure. |
| 178 | + |
| 179 | +.. code-block:: |
| 180 | +
|
| 181 | + ------------------------------------------ |
| 182 | + Installation directory : /data/data/com.itsaky.androidide/files/home |
| 183 | + SDK version : 33.0.3 |
| 184 | + JDK version : 17 |
| 185 | + With command line tools : true |
| 186 | + ------------------------------------------ |
| 187 | + Confirm configuration ([y]es/n[o]): y |
| 188 | +
|
| 189 | +The installation process may pause after some time and ask you for your confirmation about installing JDK 17. Just |
| 190 | +type ``y`` and press enter. |
| 191 | + |
| 192 | +The first screenshot below shows the terminal screen where the installation process is in progress and the second one |
| 193 | +shows the screen where installation process has been completed. |
| 194 | + |
| 195 | + |
| 196 | +.. raw:: html |
| 197 | + |
| 198 | + <div class="grid grid-cols-2 gap-2 overflow-x-auto"> |
| 199 | + <div class="flex flex-row items-start"> |
| 200 | + <img |
| 201 | + src="/_static/images/screenshots/installation-in-progress.png" |
| 202 | + class="block mx-auto" |
| 203 | + width="250px" |
| 204 | + alt="Installation in progress"/> |
| 205 | + <img |
| 206 | + src="/_static/images/screenshots/installation-completed.png" |
| 207 | + class="block mx-auto" |
| 208 | + width="250px" |
| 209 | + alt="Installation completed"/> |
| 210 | + </div> |
| 211 | + </div> |
| 212 | + |
| 213 | + |
| 214 | +Once the installation is completed, you can verify the installation by checking the Java version with ``java --version`` |
| 215 | +command. Your output must be similar to : |
| 216 | + |
| 217 | +.. code-block:: |
| 218 | +
|
| 219 | + openjdk version "17-internal" 2021-09-14 |
| 220 | + OpenJDK Runtime Environment (build 17-internal+0-adhoc.root.src) |
| 221 | + OpenJDK 64-Bit Server VM (build 17-internal+0-adhoc.root.src, mixed mode) |
| 222 | +
|
| 223 | +It is recommended to restart AndroidIDE after the installation. |
| 224 | + |
| 225 | +Congratulations! You've successfully installed the build tools in AndroidIDE. Now it's time |
| 226 | +to ::doc:`build your first project </tutorials/build-first-project>`. |
0 commit comments