SlideShare a Scribd company logo
BY-
Parinita Agarwal
B.Tech C.S 3rd year
Radha Govind Engineering College
Contents
 Introduction of Android
 What is Android Studio?
 Starting up with Android Studio.
 Creating an application.
What is Android ?
 In English dicitionary the world android means that-
 An automation that resambles a human being,
 Mechanical man or humanoid …..etc.
 Android is an open source operating system
specifically for use on mobile devices ( smart phones
and tablets).
 Based on the Linux kernel(2.6 kernel).
 Developed by Google and later by the Open Handset
Alliance(OHA).
 Allows writing managed code in the Java language.
 Android has its own virtual machine i.e , DVM (Dalvik
Virtual Machine), which is used for executing the
android applications.
 Supports Bluetooth, Wi-Fi, and 3G and 4G
networking.
Android Studio
 Android Studio is a new Android development
environment developed by Google. It is based on
IntellJ IDEA, which is similar to Eclipse with the ADT
(Android Development Toolkit) plugin .
 It is different from Eclipse in many ways. The most
basic difference is that we do’n’t have to do any
configuration like we would have do to for Eclipse.
Android Studio comes bundled with the Android ADT,
and all we need to do is to point it to where Java is
installed on our s/s .
 JDK version must be later than version 6.
 Once downloaded, you can follow the set-up wizard.
At times, for Windows systems, the launcher script
isn’’t able to find Java. So we need to set an
environment variable called JAVA_HOME and point it
to our JDK folder.
 Now that the set-up is complete, we can go ahead and
directly launch the Android Studio. There is no need
to download the ADT plugin and configure it. When
we launch it, we can see the Welcome screen (refer to
Figure 2).
 Some specific features that come with Android Studio
(and quoting directly from the Android Developers
Web page):
 Gradle-based build support.
 Android-specific refactoring and quick fixes
 Lint tools to improve performance, usability, version
compatibility .
 ProGuard and app-signing capabilities.
 A rich layout editor that allows you to drag-and-drop
UI components, preview layouts on multiple screen
configurations, and much more.
Fig 1
Starting up with Android Studio
Creating a New Project
 The first step in the application development process is to
create a new project within the Android Studio
environment. Begin, therefore, by launching Android
Studio so that the “Welcome to Android Studio” screen
appears as illustrated in Figure 2:
Fig 2
 Once this window appears, Android Studio is ready for a
new project to be created. To create the new project, simply
click on the Start a new Android Studio project option to
display the first screen of the New Project wizard as shown
in Figure 3:
Defining the Project
 In the New Project window, set the Application name field
to AndroidSample(Fig 3). The application name is the
name by which the application will be referenced and
identified within Android Studio.
 The Package Name is used to uniquely identify the
application within the Android application ecosystem. It
should be based on the reversed URL of your domain name
followed by the name of the application. For example, if
our domain is www.mycompany.com, and the application
has been named AndroidSample , then the package name
might be specified as follows:
com.example.parinita.androidsample
 The Project location setting will define our project will
be get store(Fig 3).
 Click Next to proceed.
Fig 3
Selecting the form factors
 On the form factors screen, enable the Phone and
Tablet option and set the minimum SDK setting to API
8: Android 4.0.3 (IceCremeSandwich) . The reason for
selecting an older SDK release is that this ensures that
the finished application will be able to run on the
widest possible range of Android devices.
 Since the project is not intended for Google TV, Google
Glass or wearable devices, leave the remaining options
disabled before clicking Next.
Fig 4
Selecting an Activity
 The next step is to define the type of initial activity
that is to be created for the application. A range of
different activity types is available when developing
Android applications. Here we select the option to
create a Blank Activity.
Fig 5
 With the Blank Activity option selected, click Next.
 On the final screen (Figure 6) name the:
 Activity Name: Name of the activity to load.
 Layout Name : Every screen (activity) UI is designed
using an XML File. This layout will define the layout of
the activity.
 Title : It is the title of the activity.
 Menu Resource Name : This file will decide what
should be displayed when the user clicks on the Menu
of the android app screen.
Fig 6
 Finally, click on Finish. The project gets created and
will be shown as below.
Fig 7
Important files and directory of Android project to be
known and their purpose :
 src - This contains the .java source files for our project.
By default, it includes an AndroidSampleActivity.java
source file having an activity class that runs when your
app is launched using the app icon.
 generated - This contains the .R file, a compiler-
