Millions of people use computerized devices for calling, messaging, surfing, and more. Note that an operating system is used to power these devices. Among the well-known operating system is Android which is largely installed across the globe. Originally, Android was used on Mobile phones but with major advancements, it is used on tablets, smart TVs, wearables, notebooks, and others. To make the Android operating system known, well-utilized and efficient, an exercise known as android development is performed. Android development is creating applications for devices that run on the Android operating system. Note that, there are several programming languages involved in Android Development such as Java, C++, and Kotlin.
What is Android Studio?
The demand for devices using the Android operating system is high in the current market. Thus, android development is a major deal, and for it to be successful, developers must have the necessary tools offered by Android Studio and other platforms. Hence, Android Studio is an Integrated Development Environment(IDE) used to build and deploy android-based applications. Consider using it as a platform that gives you the leverage to build quality applications.
Features of Android Studio
- Fast Emulator: It is a feature-rich tool in android studio that tests how applications look on physical devices.
- A visual layout editor: It assists in quickly creating the layout by adding different attributes. This can be done either by hard-code or drag and drop.
- Code Template: You can make Android development easier using the built-in templates in android studio.
- Integration with Firebase: Chat applications can be developed using firebase connectivity. Also, firebase enables the creation of direct updates and provides databases connectivity
- Provides a flexible Gradle-based build system.
- Interactive preview: Android studio allows you to check the vector drawable preview such as you can see how an animation will look on a real device.
- Color Preview editor: It is on the left side of the editor.
- Supports Google Cloud Platform
System Requirements for Android Studio?
- Operating System: Android studio supports Mac OS, Microsoft Windows, and Linux Operating systems.
- Screen Resolution: Minimum of 1280×800
- RAM size:3 GB RAM size but for a better experience, consider 4 or 8 GB.
- Storage:4 GB recommended(1.5 GB required for Android SDK and emulator system image plus 500 MB for IDE)
- GNU C Library: Should be 2.19 or later.
Install Android Studio on Solus Linux
We will start by installing OpenJDK before we proceed to install Android Studio.
Install Java OpenJDK
To install Android Studio, install OpenJDK 8 or above. Update the Solus repositories first.
sudo eopkg upgrade
Then install OpenJDK 8 by executing this command.
sudo eopkg install openjdk-8
Continue and set the JAVA_HOME variable. The path you will use to set JAVA_HOME is /usr/lib64/openjdk-8.
sudo tee /etc/profile.d/jdk.sh <<EOF export JAVA_HOME=/usr/lib64/openjdk-8 export PATH=\$PATH:\$JAVA_HOME/bin EOF export JAVA_HOME=/usr/lib64/openjdk-8 export PATH=$PATH:$JAVA_HOME/bin
Source the profile using the below command.
Confirm the path you have set for JAVA_HOME.
To verify the installation was successful, check the version.
Here is the output after checking the Java Version.
$ java -version openjdk version "1.8.0_302-solus" OpenJDK Runtime Environment (build 1.8.0_302-solus-ga) OpenJDK 64-Bit Server VM (build 25.302-bga, mixed mode)
Install Android Studio
To install Android studio on Solus, let’s use an archive. We will get the archive by downloading it from the Android Studio official website download page. From your terminal use the following command to download Android Studio.
Extract the downloaded Android Studio file.
tar -xvzf android-studio-*-linux.tar.gz
Now install Android Studio.
After the installation, a configuration window will show up.
Configure Android Studio on Solus Linux
After the installation, you will be presented with a setup wizard. In the window that appears you can import Android Studio settings of the previous installation or choose not to import by clicking OK.
In the next step, allow Android Studio to send usage statistics to Google and click on Next.
A window will open welcoming you to the Android Studio setup wizard.
On the NEXT step, choose the installation type you want. There are two options which include standard and custom.
Select the theme you would prefer on Android Studio.
You will be presented with a preview of the installation settings. You can make changes if there are any.
Accept license agreement for Android SDK and proceed.
On the next window is Emulator Settings. Read the given information and click on Finish to proceed with the other steps.
Android Components will start downloading as shown below.
Click on Finish to complete the installation of Android Studio.
The Android Studio welcome page will appear.
Using Android Studio on Solus
Creating a New Project
With the successful installation of Android Studio on Solus, you can proceed to create your first application. On the Android Studio dashboard, click on New Project.
For your first Android project, you can select Phone and Tablet, then choose Basic activity template and click on Next.
Enter the name of your Android Project and choose the programming language you want to use.
Next, you will be presented with the created application information on a Text Editor.
Running a Project on Android Studio
Android has a build system known as Gradle which generates build files when you are creating an application. With Gradle, you can control your development process. Open it by navigating through app>src>main>res>layout>fragment_first.xml in android studio. Double click on fragment_first.xml for Gradle to appear on the screen.
To split screens, click on the split tab as illustrated below.
On the fragment_first.xml file, edit the file by adding the text you want on your application. Head to the TechView Section on the file. You will see the line below.
android:text="Hello first fragment"
Right-click on the line above then select Go To> Declarations or Usages.
After the step above, the strings.xml file will open. Replace the “Hello first fragment” with the text you want to appear on your application.
I will use ‘Welcome to FirstApp’ text.
To run the application, press the green play button or Run>Run ‘app’ from android studio.
The text will be displayed on the Gradle as shown below.
Android studio is an ideal integrated Development Environment (IDE) for application developers. It is a great tool for developing, testing, and deploying Android applications. Also, the Android studio is equipped with a fast-paced development platform and ensures high-quality output. To enjoy the tool on Solus, use this guide on how to install and configure Android Studio on your system.