Tuesday, October 2, 2018

Android Studio Tutorial – Hello World App


We’ll go with the New Project option here. However, you can choose Import Project if you’d like to import a project from, for example, Eclipse, into Android Studio. Android Studio will convert the Eclipse project to an Android Studio project, adding the necessary configuration files for you.
If you select Open Project from the list of options, you can open projects created either from the list of recent projects or by browsing the file system.


Android Studio Tutorial – New Project

Let’s create a new project using the wizard shown in the Quick Start section of the welcome screen. Enter some name for the application, let’s say “Hello World” and make sure your package name is unique.
If you own some domain say yourdomain.com, then your package could be com.yourdomain.app_name. While uniqueness isn’t of concern here, it will be important for an application that needs to be published to play store. Google Play Store distinguishes apps by the package name only.
android studio tutorial create new project
Click “Next” button again and you’ll be presented with a list of platforms where you want your application to run along with separate SDKs list since different platforms require different SDKs list.
android studio new project sdk selection
On the next screen you’ll be presented with a list of activity types. The default Blank Activity is good enough for this project.
android studio tutorial select activity
Click Next. This screen is an Activity configuration screen. Since you asked ADT to create an activity for you, this screen helps you in configuring relevant options.
android studio project customize activity
  1. Activity Name: Let’s stay with the default name MainActivity.
  2. Layout Name: ADT that creates activity for you, will also create a layout for you to bind it with the activity.
  3. Title: It specifies the title of the activity.
  4. Menu name: This is used to provide menu options. Keep default name only.
Click finish and wait for a few seconds for Gradle to do its magic.
Gradle is an advanced build toolkit that manages dependencies and allows you to define custom build logic. Android Studio uses a Gradle wrapper to fully integrate the Android plugin for Gradle.
The Android plugin for Gradle also runs independent of Android Studio. This means that you can build your Android apps from within Android Studio or from the command line on your machine or on machines where Android Studio is not installed.
android studio gradle build
Once you click Finish ADT will create your new project and will open Java code and Layout code for you.
android studio hello world project layout
By now you might be wondering how do you change your default white theme to the dark theme shown in the snippets. Go to menu Android Studio > Preferences, choose IDE Settings > Appearance.  Change the ‘Theme’ from ‘Default’ to ‘Dracula’.
android studio dracula theme settings

Monday, October 1, 2018

Android Introduction

Welcome to the Android Studio Tutorial. Android is an open source and Linux-based operating system for mobile devices such as smartphones and tablet computers. Android was developed by the Open Handset Alliance (OHA), which is led by Google, and other companies like Samsung, Sony, Wipro and many more.
First android smart phone image.
Android is the most popular mobile operating system, with almost 2 billion devices activated and it offers a unified approach to application development for mobile devices.

Installing Android Studio
In order to write an Android application, we are going to need a development environment. Google has made a very useful tool for all Android Developers, the Android Studio. Android Studio is the official IDE for Android development, and with a single download includes everything you need to begin developing Android apps. Included in the download kit, are the Software Development Kit (SDK), with all the Android libraries we may need, and the infrastructure to download the many Android emulator instances, so that we can initially run our application, without needing a real device. So, we are going to download and install Android Studio.
First we have to have installed the Java Development Kit (JDK) from Oracle. If you do not, please you should download the latest JDK from the Oracle’s special section here.

Install link is given below
https://developer.android.com/studio/install