generated file that references all the resources found in
your project.
 bin - This folder contains the Android package files
.apk built by the ADT during the build process and
everything else needed to run an Android application.
 res/layout - This is a directory for files that define your
app's user interface.
 res/values - This is a directory for other various XML
files that contain a collection of resources, such as
strings and colors definitions.
 AndroidManifest.xml - This is the manifest file which
describes the fundamental characteristics of the app
and defines each of its components.
Creating the first app with android studio
Layout File
 The activity_android_sample.xml is a layout file available
in res/layout directory, that is referenced by our application
when building its interface.
String file
 The strings.xml file is located in the res/values folder and it
contains all the text that our application uses. For example,
the names of buttons, labels, default text, and similar types
of strings go into this file. This file is responsible for their
textual content.
 The gen/com.example.parinita.androidsample/R.java file
is the glue between the activity Java files like
AndroidSampleActivity.java and the resources like
strings.xml. It is an automatically generated file and we
should not modify the content of the R.java file.
Text Mode
Layout Design
Running the app on Emulator
 The Android SDK includes a mobile device emulator
— a virtual mobile device that runs on our computer.
The emulator lets us develop and test Android
applications without using a physical device.
 Emulator can be started from SDK manager tools.
 The Android SDK separates tools, platforms, and other
components into packages such as debugger, libraries,
an emulator, documentation, sample code.
Creating the first app with android studio
AVD Manager
 An Android Virtual Device or AVD is an emulator
configuration, allowing you to model an Android
device. This makes running and testing applications
on a wide range of devices much easier. With an
Android Virtual Device, we can specify the hardware
and software the Android Emulator needs to
emulate.
 The preferred way to create an Android Virtual Device
is through the AVD Manager, which can be access in
Android Studio by selecting Android > AVD
Manager from the Tools menu.
Creating the first app with android studio
 To use newly created AVD, select it from the list in the
AVD manager, and click Start. If AVD is set up
correctly, the Android Emulator should launch as
shown in the screenshot below.
Creating the first app with android studio
 With the Android Emulator up and running, it's time
to launch the application by selecting Run from
the Run menu. And our application runs on the
Android Emulator.
Creating the first app with android studio
THANK YOU

More Related Content

PPTX
Android studio installation
PDF
Introduction to Android Development
PPTX
Introduction to Android and Android Studio
PPTX
Android app development ppt
PPT
Block diagram of a computer
PPTX
Data structure and algorithm using java
PPSX
Coefficient of correlation...ppt
PPTX
Introduction to mobile application development
Android studio installation
Introduction to Android Development
Introduction to Android and Android Studio
Android app development ppt
Block diagram of a computer
Data structure and algorithm using java
Coefficient of correlation...ppt
Introduction to mobile application development

What's hot (20)

PDF
Android Components
ZIP
Android Application Development
PPT
android activity
PPTX
Android application development ppt
PPT
android layouts
PPTX
Basic android-ppt
PPTX
Android User Interface
PPTX
Android - Application Framework
PPT
Android Application Development Using Java
PPTX
PDF
UI controls in Android
PPTX
Android Layout
PDF
AndroidManifest
PPTX
Introduction to Android ppt
PPT
Android ppt
PDF
Layouts in android
PPTX
Day: 1 Introduction to Mobile Application Development (in Android)
PDF
Android intents
PPTX
Android Services
PPTX
Android activity lifecycle
Android Components
Android Application Development
android activity
Android application development ppt
android layouts
Basic android-ppt
Android User Interface
Android - Application Framework
Android Application Development Using Java
UI controls in Android
Android Layout
AndroidManifest
Introduction to Android ppt
Android ppt
Layouts in android
Day: 1 Introduction to Mobile Application Development (in Android)
Android intents
Android Services
Android activity lifecycle
Ad

Viewers also liked (20)

