Android Studio Tutorial: An Introduction – Developer.com
Android is one of the most popular mobile device platforms. The Android platform allows developers to write managed code using Java ( http://www.developer.com/java ) to manage and control the Android device. Android Studio is a popular IDE developed by Google for developing applications that are targeted at the Android platform. Note that Android Studio has replaced Eclipse as the IDE of choice for developing Android applications. This article presents a discussion on how to get started using the Android Studio for developing Android applications.
Android Studio contains tools such as the Android Virtual Device Manager and the Android Device Monitor. It also contains Gradle, which helps you configure your Android application seamlessly. Some of the interesting features of Android Studio include the following:
Assuming that Android Studio is installed in your system, we will explore how we can create a simple application using Android Studio in the section. Android applications are based on the Java programming language and make extensive use of XML. To create an Android application using Android Studio, follow these simple steps:
That’s all you need to do for now. Please be patient for a while because it would take some time for the project to be loaded. After a while, your first Android application will be created—default though, because it doesn’t have any custom code.
Let’s dig into a bit of code now. You can create user interfaces in Android applications using Java or XML. Let’s write some Java code to display a text message to the user. Refer to the class named MainActivity that was created by default. This class is created in the file named MainActivity.java and extends the AppCompatActivity class and contains the onCreate method. Note that any Android application can have one or more activities. An activity usually represents a screen. An activity may be defined as the visual representation of your Android application.
Replace the default code of the onCreate method with the following:
To run the application, press “Shift + F10”. When you run the application, here’s what the output would look like.
Figure 5: The finished application, running its output
Android Studio is a development IDE from Google that makes your life easier for developing Android applications. This article presented a discussion on how to get started using the Android Studio to build and develop Android applications. I will discuss more on developing Android applications using Android Studio in my future articles here. Happy reading!
© Source: http://www.developer.com/ws/android/android-studio-tutorial-an-introduction.html
All rights are reserved and belongs to a source media.