SlideShare a Scribd company logo
Sasha Goldshtein
CTO, SELA Group

@goldshtn
blog.sashag.net

First Steps in Android
Development

© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
(Relevant) Android Versions

Froyo

Gingerbread

Honeycomb

•Android 2.2

•Android 2.3.x

•Android 3.x

Ice Cream
Sandwich
•Android 4.0

Jelly Bean

KitKat

•Android 4.1-4.3

•Android 4.4
Android Development Environment
Native Android

Xamarin (C#)

• Eclipse/Android
Studio
• Android plugin
for Eclipse (ADT)
• Android SDK

• Visual Studio
• Xamarin.Android
extension
• Android SDK
Hello World

Demo
Project Structure
src
gen
res
layout
values

assets
Android X.X.X
Libraries
AndroidManifest.xml
What Makes an Android
Application?
•
•
•
•

Presentation layer
Derive from Activity
Use Views
Similar to forms in the
desktop world

• Worker processes in
application
• Invisible
• Responsible for
updating data
sources, activities,
notifications

• Shareable data store
• Preferred way to
share data across
applications

Activities

Services

Content
Providers

• Message-passing
framework
• Broadcast messages
to target
activity/service

• Broadcast consumers
• Filtered by criteria
• Listen to intents that
match the criteria

• Enables notifications
without interrupting
the current activity
• Device notification
area

Intents

Broadcast
Receivers

Notifications
Resources
Resources are non-code application parts
Android resources include
images, strings, simple
values, animations, themes, etc.
Best to keep separated/external from code
External resources are easier to
maintain, upgrade, and manage (…and localize!)

Created under the res folder
Layout Resources
Layouts specify the UI
Decouple presentation layer from code
Enable designing UI in XML
Can be referenced as any other resource from other
layouts

Usually, each layout XML file = view
Code and User Interface
Separation

Strive to define most of the UI in XML files, and
write only code in Java files
Clean code/UI separation provides flexibility and
easy maintenance
Makes it easier to adjust for various types of
hardware devices (similar to resource localization)

UI elements can be manipulated from code
Use findViewById to get UI element instance from
code
Connecting UI to Code

Demo
Localization
Resources make localization easy
Create a language-specific folder structure alongside
the main folder structure
Folder name includes qualifiers

+ res
+ values
+ strings.xml

+ values-fr
+ strings.xml

+ values-fr-rCA
+ strings.xml
What Is an Activity?
An activity represents a screen
Using Views to provide UI
Extends the Activity class
To navigate screens, start a new activity using an intent

By default, activities occupy the entire screen
Can create semi-transparent/floating activities

Last-in-first-out activity stack
New activity pushes foreground activity down into stack
Navigating back or finishing an activity pops from the
stack the previous activity
Creating Activities
Extend the Activity class
The base class presents an empty screen
Encapsulates window display handling functionality

User interfaces are created using Views
Can create UI from layout or from View-derived
instances
//Using a layout resource identifier:
setContentView(R.layout.main);
//Using a View-derived instance:
TextView text = new TextView(this);
text.setText("New text!");
setContentView(text);
Multiple Activities
All activities must be declared in the application
manifest
<activity android:name=".SecondaryActivity"/>

Span a sub-activity using an Intent
Intent launch = new Intent(this, SecondaryActivity.class);
startActivity(launch);
Layouts
Most commonly used layouts
Layout

Description

FrameLayout

Pins child views to the top left corner. Adding multiple
children stacks each new child on top of the previous,
with each new view obscuring the last.

LinearLayout

Adds each child view in a straight line, either vertically or
horizontally.

RelativeLayout

Enables defining the positions of each of the child views
relative to each other and the screen boundaries.

TableLayout

Lay out views using a grid of rows and columns.

Multiple layouts can be mixed together
Selectors and Lists
ListView provides a convenient UI
for value selection from a long list
Presents multiple items on screen

Spinner provides UI for value
selection
Presents only a single value at a time
Drop-down overlay of selectable items
Multiple Activities and ListView

Demo
Xamarin: C# on 3 Billion Devices
Xamarin provides a .NET runtime for iOS and
Android development in C#
Proprietary IDE: Xamarin Studio
Full Visual Studio integration
Xamarin.Android

Demo
Summary
Android development environment
Resources, layouts, views
It’s just another
{language, IDE, UI framework}
The rest is just details: data, networking,
preferences, styling, …
Questions
Sasha Goldshtein
CTO, SELA Group

@goldshtn
blog.sashag.net

More Related Content

PPTX
Android Development with Eclipse and Xamarin
PPTX
Android app devolopment
PPTX
Basic android-ppt
PPTX
Android application development ppt
PPT
Android basics
PPTX
Android basics
PPT
ODP
Custom Android App Development – Web Animation India
Android Development with Eclipse and Xamarin
Android app devolopment
Basic android-ppt
Android application development ppt
Android basics
Android basics
Custom Android App Development – Web Animation India

What's hot (20)

PDF
Android101
PPT
Lec005 android start_program
PPTX
Project presentation (Loginradius SDK for Android)
PPTX
Lec001
PDF
Android Basics
PPT
Lec004 setting up for development
PPTX
Android Web app
PPTX
Introduction to Android development - Presentation
PPT
Introduction to Android Development
PPTX
Android Infrastructure
PPTX
Lecture 2: Android Introduction
PPTX
iOS 8 & Xamarin whats new
PPT
Android ppt
PPT
Android app development
PPT
Android application development
PPTX
iMA 2013
PPTX
Anroid Tutorial Beginner level By SAMRAT TAYADE
PPT
Google android os
PDF
Introduction to android
PPT
Android application and android operating system
Android101
Lec005 android start_program
Project presentation (Loginradius SDK for Android)
Lec001
Android Basics
Lec004 setting up for development
Android Web app
Introduction to Android development - Presentation
Introduction to Android Development
Android Infrastructure
Lecture 2: Android Introduction
iOS 8 & Xamarin whats new
Android ppt
Android app development
Android application development
iMA 2013
Anroid Tutorial Beginner level By SAMRAT TAYADE
Google android os
Introduction to android
Android application and android operating system
Ad

Similar to First Steps in Android Development with Eclipse and Xamarin (20)

KEY
Android Workshop
PPTX
Lightning Talk - Xamarin
PPTX
Unit-1.2 Android-Activities, Fragments, and Intents (1).pptx
PPTX
Cross platform mobile app development with Xamarin
PDF
[PBO] Pertemuan 12 - Pemrograman Android
PDF
Android App development and test environment, Understaing android app structure
PPTX
Android Development project
PDF
Learn how to develop for Android, beyond the Hello World android app - Cape T...
PPTX
Activities, Fragments, and Events
PDF
Android TCJUG
PPTX
Introduction to Android and Android Studio
PDF
PPTX
App innovationcircles xamarin
PPT
Android Application Development Using Java
PPT
Android - Anroid Pproject
PDF
Android Workshop_1
PDF
Android Jumpstart Jfokus
PPT
Getting started with android dev and test perspective
PPTX
Hello world ios v1
PPTX
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
Android Workshop
Lightning Talk - Xamarin
Unit-1.2 Android-Activities, Fragments, and Intents (1).pptx
Cross platform mobile app development with Xamarin
[PBO] Pertemuan 12 - Pemrograman Android
Android App development and test environment, Understaing android app structure
Android Development project
Learn how to develop for Android, beyond the Hello World android app - Cape T...
Activities, Fragments, and Events
Android TCJUG
Introduction to Android and Android Studio
App innovationcircles xamarin
Android Application Development Using Java
Android - Anroid Pproject
Android Workshop_1
Android Jumpstart Jfokus
Getting started with android dev and test perspective
Hello world ios v1
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
Ad

More from Sasha Goldshtein (20)

PPTX
Modern Linux Tracing Landscape
PPTX
The Next Linux Superpower: eBPF Primer
PPTX
Staring into the eBPF Abyss
PPTX
Visual Studio 2015 and the Next .NET Framework
PPT
Swift: Apple's New Programming Language for iOS and OS X
PPT
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
PPT
Modern Backends for Mobile Apps
PPT
.NET Debugging Workshop
PPT
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
PPT
Mastering IntelliTrace in Development and Production
PPTX
Introduction to RavenDB
PPTX
State of the Platforms
PPTX
Delivering Millions of Push Notifications in Minutes
PPTX
Building Mobile Apps with a Mobile Services .NET Backend
PPTX
Building iOS and Android Apps with Mobile Services
PPT
Task and Data Parallelism
PPT
What's New in C++ 11?
PDF
Attacking Web Applications
PPTX
Windows Azure Mobile Services
PPTX
First Steps in Android Development
Modern Linux Tracing Landscape
The Next Linux Superpower: eBPF Primer
Staring into the eBPF Abyss
Visual Studio 2015 and the Next .NET Framework
Swift: Apple's New Programming Language for iOS and OS X
C# Everywhere: Cross-Platform Mobile Apps with Xamarin
Modern Backends for Mobile Apps
.NET Debugging Workshop
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Mastering IntelliTrace in Development and Production
Introduction to RavenDB
State of the Platforms
Delivering Millions of Push Notifications in Minutes
Building Mobile Apps with a Mobile Services .NET Backend
Building iOS and Android Apps with Mobile Services
Task and Data Parallelism
What's New in C++ 11?
Attacking Web Applications
Windows Azure Mobile Services
First Steps in Android Development

Recently uploaded (20)

PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
A Presentation on Touch Screen Technology
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
project resource management chapter-09.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Hybrid model detection and classification of lung cancer
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
A comparative study of natural language inference in Swahili using monolingua...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
DP Operators-handbook-extract for the Mautical Institute
1 - Historical Antecedents, Social Consideration.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A Presentation on Touch Screen Technology
Chapter 5: Probability Theory and Statistics
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Univ-Connecticut-ChatGPT-Presentaion.pdf
cloud_computing_Infrastucture_as_cloud_p
project resource management chapter-09.pdf
Encapsulation theory and applications.pdf
Assigned Numbers - 2025 - Bluetooth® Document
TLE Review Electricity (Electricity).pptx
Hybrid model detection and classification of lung cancer
Hindi spoken digit analysis for native and non-native speakers
Web App vs Mobile App What Should You Build First.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...

First Steps in Android Development with Eclipse and Xamarin

  • 1. Sasha Goldshtein CTO, SELA Group @goldshtn blog.sashag.net First Steps in Android Development © Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
  • 2. (Relevant) Android Versions Froyo Gingerbread Honeycomb •Android 2.2 •Android 2.3.x •Android 3.x Ice Cream Sandwich •Android 4.0 Jelly Bean KitKat •Android 4.1-4.3 •Android 4.4
  • 3. Android Development Environment Native Android Xamarin (C#) • Eclipse/Android Studio • Android plugin for Eclipse (ADT) • Android SDK • Visual Studio • Xamarin.Android extension • Android SDK
  • 6. What Makes an Android Application? • • • • Presentation layer Derive from Activity Use Views Similar to forms in the desktop world • Worker processes in application • Invisible • Responsible for updating data sources, activities, notifications • Shareable data store • Preferred way to share data across applications Activities Services Content Providers • Message-passing framework • Broadcast messages to target activity/service • Broadcast consumers • Filtered by criteria • Listen to intents that match the criteria • Enables notifications without interrupting the current activity • Device notification area Intents Broadcast Receivers Notifications
  • 7. Resources Resources are non-code application parts Android resources include images, strings, simple values, animations, themes, etc. Best to keep separated/external from code External resources are easier to maintain, upgrade, and manage (…and localize!) Created under the res folder
  • 8. Layout Resources Layouts specify the UI Decouple presentation layer from code Enable designing UI in XML Can be referenced as any other resource from other layouts Usually, each layout XML file = view
  • 9. Code and User Interface Separation Strive to define most of the UI in XML files, and write only code in Java files Clean code/UI separation provides flexibility and easy maintenance Makes it easier to adjust for various types of hardware devices (similar to resource localization) UI elements can be manipulated from code Use findViewById to get UI element instance from code
  • 10. Connecting UI to Code Demo
  • 11. Localization Resources make localization easy Create a language-specific folder structure alongside the main folder structure Folder name includes qualifiers + res + values + strings.xml + values-fr + strings.xml + values-fr-rCA + strings.xml
  • 12. What Is an Activity? An activity represents a screen Using Views to provide UI Extends the Activity class To navigate screens, start a new activity using an intent By default, activities occupy the entire screen Can create semi-transparent/floating activities Last-in-first-out activity stack New activity pushes foreground activity down into stack Navigating back or finishing an activity pops from the stack the previous activity
  • 13. Creating Activities Extend the Activity class The base class presents an empty screen Encapsulates window display handling functionality User interfaces are created using Views Can create UI from layout or from View-derived instances //Using a layout resource identifier: setContentView(R.layout.main); //Using a View-derived instance: TextView text = new TextView(this); text.setText("New text!"); setContentView(text);
  • 14. Multiple Activities All activities must be declared in the application manifest <activity android:name=".SecondaryActivity"/> Span a sub-activity using an Intent Intent launch = new Intent(this, SecondaryActivity.class); startActivity(launch);
  • 15. Layouts Most commonly used layouts Layout Description FrameLayout Pins child views to the top left corner. Adding multiple children stacks each new child on top of the previous, with each new view obscuring the last. LinearLayout Adds each child view in a straight line, either vertically or horizontally. RelativeLayout Enables defining the positions of each of the child views relative to each other and the screen boundaries. TableLayout Lay out views using a grid of rows and columns. Multiple layouts can be mixed together
  • 16. Selectors and Lists ListView provides a convenient UI for value selection from a long list Presents multiple items on screen Spinner provides UI for value selection Presents only a single value at a time Drop-down overlay of selectable items
  • 17. Multiple Activities and ListView Demo
  • 18. Xamarin: C# on 3 Billion Devices Xamarin provides a .NET runtime for iOS and Android development in C# Proprietary IDE: Xamarin Studio Full Visual Studio integration
  • 20. Summary Android development environment Resources, layouts, views It’s just another {language, IDE, UI framework} The rest is just details: data, networking, preferences, styling, …
  • 21. Questions Sasha Goldshtein CTO, SELA Group @goldshtn blog.sashag.net

Editor's Notes

  • #6: Folders structure:Src – hold all the source filesGen – holds auto-generated filesRes – holds the resources of the application. Subfolders (like drawable-*) holds graphics optimized for different resolutionsRes/layout – holds the layout definition XML filesRes/values – holds XML files with predefined values, such as string resource dictionaries, constants, etc.Android (2.3.3) – holds a reference to JAR file with Android APIsReference Libraries/”MyLibrary” holds a reference to 3rd party libraries and JARs referenced in the projectAsses – holds other static application’s assets which will be deployed onto deviceAndroidManifest.xml – application manifest file describing the application being built and what components—activities, services, etc.—are being supplied by that application Res folder can hold additional directories such as menu, raw, xml with XML-based specifications of various parts of the application.