PDF
List Views
PPTX
Android GPS Tutorial
PPTX
Android Workshop: Day 1 Part 3
PDF
Sensors in Android (old)
PDF
Training android
PDF
Day 2 android internals a quick overview
PDF
Day 8: Dealing with Lists and ListViews
PPTX
Android 1.8 sensor
PPT
Day 4: Android: Getting Active through Activities
PPT
Day 6: Android BroadcastReceiver Component
PPTX
Mcq peresentation
PDF
Ui layout (incomplete)
PDF
Lecture 1 Session 1 Before Getting Started
PPTX
Android before getting started
PPTX
Client-Server
PPTX
Android Workshop Day 1 Part 2
PDF
Lecture 3 getting active through activities
PDF
Day1 before getting_started
PDF
Lecture 5: Storage: Saving Data Database, Files & Preferences
PDF
GCM for Android
List Views
Android GPS Tutorial
Android Workshop: Day 1 Part 3
Sensors in Android (old)
Training android
Day 2 android internals a quick overview
Day 8: Dealing with Lists and ListViews
Android 1.8 sensor
Day 4: Android: Getting Active through Activities
Day 6: Android BroadcastReceiver Component
Mcq peresentation
Ui layout (incomplete)
Lecture 1 Session 1 Before Getting Started
Android before getting started
Client-Server
Android Workshop Day 1 Part 2
Lecture 3 getting active through activities
Day1 before getting_started
Lecture 5: Storage: Saving Data Database, Files & Preferences
GCM for Android
Ad

Similar to Creating the first app with android studio (20)

PDF
Android app development.pdf
PPTX
Android
PPTX
Android deep dive
PDF
Android Basic- CMC
PDF
Android interview questions and answers
PPTX
Module-I_Introduction-to-Android.pptx
PDF
Android dev o_auth
PDF
Android development-tutorial
PPT
Getting started with android studio
PDF
Bird.pdf
PDF
Final NEWS.pdf
PDF
Final NewsApp.pdf
PPTX
androidstudio.pptx
PPTX
this is PPT for mobail application development
PPT
Getting started with android dev and test perspective
PPTX
Android Basic
PPTX
Android
PPTX
Introduction to Android and Java.pptx
PPT
Google Android
PPTX
Notes Unit2.pptx
Android app development.pdf
Android
Android deep dive
Android Basic- CMC
Android interview questions and answers
Module-I_Introduction-to-Android.pptx
Android dev o_auth
Android development-tutorial
Getting started with android studio
Bird.pdf
Final NEWS.pdf
Final NewsApp.pdf
androidstudio.pptx
this is PPT for mobail application development
Getting started with android dev and test perspective
Android Basic
Android
Introduction to Android and Java.pptx
Google Android
Notes Unit2.pptx

