SlideShare a Scribd company logo
1 of 37
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.
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.
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.
 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.
 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.
THANK YOU

More Related Content

What's hot

Android Architecture
Android ArchitectureAndroid Architecture
Android Architecturedeepakshare
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on androidLi SUN
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development pptGautam Kumar
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppttirupathinews
 
Android activity
Android activityAndroid activity
Android activityKrazy Koder
 
android activity
android activityandroid activity
android activityDeepa Rani
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentAly Abdelkareem
 
android architecture
android architectureandroid architecture
android architectureAashita Gupta
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android Ranjith Kumar
 
Android resources
Android resourcesAndroid resources
Android resourcesma-polimi
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android Aakash Ugale
 
Android Web app
Android Web app Android Web app
Android Web app Sumit Kumar
 
Android notification
Android notificationAndroid notification
Android notificationKrazy Koder
 

What's hot (20)

JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
Android Widget
Android WidgetAndroid Widget
Android Widget
 
Android Architecture
Android ArchitectureAndroid Architecture
Android Architecture
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on android
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Android application development ppt
Android application development pptAndroid application development ppt
Android application development ppt
 
Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppt
 
Android activity
Android activityAndroid activity
Android activity
 
android activity
android activityandroid activity
android activity
 
Android UI
Android UIAndroid UI
Android UI
 
Android Fragment
Android FragmentAndroid Fragment
Android Fragment
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
android architecture
android architectureandroid architecture
android architecture
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
 
Android resources
Android resourcesAndroid resources
Android resources
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android
 
Android Web app
Android Web app Android Web app
Android Web app
 
Fragment
Fragment Fragment
Fragment
 
Android notification
Android notificationAndroid notification
Android notification
 

Viewers also liked

Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Ahsanul Karim
 
Android GPS Tutorial
Android GPS TutorialAndroid GPS Tutorial
Android GPS TutorialAhsanul Karim
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Ahsanul Karim
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)Ahsanul Karim
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overviewAhsanul Karim
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesAhsanul Karim
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentAhsanul Karim
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)Ahsanul Karim
 
Lecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedLecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedAhsanul Karim
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting startedAhsanul Karim
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Ahsanul Karim
 
Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities Ahsanul Karim
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_startedAhsanul Karim
 

Viewers also liked (20)

List Views
List ViewsList Views
List Views
 
Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)
 
Android GPS Tutorial
Android GPS TutorialAndroid GPS Tutorial
Android GPS Tutorial
 
Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3Android Workshop: Day 1 Part 3
Android Workshop: Day 1 Part 3
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)
 
Training android
Training androidTraining android
Training android
 
Day 2 android internals a quick overview
Day 2 android internals a quick overviewDay 2 android internals a quick overview
Day 2 android internals a quick overview
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Android 1.8 sensor
Android 1.8 sensorAndroid 1.8 sensor
Android 1.8 sensor
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through Activities
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver Component
 
Mcq peresentation
Mcq  peresentationMcq  peresentation
Mcq peresentation
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
Ui layout (incomplete)
Ui layout (incomplete)Ui layout (incomplete)
Ui layout (incomplete)
 
Lecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting StartedLecture 1 Session 1 Before Getting Started
Lecture 1 Session 1 Before Getting Started
 
Android before getting started
Android before getting startedAndroid before getting started
Android before getting started
 
Client-Server
Client-ServerClient-Server
Client-Server
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2
 
Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities
 
Day1 before getting_started
Day1 before getting_startedDay1 before getting_started
Day1 before getting_started
 

Similar to Creating the first app with android studio

Android app development.pdf
Android app development.pdfAndroid app development.pdf
Android app development.pdfAbanti Aazmin
 
Android deep dive
Android deep diveAndroid deep dive
Android deep diveAnuSahniNCI
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answerskavinilavuG
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxlancelotlaytan1996
 
Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorialnirajsimulanis
 
Final NEWS.pdf
Final NEWS.pdfFinal NEWS.pdf
Final NEWS.pdfRebaMaheen
 
Final NewsApp.pdf
Final NewsApp.pdfFinal NewsApp.pdf
Final NewsApp.pdfRebaMaheen
 
androidstudio.pptx
androidstudio.pptxandroidstudio.pptx
androidstudio.pptxSundaresanB5
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptxGandhiMathy6
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfweerabahu
 

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

Android app development.pdf
Android app development.pdfAndroid app development.pdf
Android app development.pdf
 
Android
AndroidAndroid
Android
 
Android deep dive
Android deep diveAndroid deep dive
Android deep dive
 
Android Basic- CMC
Android Basic- CMCAndroid Basic- CMC
Android Basic- CMC
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
 
Module-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptxModule-I_Introduction-to-Android.pptx
Module-I_Introduction-to-Android.pptx
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorial
 
Getting started with android studio
Getting started with android studioGetting started with android studio
Getting started with android studio
 
Bird.pdf
 Bird.pdf Bird.pdf
Bird.pdf
 
Final NEWS.pdf
Final NEWS.pdfFinal NEWS.pdf
Final NEWS.pdf
 
Final NewsApp.pdf
Final NewsApp.pdfFinal NewsApp.pdf
Final NewsApp.pdf
 
androidstudio.pptx
androidstudio.pptxandroidstudio.pptx
androidstudio.pptx
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Android
Android Android
Android
 
Android Basic
Android BasicAndroid Basic
Android Basic
 
Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptx
 
Google Android
Google AndroidGoogle Android
Google Android
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
 
Os eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdfOs eclipse-androidwidget-pdf
Os eclipse-androidwidget-pdf
 

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.
  • 25.
  • 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.
  • 30.
  • 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.
  • 32.
  • 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.
  • 34.
  • 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.
  • 36.