Android Studio is the official development environment for building (and testing) android apps. We will use Android Studio to write the code for our app, customise its appearance and fix any bugs. You can download Android Studio here.
When installing Android Studio, for our purposes it will be fine to select the default/standard options. You will, however, likely want to install the Android Virtual Device so you can test your app on your computer.
It is recommended you have up to 4 GB of free hard drive space to store all the parts of Android Studio and any project files.
Once Android Studio has been downloaded and installed, you can begin to create your first app. When opening Android Studio for the first time, you may be prompted to 'Import Studio settings from...'. If this happens then select Do not import settings. Next, when you reach the Welcome to Android Studio menu, click Start a new Android Studio project
You will now have the opportunity to choose a project template. Basic Activity and Empty Activity are the most commonly used project templates. The Basic Activity gives your app a readymade action bar and button, while the Empty Activity loads a blank user interface. If you are unsure which Activity type is most suitable for your project then selecting Basic Activity is usually a safe bet.
After selecting a project template you will reach the Configure your project menu. First, you must name the app and package. The package name is the extension for a website domain (e.g. .com) followed by the names of the website and app. A package name only really matters if you intend to publish the app to the Play store so if this is not a concern then use a made-up website domain. Next, select where you would like to save the files for your app and choose the programming language. The tutorials on this website will use Kotlin. Finally, you must specify the minimum android programming interface (API) level. The API determines which android SDK (Software Development Kit; a package of coding tools) your app will use. Higher API levels offer more advanced functions but are only supported by newer devices. API 26: Android 8.0 (Oreo) is a reasonable one to go for at this stage. As time goes on and more people upgrade their devices then we can begin to transition to the higher API levels.
Click Finish to create your project.
The main workspace is called the editor. If you open Kotlin files such as MainActivity.kt then the editor will load the file in Code mode as shown below:
Code mode allows you to edit the raw text code of the file. Some file types such as XML also have other editor views called Split and Design mode. Design mode is shown below and gives you an indication of how the file will look when loaded in the app. You can edit files in Design mode by dragging and dropping objects.
Split mode displays both the Code view and the Display view simultaneously so you can see the effect that changes in the code have on the layout (and vice versa) in real-time. You can toggle between the different view modes using the buttons in the top right corner of the editor.
When in Design mode, you can add objects and other items to your app by dragging and dropping them from the Palette. For example, in the activity_main.xml file, you can open up the Palette by clicking the tab near the top left-hand corner of the editor. When expanded, the palette will look like this:
In the palette, the left column lists the different categories of available objects, while the right column contains all the objects for you to drag and drop into the editor. We will explore these objects more in upcoming tutorials.
x10hosting offers free and fast web hosting as well as other extras for your website such as custom email address and SQL databases. Creating a free or premium account using this link will help support this site.