SlideShare a Scribd company logo
Android Application Development
Workshop
Day 1
Eng.Borhan Otour
borhan.a.otour@gmail.com
Hello World , this is Android 
Agenda
What we will cover today
•The Android System and the Android SDK.
•The eXtensible Markup language (XML).
•Building and running our first Application. (project structure -
AVDs)
•The Project structure.
•The First touch(Basic User-App Interaction)
• Basic Interconnection.
•Advanced Interconnection.
The Android System Architecture
The Android Market and Activations
By 2013 , there were
Android Device Activated.
SO THERE IS A LOT OF PEOPLE WHO NEEDS
APPS FROM YOU.
The eXtensible Markup Language (XML)
Sample: collage.xml
The XML - overview
<school…………… >
- - - - - - -
</school>
• Every starting tag has an end tag
• The Tag may have a child tags
<hospital>
<doctor>
<patient ----> --- </patient>
<patient ----> --- </patient>
</doctor>
</hospital>
• The Tag may contain attribute
<student name=“Borhan” age=“23” ></student>
Android Application Development
1. The Installation of the development environment
2. The main application component – The Activity.
3. The View System.
The Installation
•What do you need to prepare the development environment?
1. The Android SDK
2. An editor to code your project or The Integrated
Development Environment (Eclipse IDE)
3. Connect the IDE and the SDK to begin developing for the
Android market  (Android developer tool ADT)
• ( SDK + Eclipse )* ADT = My Android Development Environment
• Remember:
SDK = Android development tools + Android application framework
Android Application development -
Activities
The activity:
the most important Android application component.
It’s a java class that represent a Screen.
Each application must contain one screen .
This is an Activity
Note: The activity is not a layout
Android Application development
(create a simple layout) .cont
The view:
The view is the fundamental component you see in the
“screen” that is used to build layouts.
The views can be containers or a widgets.
Android Application development
(create a simple layout) .cont
•The layout is composed of a hierarchy of views
Building the first application
“Hello World, Android”
1. Setup the Android projects workspace.
2. Create a new Android application project.
3.Launch the Android Application Project.
4.What is the project structure?
Create a new Android app project
1. Together let’s setup the workspace
2. Project creation step 1
Create a new Android app project
3. Project creation step 2
Create a new Android app project
4. Project creation step 3
Create a new Android app project
5. Project creation step 4
Create a new Android app project
6. Project creation step 5
Create a new Android app project
(The Android virtual device AVD)
•The Android Virtual Device (The Emulator)
The project structure - res
The static content of any Android
application is called a resource.
1. images.
2. Textual content.
3. Layouts.
4. Etc …
The main idea to reach a resource is
that , each resource item must have
an ID.
To reach to a resource ID us in XML:
@resourceType/resourceID
Ex: @string/app_name
(in the AndroidManifest.xml)
The project structure – AndroidManifest.xml
The project structure – AndroidManifest.xml
To Set the layout content of an Activity use the:
setContentView(int layoutResouceID);
Basic call Back
“Android Toast”
1. Assign Id to view to get them in code.
2. Get Views in code to manipulate them.
3.Build a basic call back mechanism.
Basic callbacks : get Views In Code
The Goal:
We Assign an ID to a view element like Buttons, TextView
so we can reach them in code.
The Way:
we set an id to the view element like (TextView , Button)
Using android:id=“@+id/idName”
In the Activity we call the view:
Using the Activity function: findViewById(int viewId)
viewId = R.layout.some_layout_resource_name
Basic callbacks : (The R class)
XML
resource
Java CodeR.java
public final class R {
public static final class string{
/** String array of all countries in the world
public static final int app_name=0x7f060001;
public static final int hello=0x7f060000;
}
-----
}
The activity_main.xml file that represents the layout of the MainActivity.java
Basic Interconnection
“Two Layout Application”
1. Adding a new Activity to the project.
Creare a new Activity
Crearte a new Activity
Crearte a new Activity
Start the new Activity
The Intent Object:
Intent intent = new Intent();
Put Some content in the message:
intent.putExtras(String key,Object vlaue);
Start The new Activity:
startActivity(intent);
Receive the intent object:
getIntent();
Advanced Interconnection
“Get Application Application”
Interconnection between activities
(The Intent system)
Activity 2Activity 1
• When you want to launch a new Activity from the current Activity
you need to use Intents.
• The Intent represents the Application Intention to do something,
which is (launching a new “Screen”) .
• You specifies the current Activity and the name of the Destination
Activity in the construction of intent object.
Intent intent = new Intent(this , destinationActivityName.class)
• You can put extra content in the message that you send to launch a
new Activity.
Intent.putExtras( String key , value);
Interconnection between activities
(The Intent system) .cont
• To launch the new Activity from the current activity use the
Activity method:
startActivity(Intent intent)
• To get the Intent object that caused the activity to be launched:
In the destination Activity , use the activity method:
getIntent()
• To extract the extra data from the intent based of the type of data
( like String data for instance ) : intent.getStringExtras(String key)
References
•http://developer.android.com/index.html
•The API documentation
http://developer.android.com/reference/packages.html
• Building the first application
http://developer.android.com/training/basics/firstapp/index
.html

More Related Content

What's hot

[Android] Intent and Activity
[Android] Intent and Activity[Android] Intent and Activity
[Android] Intent and Activity
Nikmesoft Ltd
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
Raman Pandey
 
Android session 3
Android session 3Android session 3
Android session 3
Ahesanali Suthar
 
Android session 1
Android session 1Android session 1
Android session 1
Ahesanali Suthar
 
Asp dot-net core problems and fixes
Asp dot-net core problems and fixes Asp dot-net core problems and fixes
Asp dot-net core problems and fixes
sonia merchant
 
Inversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionInversion of Control and Dependency Injection
Inversion of Control and Dependency Injection
Dinesh Sharma
 
Android components
Android componentsAndroid components
Android components
NAVEENA ESWARAN
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivityAhsanul Karim
 
Android session 2
Android session 2Android session 2
Android session 2
Ahesanali Suthar
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAhsanul 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
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
Marcos Paulo Souza Damasceno
 

What's hot (15)

[Android] Intent and Activity
[Android] Intent and Activity[Android] Intent and Activity
[Android] Intent and Activity
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Android session 3
Android session 3Android session 3
Android session 3
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Android session 1
Android session 1Android session 1
Android session 1
 
Asp dot-net core problems and fixes
Asp dot-net core problems and fixes Asp dot-net core problems and fixes
Asp dot-net core problems and fixes
 
Inversion of Control and Dependency Injection
Inversion of Control and Dependency InjectionInversion of Control and Dependency Injection
Inversion of Control and Dependency Injection
 
Android components
Android componentsAndroid components
Android components
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
 
Android session 2
Android session 2Android session 2
Android session 2
 
Android User Interface: Basic Form Widgets
Android User Interface: Basic Form WidgetsAndroid User Interface: Basic Form Widgets
Android User Interface: Basic Form Widgets
 
Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities
 
Conclusion
ConclusionConclusion
Conclusion
 
Ui 5
Ui   5Ui   5
Ui 5
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
 

Similar to Android application development workshop day1

Android application development
Android application developmentAndroid application development
Android application developmentslidesuren
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_program
Eyad Almasri
 
Android application development workshop day1
Android application development workshop   day1Android application development workshop   day1
Android application development workshop day1Borhan Otour
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
Jagdish Gediya
 
Android studio
Android studioAndroid studio
Android studio
Andri Yabu
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentAhsanul Karim
 
ANDROID PPT 1.pdf
ANDROID PPT 1.pdfANDROID PPT 1.pdf
ANDROID PPT 1.pdf
Siva Krishna Prasad
 
Android Basic Tutorial
Android Basic TutorialAndroid Basic Tutorial
Android Basic Tutorial
Smartmonk
 
Synapseindia android apps application
Synapseindia android apps applicationSynapseindia android apps application
Synapseindia android apps application
Synapseindiappsdevelopment
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recieversUtkarsh Mankad
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
dineshkumar periyasamy
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
Junda Ong
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting Started
Hemant Chhapoliya
 
Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptx
GandhiMathy6
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1Shyamala Prayaga
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
Roy Clarkson
 
Mobile Worshop Lab guide
Mobile Worshop Lab guideMobile Worshop Lab guide
Mobile Worshop Lab guide
Man Chan
 

Similar to Android application development workshop day1 (20)

Android application development
Android application developmentAndroid application development
Android application development
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_program
 
Android application development workshop day1
Android application development workshop   day1Android application development workshop   day1
Android application development workshop day1
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Android studio
Android studioAndroid studio
Android studio
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
ANDROID PPT 1.pdf
ANDROID PPT 1.pdfANDROID PPT 1.pdf
ANDROID PPT 1.pdf
 
Android
Android Android
Android
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android Basic Tutorial
Android Basic TutorialAndroid Basic Tutorial
Android Basic Tutorial
 
Synapseindia android apps application
Synapseindia android apps applicationSynapseindia android apps application
Synapseindia android apps application
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting Started
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 
Introduction to Android and Java.pptx
Introduction to Android and Java.pptxIntroduction to Android and Java.pptx
Introduction to Android and Java.pptx
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
 
Mobile Worshop Lab guide
Mobile Worshop Lab guideMobile Worshop Lab guide
Mobile Worshop Lab guide
 

Android application development workshop day1

  • 1. Android Application Development Workshop Day 1 Eng.Borhan Otour borhan.a.otour@gmail.com
  • 2. Hello World , this is Android 
  • 3. Agenda What we will cover today •The Android System and the Android SDK. •The eXtensible Markup language (XML). •Building and running our first Application. (project structure - AVDs) •The Project structure. •The First touch(Basic User-App Interaction) • Basic Interconnection. •Advanced Interconnection.
  • 4. The Android System Architecture
  • 5. The Android Market and Activations By 2013 , there were Android Device Activated. SO THERE IS A LOT OF PEOPLE WHO NEEDS APPS FROM YOU.
  • 6. The eXtensible Markup Language (XML) Sample: collage.xml
  • 7. The XML - overview <school…………… > - - - - - - - </school> • Every starting tag has an end tag • The Tag may have a child tags <hospital> <doctor> <patient ----> --- </patient> <patient ----> --- </patient> </doctor> </hospital> • The Tag may contain attribute <student name=“Borhan” age=“23” ></student>
  • 8. Android Application Development 1. The Installation of the development environment 2. The main application component – The Activity. 3. The View System.
  • 9. The Installation •What do you need to prepare the development environment? 1. The Android SDK 2. An editor to code your project or The Integrated Development Environment (Eclipse IDE) 3. Connect the IDE and the SDK to begin developing for the Android market  (Android developer tool ADT) • ( SDK + Eclipse )* ADT = My Android Development Environment • Remember: SDK = Android development tools + Android application framework
  • 10. Android Application development - Activities The activity: the most important Android application component. It’s a java class that represent a Screen. Each application must contain one screen . This is an Activity Note: The activity is not a layout
  • 11. Android Application development (create a simple layout) .cont The view: The view is the fundamental component you see in the “screen” that is used to build layouts. The views can be containers or a widgets.
  • 12. Android Application development (create a simple layout) .cont •The layout is composed of a hierarchy of views
  • 13. Building the first application “Hello World, Android” 1. Setup the Android projects workspace. 2. Create a new Android application project. 3.Launch the Android Application Project. 4.What is the project structure?
  • 14. Create a new Android app project 1. Together let’s setup the workspace 2. Project creation step 1
  • 15. Create a new Android app project 3. Project creation step 2
  • 16. Create a new Android app project 4. Project creation step 3
  • 17. Create a new Android app project 5. Project creation step 4
  • 18. Create a new Android app project 6. Project creation step 5
  • 19. Create a new Android app project (The Android virtual device AVD) •The Android Virtual Device (The Emulator)
  • 20. The project structure - res The static content of any Android application is called a resource. 1. images. 2. Textual content. 3. Layouts. 4. Etc … The main idea to reach a resource is that , each resource item must have an ID. To reach to a resource ID us in XML: @resourceType/resourceID Ex: @string/app_name (in the AndroidManifest.xml)
  • 21. The project structure – AndroidManifest.xml
  • 22. The project structure – AndroidManifest.xml To Set the layout content of an Activity use the: setContentView(int layoutResouceID);
  • 23. Basic call Back “Android Toast” 1. Assign Id to view to get them in code. 2. Get Views in code to manipulate them. 3.Build a basic call back mechanism.
  • 24. Basic callbacks : get Views In Code The Goal: We Assign an ID to a view element like Buttons, TextView so we can reach them in code. The Way: we set an id to the view element like (TextView , Button) Using android:id=“@+id/idName” In the Activity we call the view: Using the Activity function: findViewById(int viewId) viewId = R.layout.some_layout_resource_name
  • 25. Basic callbacks : (The R class) XML resource Java CodeR.java public final class R { public static final class string{ /** String array of all countries in the world public static final int app_name=0x7f060001; public static final int hello=0x7f060000; } ----- }
  • 26. The activity_main.xml file that represents the layout of the MainActivity.java
  • 27. Basic Interconnection “Two Layout Application” 1. Adding a new Activity to the project.
  • 28. Creare a new Activity
  • 29. Crearte a new Activity
  • 30. Crearte a new Activity
  • 31. Start the new Activity The Intent Object: Intent intent = new Intent(); Put Some content in the message: intent.putExtras(String key,Object vlaue); Start The new Activity: startActivity(intent); Receive the intent object: getIntent();
  • 33. Interconnection between activities (The Intent system) Activity 2Activity 1 • When you want to launch a new Activity from the current Activity you need to use Intents. • The Intent represents the Application Intention to do something, which is (launching a new “Screen”) . • You specifies the current Activity and the name of the Destination Activity in the construction of intent object. Intent intent = new Intent(this , destinationActivityName.class) • You can put extra content in the message that you send to launch a new Activity. Intent.putExtras( String key , value);
  • 34. Interconnection between activities (The Intent system) .cont • To launch the new Activity from the current activity use the Activity method: startActivity(Intent intent) • To get the Intent object that caused the activity to be launched: In the destination Activity , use the activity method: getIntent() • To extract the extra data from the intent based of the type of data ( like String data for instance ) : intent.getStringExtras(String key)
  • 35. References •http://developer.android.com/index.html •The API documentation http://developer.android.com/reference/packages.html • Building the first application http://developer.android.com/training/basics/firstapp/index .html