Creating a New Project in Android Studio

Opened Android Studio, you see should a screen that looks like..

 

The Android Studio welcome screen contains an option for you to open existing projects that you might have already created in Android It also presents options for opening a project from VCS, and importing projects from other IDEs, such as Eclipse.

  1. Click the Start a New Android Studio Project option from the Android Studio welcome screen. You should now see the Create New Project screen , which enables you to configure some of the basic options

 

  1. The next screen allows you to select the form factor on which your application will run . For the purposes of this book, you exclusively use Phone and Tablet. The version of Android is Android N (or Nougat, depending on the version of the SDK you downloaded. As of the writing of this book, the name was officially announced as Nougat, but the SDK was still labeled N).
  2. The other options on this screen allow you to create applications that run on Android Wear, Android Auto, and the elusive Google Glass. If you are feeling adventurous after reading this book, feel free to try some of these other application form factor options. For now, make sure to select Phone and Tablet and Android N and click Next to continue.The next screen is the Add an Activity to Mobile screen, as shown in This screen is a helper that adds commonly used features to your project at the time the project is created.

The next screen is the Add an Activity to Mobile screen.This screen is a helper that adds commonly used features to your project at the time the project is created

Developer Community

The following are some developer communities and websites that you can turn to for help if you run into problems while working with Android:

➤       Stack Overflow (www.stackoverflow.com)—Stack Overflow is a collaboratively edited question-and-answer site for developers. If you have a question about Android, chances are someone at Stack Overflow is probably already discussing the same question. It’s also likely that someone else has already provided the answer. Best of all, other developers can vote for the best answer so that you can know which are the answers that are most trustworthy.

Google Android Training (http://developer.android.com/training/index.html)— Google has launched the Android Training site, which contains a number of useful classes grouped by topics. At the time of writing, the classes mostly contain code snippets that are useful to Android developers who have started with the basics. After you have learned the basics in this book, I strongly suggest you take a look at the classes.

➤       Android Discuss (http://groups.google.com/group/android-discuss)—Android Discuss is a discussion group hosted by Google using the Google Groups service. Here, you will be able to discuss the various aspects of Android programming. This group is monitored closely by the Android team at Google, so this is good place to clarify your doubts and to learn new tips and tricks.

Creating android Virtual devices (AVDs)

The next step is to create an Android Virtual Device (AVD) you can use for testing your Android applications. An AVD is an emulator instance that enables you to model an actual device. Each AVD consists of a hardware profile; a mapping to a system image; and emulated storage, such as a secure digital (SD) card. One important thing to remember about emulators is that they are not perfect.

There are some applications, such as games (which are GPU heavy) or applications that use sensors such as the GPS or accelerometer. These types of applications cannot be simulated with the same speed or consistency within an emulator as they can when running on an actual device. However, the emulator is good for doing some generalized testing of your applications.

Android SdK

The most important piece of software you need to download is, of course, the Android SDK. The Android SDK contains all of the packages and tools required to develop a functional Android application. The SDKs are named after the version of Android OS to which they correspond. By default, the Marshmallow SDK was installed with Android Studio 2, which means you can develop applications that will run seamlessly on devices with Android Marshmallow.

Installation Android Studio

The first and most important piece of software you need to download is Android Studio 2. After you have

downloaded and installed Android Studio 3, you can use the SDK Manager to download and install multiple versions of the Android SDK. Having multiple versions of the SDK available enables you to write programs that target different devices. For example, you can write one version of an application that specifically targets Android Nougat, but because that flavor of Android is

on less than 1% of devices, with multiple versions of the SDK you can also write a version of your app that uses older features and targets Marshmallow or Lollipop users. You can use the Android Device Manager to set up device emulators.

You can download Android Studio 3 from  http://developer.android.com/sdk/index.html




Android Studio 3 is packaged in an executable. Run the install process to set up Android Studio 2. After you’ve downloaded and run the setup executable, use the following steps to go through the installation process:

  1. Accept the terms and conditions shown in Figure
  2. If you have an older version of Android Studio already installed on your computer, the Android Studio Setup prompts you to automatically uninstall Even though the old version of Android Studio will be uninstalled, the settings and configurations are retained. You have an opportunity to reapply those settings and configurations to Android Studio 3 after the setup has completed. Figure  shows the screen where you are prompted to uninstall an old version of Android Studio.

 

 

3.Click Next on the Welcome to Android Studio Setup screen .

Installing Android Studio 3 could take a few minutes, depending on the speed of your com- puter. You are presented with a progress bar to help you track the state of the Android Studio 2 is installed with a default SDK (Software Development Kit), in this case Marshmallow. Later in the process you have the opportunity to install other SDKs. The Android SDK allows you to develop and write applications geared for a specific version

of Android. In other words, applications written with the Marshmallow SDK run on Android devices running Marshmallow, but they also possibly run on other versions depending on which features of the SDK you used in the application.

 

When the install is complete, you will see a Completing Android Studio Setup screen . Leave the Start Android Studio box checked and click…

 

Android Studio  prompts you to either import settings from a previous version of Android Studio or continue with new settings. If you uninstalled a previous version in the first step of the installation process, Android Studio offers you a chance to recover the settings used in that previous version and apply them to Android Studio