Creating the first app with android studio

  • 1. BY- Parinita Agarwal B.Tech C.S 3rd year Radha Govind Engineering College
  • 2. Contents  Introduction of Android  What is Android Studio?  Starting up with Android Studio.  Creating an application.
  • 3. What is Android ?  In English dicitionary the world android means that-  An automation that resambles a human being,  Mechanical man or humanoid …..etc.  Android is an open source operating system specifically for use on mobile devices ( smart phones and tablets).  Based on the Linux kernel(2.6 kernel).  Developed by Google and later by the Open Handset Alliance(OHA).  Allows writing managed code in the Java language.
  • 4.  Android has its own virtual machine i.e , DVM (Dalvik Virtual Machine), which is used for executing the android applications.  Supports Bluetooth, Wi-Fi, and 3G and 4G networking.
  • 5. Android Studio  Android Studio is a new Android development environment developed by Google. It is based on IntellJ IDEA, which is similar to Eclipse with the ADT (Android Development Toolkit) plugin .  It is different from Eclipse in many ways. The most basic difference is that we do’n’t have to do any configuration like we would have do to for Eclipse. Android Studio comes bundled with the Android ADT, and all we need to do is to point it to where Java is installed on our s/s .
  • 6.  JDK version must be later than version 6.  Once downloaded, you can follow the set-up wizard. At times, for Windows systems, the launcher script isn’’t able to find Java. So we need to set an environment variable called JAVA_HOME and point it to our JDK folder.  Now that the set-up is complete, we can go ahead and directly launch the Android Studio. There is no need to download the ADT plugin and configure it. When we launch it, we can see the Welcome screen (refer to Figure 2).
  • 7.  Some specific features that come with Android Studio (and quoting directly from the Android Developers Web page):  Gradle-based build support.  Android-specific refactoring and quick fixes  Lint tools to improve performance, usability, version compatibility .  ProGuard and app-signing capabilities.  A rich layout editor that allows you to drag-and-drop UI components, preview layouts on multiple screen configurations, and much more.
  • 8. Fig 1 Starting up with Android Studio
  • 9. Creating a New Project  The first step in the application development process is to create a new project within the Android Studio environment. Begin, therefore, by launching Android Studio so that the “Welcome to Android Studio” screen appears as illustrated in Figure 2:
  • 10. Fig 2
  • 11.  Once this window appears, Android Studio is ready for a new project to be created. To create the new project, simply click on the Start a new Android Studio project option to display the first screen of the New Project wizard as shown in Figure 3:
  • 12. Defining the Project  In the New Project window, set the Application name field to AndroidSample(Fig 3). The application name is the name by which the application will be referenced and identified within Android Studio.  The Package Name is used to uniquely identify the application within the Android application ecosystem. It should be based on the reversed URL of your domain name followed by the name of the application. For example, if our domain is www.mycompany.com, and the application has been named AndroidSample , then the package name might be specified as follows: com.example.parinita.androidsample
  • 13.  The Project location setting will define our project will be get store(Fig 3).  Click Next to proceed.
  • 14. Fig 3
  • 15. Selecting the form factors  On the form factors screen, enable the Phone and Tablet option and set the minimum SDK setting to API 8: Android 4.0.3 (IceCremeSandwich) . The reason for selecting an older SDK release is that this ensures that the finished application will be able to run on the widest possible range of Android devices.  Since the project is not intended for Google TV, Google Glass or wearable devices, leave the remaining options disabled before clicking Next.
  • 16. Fig 4
  • 17. Selecting an Activity  The next step is to define the type of initial activity that is to be created for the application. A range of different activity types is available when developing Android applications. Here we select the option to create a Blank Activity.
  • 18. Fig 5
  • 19.  With the Blank Activity option selected, click Next.  On the final screen (Figure 6) name the:  Activity Name: Name of the activity to load.  Layout Name : Every screen (activity) UI is designed using an XML File. This layout will define the layout of the activity.  Title : It is the title of the activity.  Menu Resource Name : This file will decide what should be displayed when the user clicks on the Menu of the android app screen.
  • 20. Fig 6
  • 21.  Finally, click on Finish. The project gets created and will be shown as below.
  • 22. Fig 7
  • 23. Important files and directory of Android project to be known and their purpose :  src - This contains the .java source files for our project. By default, it includes an AndroidSampleActivity.java source file having an activity class that runs when your app is launched using the app icon.  generated - This contains the .R file, a compiler- generated file that references all the resources found in your project.  bin - This folder contains the Android package files .apk built by the ADT during the build process and everything else needed to run an Android application.
  • 24.  res/layout - This is a directory for files that define your app's user interface.  res/values - This is a directory for other various XML files that contain a collection of resources, such as strings and colors definitions.  AndroidManifest.xml - This is the manifest file which describes the fundamental characteristics of the app and defines each of its components.
  • 26. Layout File  The activity_android_sample.xml is a layout file available in res/layout directory, that is referenced by our application when building its interface. String file  The strings.xml file is located in the res/values folder and it contains all the text that our application uses. For example, the names of buttons, labels, default text, and similar types of strings go into this file. This file is responsible for their textual content.  The gen/com.example.parinita.androidsample/R.java file is the glue between the activity Java files like AndroidSampleActivity.java and the resources like strings.xml. It is an automatically generated file and we should not modify the content of the R.java file.
  • 29. Running the app on Emulator  The Android SDK includes a mobile device emulator — a virtual mobile device that runs on our computer. The emulator lets us develop and test Android applications without using a physical device.  Emulator can be started from SDK manager tools.  The Android SDK separates tools, platforms, and other components into packages such as debugger, libraries, an emulator, documentation, sample code.
  • 31. AVD Manager  An Android Virtual Device or AVD is an emulator configuration, allowing you to model an Android device. This makes running and testing applications on a wide range of devices much easier. With an Android Virtual Device, we can specify the hardware and software the Android Emulator needs to emulate.  The preferred way to create an Android Virtual Device is through the AVD Manager, which can be access in Android Studio by selecting Android > AVD Manager from the Tools menu.
  • 33.  To use newly created AVD, select it from the list in the AVD manager, and click Start. If AVD is set up correctly, the Android Emulator should launch as shown in the screenshot below.
  • 35.  With the Android Emulator up and running, it's time to launch the application by selecting Run from the Run menu. And our application runs on the Android Emulator.