SlideShare une entreprise Scribd logo
1  sur  71
Télécharger pour lire hors ligne
LEARN ANDROID IN 2 HOURS With Aly Osama
AGENDA
● Introduction to Android
● Android Studio
● Hello World Application
● Application Components
● Application Resources
● User Interface
● Code Time
● Good UI
● Play Store
● Learn Android
INTRODUCTION TO ANDROID
ANDROID JOURNEY
Developed by Google. First
released version 1.5(Cupcake).
Current version - 6.0 (Marshmallow)
Major contributors: Samsung, LG, Vodafone, Acer, Dell, HTC, Sony Ericsson, Intel, Wipro
including others.
Pre-installed Google apps: Gmail, Google Calendar, Google Play, Google Music, Chrome
and others.
THE WORLD OF ANDROID
Openness
Customizable
Affordable(low-cost)
WHY NOT ANY OTHER TECHNOLOGY ?
1. Highest paying technology
2. A lot of career opportunities
3. Freshers are in high demand
ANDROID VERSIONS
ANDROID - ARCHITECTURE
ANDROID IS NOT LINUX
Android is built on the Linux kernel, but Android is not a Linux.
Linux kernel it`s a component which is responsible for device drivers, power management,
memory management, device management and resource access.
Native libraries such as WebKit, OpenGL, FreeType, SQLite, Media, C runtime library
(libc) etc.
Android Runtime, there are core libraries and DVM (Dalvik Virtual Machine) which is
responsible to run android application. DVM is like JVM but it is optimized for mobile
devices. It consumes less memory and provides fast performance.
App Framework - Android framework includes Android API's
Applications - All applications
EACH ANDROID APP LIVES IN ITS OWN SECURITY SANDBOX
● The Android operating system is a multi-user Linux system in which
each app is a different user.
● By default, the system assigns each app a unique Linux user ID.
The system sets permissions for all the files in an app so that only
the user ID assigned to that app can access them.
● Each process has its own virtual machine (VM), so an app's code
runs in isolation from other apps.
● By default, every app runs in its own Linux process. Android
starts the process when any of the app's components need to be
executed, then shuts down the process when it's no longer needed
or when the system must recover memory for other apps.
● Each app has own lifecycle
ANDROID STUDIO
STARTING ANDROID DEVELOPMENT
HELLO WORLD APPLICATION
CREATING A VIRTUAL ANDROID DEVICE
HELLO WORLD APPLICATION
1.Activity
2.Manifest File
3.Layout
1. ACTIVITY
● Represents a single screen in an App.
● Hosts all the view components of the screen like button, textview
and popups.
● Hosts all the logic of user interaction.
● Have their own lifecycle.
ACTIVITIES
Extending a class.
Accessing inherited methods and member variables.
Overriding methods.
Every Activity will inherit an “Activity”.
1. ACTIVITY
2. LAYOUT
Linear Layout
Relative Layout
Grid Layout
 Layout Items
 Image View
 Button
 Text View
 List View
3. ANDROID MANIFEST FILE
Declare Application Name
Declare Activates
Declare Application Theme
Declare Application Icon
Declare Other Components
Declare Permissions
APPLICATION COMPONENTS
APPLICATION COMPONENTS
● Activities
● Intent, Intent Filters
● Broadcast Receivers
● Services
● Content Providers
● Processes and Threads
ACTIVITIES
An Activity is an application component that provides a screen with which users
can interact. Activity = Window
How to create an Activity
1. Create a layout for your screen
<LinearLayout ... >
<EditText ... />
<EditText ... />
<Button ... />
</LinearLayout>
How to create an Activity
2. Create class which extends class Activity and override onCreate()
method
3. Declare your activity in the manifest file
<activity
android:name=".LoginActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
public class LoginActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
}
}
Activity Lifecycle
When an activity transitions into
and out of the different states it
is notified through various
callback methods.
Complete Android Fragment &
Activity Lifecycle
ACTIVITY LIFECYCLE
A Fragment represents a behavior or a portion of user interface in an Activity.
A Fragment must always be embedded in an activity and the fragment's lifecycle
is directly affected by the host activity's lifecycle.
Fragments
Android introduced
fragments in Android 3.0 (API
level 11), primarily to support
more dynamic and flexible UI
designs on large screens,
such as tablets.
Create a Fragment Class
How to add a Fragment into app
public class OrderSpinnerFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_orders_spinner, container, false);
}
}
Adding a fragment to an activity
● Declare the fragment inside the activity's layout file.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout ...>
<fragment android:name="com.example.news.ArticleListFragment"
android:id="@+id/list"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
● Or, programmatically add the fragment to an existing ViewGroup.
private void addUserInfoFragment(){
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
UserInfoFragment fragment = new UserInfoFragment();
fragmentTransaction.add(R.id.fragment_container, fragment);
fragmentTransaction.commit();
}
INTENT AND INTENT FILTERS
An Intent is a messaging object you can use to request an action from another
app component. Although intents facilitate communication between components in
several ways.
● start Activity
● start Service
● deliver Broadcast
There are two types of intents:
● Explicit intents specify the component to start by name
● Implicit intents declare a general action to perform, which allows a
component from another app to handle it
An Intent object carries information that the Android system uses to determine
which component to start (such as the exact component name or component
category that should receive the intent), plus information that the recipient
component uses in order to properly perform the action (such as the action to take
and the data to act upon).
The primary information contained in an Intent is the following:
● Component name - The name of the component to start.
● Action - The general action to be performed, such as ACTION_VIEW,
ACTION_EDIT, ACTION_MAIN, etc.
● Data - The data to operate on, such as a person record in the contacts
database, expressed as a Uri.
● Category - Gives additional information about the action to execute.
● Type - Specifies an explicit type (a MIME type) of the intent data.
● Extras - This is a Bundle of any additional information.
Building an Intent
Example of explicit intent
public void startUserDetailsActivity(long userId) {
Intent userDetailsIntent = new Intent(this, UserDetailsActivity.class);
userDetailsIntent.putExtra(USER_ID, userId);
startActivity(userDetailsIntent);
}
Example of implicit intent
public void sendMessageIntent(String textMessage) {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage);
sendIntent.setType("text/plain");
startActivity(sendIntent);
}
APPLICATION RESOURCES
APPLICATION RESOURCES
You should always externalize resources
such as images and strings from your
application code, so that you can maintain
them independently. Externalizing your
resources also allows you to provide
alternative resources that support specific
device configurations such as different
languages or screen sizes, which becomes
increasingly important as more Android-
powered devices become available with
different configurations.
MyProject/
src/
MyActivity.java
res/
drawable/
graphic.png
layout/
main.xml
info.xml
mipmap/
icon.png
values/
strings.xml
RESOURCE DIRECTORIES SUPPORTED INSIDE PROJECT RES/ DIRECTORY.
Directory Resource Type
animator/
anim/
XML files that define property animations and tween animations.
color/ XML files that define a state list of colors.
drawable/ Bitmap files (.png, .9.png, .jpg, .gif) or XML files.
layout/ XML files that define a user interface layout.
menu/ XML files that define application menus, such as an Options Menu,
Context Menu, or Sub Menu.
values/ XML files that contain simple values, such as strings, integers, and
colors.
PROVIDING ALTERNATIVE RESOURCES
Almost every application should provide
alternative resources to support specific
device configurations. For instance, you
should include alternative drawable
resources for different screen densities
and alternative string resources for
different languages. At runtime, Android
detects the current device configuration
and loads the appropriate resources for
your application.
USER INTERFACE
USER INTERFACE
All user interface elements in an Android app are built using View and
ViewGroup objects. A View is an object that draws something on the
screen that the user can interact with. A ViewGroup is an object that holds
other View (and ViewGroup) objects in order to define the layout of the
interface.
LAYOUTS
A layout defines the visual structure for a user interface, such as the UI
for an activity or app widget. You can declare a layout in two ways:
● Declare UI elements in XML.
● Instantiate layout elements at runtime.
<LinearLayout ... >
<EditText ... />
<EditText ... />
<Button ... />
</LinearLayout>
public class LoginActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
}
}
LAYOUTS
LinearLayout is a view group that
aligns all children in a single direction,
vertically or horizontally.
RelativeLayout is a view group that
displays child views in relative
positions.
LAYOUTS
TableLayout is a view that groups
views into rows and columns.
FrameLayout is a placeholder on
screen that you can use to display a
single view.
LAYOUTS
ListView is a view group that
displays a list of scrollable
items.
GridView is a ViewGroup
that displays items in a two-
dimensional, scrollable grid.
COMPARING ANDROID UI ELEMENTS TO SWING UI ELEMENTS
Comparing Android UI Elements to Swing UI Elements
Activities in Android refers almost to a (J)Frame in Swing.
Views in Android refers to (J)Components in Swing.
TextViews in Android refers to a (J)Labels in Swing.
EditTexts in Android refers to a (J)TextFields in Swing.
Buttons in Android refers to a (J)Buttons in Swing.
WIDGETS
DIALOGS AND TOASTS
A Dialog is a small window that prompts the user to make a decision or enter
additional information. A dialog does not fill the screen and is normally used for
modal events that require users to take an action before they can proceed.
A Toast provides simple feedback about an
operation in a small popup.
EVENTS WITH UI
BUTTON
OnClickListener
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//Do the required task
}
});
CODE TIME
GOOD UI
WHY GOOD UI IS IMPORTANT
Smooth performance.
Attracts users and keeps them.
Does not irritate users.
Does what is expected.
“No matter how useful or how good your app is, if its
UI is not awesome it will have very few chances of
remaining there in your user’s device.”
Bad UI =
BAD UI
MATERIAL DESIGN
https://material.google.com/#introduction-principles
USING THIRD PARTY LIBRARIES
USING THIRD PARTY LIBRARIES
Create your own customized UI components and reuse them.
Use third party libraries created by expert developers.
● Github
● AndroidArsenal.com
● AndroidWeekly.net
● Jake Wharton
● ...and many more(Just Google it)
PLAY STORE
PLAYSTORE
https://developer.android.com/distribute/googleplay/start.html
25$
BUT NOT TO WORRY...
800,0000 apps have < 100 downloads.
Another 700,000 have < 1000 downloads.
Another 400,000 have < 10,000 downloads.
Only 35,000 apps are downloaded more than 500,000.
HOW TO LEARN ANDROID
https://developer.android.com/training/index.html
https://www.udacity.com/course/developing
-android-apps--ud853
Udacity Course
Main Tutorial
That's all.
Quick start in android
development.

Contenu connexe

Tendances

Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application DevelopmentBenny Skogberg
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Androidguest213e237
 
Introduction to Android development - Presentation
Introduction to Android development - PresentationIntroduction to Android development - Presentation
Introduction to Android development - PresentationAtul Panjwani
 
Development of Mobile Application -PPT
Development of Mobile Application -PPTDevelopment of Mobile Application -PPT
Development of Mobile Application -PPTDhivya T
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android Ranjith Kumar
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppttirupathinews
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web DevelopmentSam Dias
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating systemSalma Begum
 
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 Operating System
Android Operating SystemAndroid Operating System
Android Operating SystemBilal Mirza
 
Android PPT Presentation 2018
Android PPT Presentation 2018Android PPT Presentation 2018
Android PPT Presentation 2018Rao Purna
 
Mobile Application Development Services-MobileApptelligence
Mobile Application Development Services-MobileApptelligenceMobile Application Development Services-MobileApptelligence
Mobile Application Development Services-MobileApptelligenceMobileapptelligence
 
Android Operating System (Androrid OS)
Android Operating System (Androrid OS)Android Operating System (Androrid OS)
Android Operating System (Androrid OS)Siddharth Belbase
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application DevelopmentSyed Absar
 

Tendances (20)

Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Android
 
Introduction to Android development - Presentation
Introduction to Android development - PresentationIntroduction to Android development - Presentation
Introduction to Android development - Presentation
 
Development of Mobile Application -PPT
Development of Mobile Application -PPTDevelopment of Mobile Application -PPT
Development of Mobile Application -PPT
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Introduction to Android
Introduction to Android Introduction to Android
Introduction to Android
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppt
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web Development
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating system
 
Android Widget
Android WidgetAndroid Widget
Android Widget
 
Android Basic Concept
Android Basic Concept Android Basic Concept
Android Basic Concept
 
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 Operating System
Android Operating SystemAndroid Operating System
Android Operating System
 
Android PPT Presentation 2018
Android PPT Presentation 2018Android PPT Presentation 2018
Android PPT Presentation 2018
 
Mobile Application Development Services-MobileApptelligence
Mobile Application Development Services-MobileApptelligenceMobile Application Development Services-MobileApptelligence
Mobile Application Development Services-MobileApptelligence
 
Android Operating System (Androrid OS)
Android Operating System (Androrid OS)Android Operating System (Androrid OS)
Android Operating System (Androrid OS)
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application Development
 
Android Services
Android ServicesAndroid Services
Android Services
 

Similaire à Introduction to Android Development

Hello android world
Hello android worldHello android world
Hello android worldeleksdev
 
Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Amit Saxena
 
Kotlin for Android App Development Presentation
Kotlin for Android App Development PresentationKotlin for Android App Development Presentation
Kotlin for Android App Development PresentationKnoldus Inc.
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologiesjerry vasoya
 
Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorialnirajsimulanis
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications developmentAlfredo Morresi
 
Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answerskavinilavuG
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentalsAmr Salman
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docPalakjaiswal43
 
Activities, Fragments, and Events
Activities, Fragments, and EventsActivities, Fragments, and Events
Activities, Fragments, and EventsHenry Osborne
 

Similaire à Introduction to Android Development (20)

Hello android world
Hello android worldHello android world
Hello android world
 
Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1
 
Android beginners David
Android beginners DavidAndroid beginners David
Android beginners David
 
Kotlin for Android App Development Presentation
Kotlin for Android App Development PresentationKotlin for Android App Development Presentation
Kotlin for Android App Development Presentation
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
 
Android Basic- CMC
Android Basic- CMCAndroid Basic- CMC
Android Basic- CMC
 
Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorial
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications development
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
 
Android
AndroidAndroid
Android
 
Unit2
Unit2Unit2
Unit2
 
Android components
Android componentsAndroid components
Android components
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.doc
 
Activities, Fragments, and Events
Activities, Fragments, and EventsActivities, Fragments, and Events
Activities, Fragments, and Events
 
Android
AndroidAndroid
Android
 

Plus de Aly Abdelkareem

An Inductive inference Machine
An Inductive inference MachineAn Inductive inference Machine
An Inductive inference MachineAly Abdelkareem
 
Digital Image Processing - Frequency Filters
Digital Image Processing - Frequency FiltersDigital Image Processing - Frequency Filters
Digital Image Processing - Frequency FiltersAly Abdelkareem
 
Deep learning: Overfitting , underfitting, and regularization
Deep learning: Overfitting , underfitting, and regularizationDeep learning: Overfitting , underfitting, and regularization
Deep learning: Overfitting , underfitting, and regularizationAly Abdelkareem
 
Practical Digital Image Processing 5
Practical Digital Image Processing 5Practical Digital Image Processing 5
Practical Digital Image Processing 5Aly Abdelkareem
 
Practical Digital Image Processing 4
Practical Digital Image Processing 4Practical Digital Image Processing 4
Practical Digital Image Processing 4Aly Abdelkareem
 
Practical Digital Image Processing 3
 Practical Digital Image Processing 3 Practical Digital Image Processing 3
Practical Digital Image Processing 3Aly Abdelkareem
 
Pattern recognition 4 - MLE
Pattern recognition 4 - MLEPattern recognition 4 - MLE
Pattern recognition 4 - MLEAly Abdelkareem
 
Practical Digital Image Processing 2
Practical Digital Image Processing 2Practical Digital Image Processing 2
Practical Digital Image Processing 2Aly Abdelkareem
 
Practical Digital Image Processing 1
Practical Digital Image Processing 1Practical Digital Image Processing 1
Practical Digital Image Processing 1Aly Abdelkareem
 
Machine Learning for Everyone
Machine Learning for EveryoneMachine Learning for Everyone
Machine Learning for EveryoneAly Abdelkareem
 
How to use deep learning on biological data
How to use deep learning on biological dataHow to use deep learning on biological data
How to use deep learning on biological dataAly Abdelkareem
 
Deep Learning using Keras
Deep Learning using KerasDeep Learning using Keras
Deep Learning using KerasAly Abdelkareem
 
Object extraction from satellite imagery using deep learning
Object extraction from satellite imagery using deep learningObject extraction from satellite imagery using deep learning
Object extraction from satellite imagery using deep learningAly Abdelkareem
 
Pattern recognition Tutorial 2
Pattern recognition Tutorial 2Pattern recognition Tutorial 2
Pattern recognition Tutorial 2Aly Abdelkareem
 
Android Udacity Study group 1
Android Udacity Study group 1Android Udacity Study group 1
Android Udacity Study group 1Aly Abdelkareem
 
Java for android developers
Java for android developersJava for android developers
Java for android developersAly Abdelkareem
 

Plus de Aly Abdelkareem (16)

An Inductive inference Machine
An Inductive inference MachineAn Inductive inference Machine
An Inductive inference Machine
 
Digital Image Processing - Frequency Filters
Digital Image Processing - Frequency FiltersDigital Image Processing - Frequency Filters
Digital Image Processing - Frequency Filters
 
Deep learning: Overfitting , underfitting, and regularization
Deep learning: Overfitting , underfitting, and regularizationDeep learning: Overfitting , underfitting, and regularization
Deep learning: Overfitting , underfitting, and regularization
 
Practical Digital Image Processing 5
Practical Digital Image Processing 5Practical Digital Image Processing 5
Practical Digital Image Processing 5
 
Practical Digital Image Processing 4
Practical Digital Image Processing 4Practical Digital Image Processing 4
Practical Digital Image Processing 4
 
Practical Digital Image Processing 3
 Practical Digital Image Processing 3 Practical Digital Image Processing 3
Practical Digital Image Processing 3
 
Pattern recognition 4 - MLE
Pattern recognition 4 - MLEPattern recognition 4 - MLE
Pattern recognition 4 - MLE
 
Practical Digital Image Processing 2
Practical Digital Image Processing 2Practical Digital Image Processing 2
Practical Digital Image Processing 2
 
Practical Digital Image Processing 1
Practical Digital Image Processing 1Practical Digital Image Processing 1
Practical Digital Image Processing 1
 
Machine Learning for Everyone
Machine Learning for EveryoneMachine Learning for Everyone
Machine Learning for Everyone
 
How to use deep learning on biological data
How to use deep learning on biological dataHow to use deep learning on biological data
How to use deep learning on biological data
 
Deep Learning using Keras
Deep Learning using KerasDeep Learning using Keras
Deep Learning using Keras
 
Object extraction from satellite imagery using deep learning
Object extraction from satellite imagery using deep learningObject extraction from satellite imagery using deep learning
Object extraction from satellite imagery using deep learning
 
Pattern recognition Tutorial 2
Pattern recognition Tutorial 2Pattern recognition Tutorial 2
Pattern recognition Tutorial 2
 
Android Udacity Study group 1
Android Udacity Study group 1Android Udacity Study group 1
Android Udacity Study group 1
 
Java for android developers
Java for android developersJava for android developers
Java for android developers
 

Dernier

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Dernier (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Introduction to Android Development

  • 1. LEARN ANDROID IN 2 HOURS With Aly Osama
  • 2. AGENDA ● Introduction to Android ● Android Studio ● Hello World Application ● Application Components ● Application Resources ● User Interface ● Code Time ● Good UI ● Play Store ● Learn Android
  • 4. ANDROID JOURNEY Developed by Google. First released version 1.5(Cupcake). Current version - 6.0 (Marshmallow) Major contributors: Samsung, LG, Vodafone, Acer, Dell, HTC, Sony Ericsson, Intel, Wipro including others. Pre-installed Google apps: Gmail, Google Calendar, Google Play, Google Music, Chrome and others.
  • 5. THE WORLD OF ANDROID Openness Customizable Affordable(low-cost)
  • 6. WHY NOT ANY OTHER TECHNOLOGY ? 1. Highest paying technology 2. A lot of career opportunities 3. Freshers are in high demand
  • 8.
  • 10. ANDROID IS NOT LINUX Android is built on the Linux kernel, but Android is not a Linux. Linux kernel it`s a component which is responsible for device drivers, power management, memory management, device management and resource access. Native libraries such as WebKit, OpenGL, FreeType, SQLite, Media, C runtime library (libc) etc. Android Runtime, there are core libraries and DVM (Dalvik Virtual Machine) which is responsible to run android application. DVM is like JVM but it is optimized for mobile devices. It consumes less memory and provides fast performance. App Framework - Android framework includes Android API's Applications - All applications
  • 11. EACH ANDROID APP LIVES IN ITS OWN SECURITY SANDBOX ● The Android operating system is a multi-user Linux system in which each app is a different user. ● By default, the system assigns each app a unique Linux user ID. The system sets permissions for all the files in an app so that only the user ID assigned to that app can access them. ● Each process has its own virtual machine (VM), so an app's code runs in isolation from other apps. ● By default, every app runs in its own Linux process. Android starts the process when any of the app's components need to be executed, then shuts down the process when it's no longer needed or when the system must recover memory for other apps. ● Each app has own lifecycle
  • 14.
  • 15.
  • 16.
  • 17.
  • 19. CREATING A VIRTUAL ANDROID DEVICE
  • 20.
  • 21.
  • 22.
  • 23.
  • 25. 1. ACTIVITY ● Represents a single screen in an App. ● Hosts all the view components of the screen like button, textview and popups. ● Hosts all the logic of user interaction. ● Have their own lifecycle.
  • 26. ACTIVITIES Extending a class. Accessing inherited methods and member variables. Overriding methods. Every Activity will inherit an “Activity”.
  • 28. 2. LAYOUT Linear Layout Relative Layout Grid Layout  Layout Items  Image View  Button  Text View  List View
  • 29. 3. ANDROID MANIFEST FILE Declare Application Name Declare Activates Declare Application Theme Declare Application Icon Declare Other Components Declare Permissions
  • 30.
  • 32. APPLICATION COMPONENTS ● Activities ● Intent, Intent Filters ● Broadcast Receivers ● Services ● Content Providers ● Processes and Threads
  • 33. ACTIVITIES An Activity is an application component that provides a screen with which users can interact. Activity = Window How to create an Activity 1. Create a layout for your screen <LinearLayout ... > <EditText ... /> <EditText ... /> <Button ... /> </LinearLayout>
  • 34. How to create an Activity 2. Create class which extends class Activity and override onCreate() method 3. Declare your activity in the manifest file <activity android:name=".LoginActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> public class LoginActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); } }
  • 35. Activity Lifecycle When an activity transitions into and out of the different states it is notified through various callback methods. Complete Android Fragment & Activity Lifecycle
  • 37. A Fragment represents a behavior or a portion of user interface in an Activity. A Fragment must always be embedded in an activity and the fragment's lifecycle is directly affected by the host activity's lifecycle. Fragments Android introduced fragments in Android 3.0 (API level 11), primarily to support more dynamic and flexible UI designs on large screens, such as tablets.
  • 38. Create a Fragment Class How to add a Fragment into app public class OrderSpinnerFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_orders_spinner, container, false); } }
  • 39. Adding a fragment to an activity ● Declare the fragment inside the activity's layout file. <?xml version="1.0" encoding="utf-8"?> <LinearLayout ...> <fragment android:name="com.example.news.ArticleListFragment" android:id="@+id/list" android:layout_weight="1" android:layout_width="0dp" android:layout_height="match_parent" /> </LinearLayout> ● Or, programmatically add the fragment to an existing ViewGroup. private void addUserInfoFragment(){ FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); UserInfoFragment fragment = new UserInfoFragment(); fragmentTransaction.add(R.id.fragment_container, fragment); fragmentTransaction.commit(); }
  • 40. INTENT AND INTENT FILTERS An Intent is a messaging object you can use to request an action from another app component. Although intents facilitate communication between components in several ways. ● start Activity ● start Service ● deliver Broadcast There are two types of intents: ● Explicit intents specify the component to start by name ● Implicit intents declare a general action to perform, which allows a component from another app to handle it
  • 41. An Intent object carries information that the Android system uses to determine which component to start (such as the exact component name or component category that should receive the intent), plus information that the recipient component uses in order to properly perform the action (such as the action to take and the data to act upon). The primary information contained in an Intent is the following: ● Component name - The name of the component to start. ● Action - The general action to be performed, such as ACTION_VIEW, ACTION_EDIT, ACTION_MAIN, etc. ● Data - The data to operate on, such as a person record in the contacts database, expressed as a Uri. ● Category - Gives additional information about the action to execute. ● Type - Specifies an explicit type (a MIME type) of the intent data. ● Extras - This is a Bundle of any additional information. Building an Intent
  • 42. Example of explicit intent public void startUserDetailsActivity(long userId) { Intent userDetailsIntent = new Intent(this, UserDetailsActivity.class); userDetailsIntent.putExtra(USER_ID, userId); startActivity(userDetailsIntent); } Example of implicit intent public void sendMessageIntent(String textMessage) { Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage); sendIntent.setType("text/plain"); startActivity(sendIntent); }
  • 44. APPLICATION RESOURCES You should always externalize resources such as images and strings from your application code, so that you can maintain them independently. Externalizing your resources also allows you to provide alternative resources that support specific device configurations such as different languages or screen sizes, which becomes increasingly important as more Android- powered devices become available with different configurations. MyProject/ src/ MyActivity.java res/ drawable/ graphic.png layout/ main.xml info.xml mipmap/ icon.png values/ strings.xml
  • 45. RESOURCE DIRECTORIES SUPPORTED INSIDE PROJECT RES/ DIRECTORY. Directory Resource Type animator/ anim/ XML files that define property animations and tween animations. color/ XML files that define a state list of colors. drawable/ Bitmap files (.png, .9.png, .jpg, .gif) or XML files. layout/ XML files that define a user interface layout. menu/ XML files that define application menus, such as an Options Menu, Context Menu, or Sub Menu. values/ XML files that contain simple values, such as strings, integers, and colors.
  • 46. PROVIDING ALTERNATIVE RESOURCES Almost every application should provide alternative resources to support specific device configurations. For instance, you should include alternative drawable resources for different screen densities and alternative string resources for different languages. At runtime, Android detects the current device configuration and loads the appropriate resources for your application.
  • 48. USER INTERFACE All user interface elements in an Android app are built using View and ViewGroup objects. A View is an object that draws something on the screen that the user can interact with. A ViewGroup is an object that holds other View (and ViewGroup) objects in order to define the layout of the interface.
  • 49. LAYOUTS A layout defines the visual structure for a user interface, such as the UI for an activity or app widget. You can declare a layout in two ways: ● Declare UI elements in XML. ● Instantiate layout elements at runtime. <LinearLayout ... > <EditText ... /> <EditText ... /> <Button ... /> </LinearLayout> public class LoginActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); } }
  • 50. LAYOUTS LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. RelativeLayout is a view group that displays child views in relative positions.
  • 51. LAYOUTS TableLayout is a view that groups views into rows and columns. FrameLayout is a placeholder on screen that you can use to display a single view.
  • 52. LAYOUTS ListView is a view group that displays a list of scrollable items. GridView is a ViewGroup that displays items in a two- dimensional, scrollable grid.
  • 53. COMPARING ANDROID UI ELEMENTS TO SWING UI ELEMENTS Comparing Android UI Elements to Swing UI Elements Activities in Android refers almost to a (J)Frame in Swing. Views in Android refers to (J)Components in Swing. TextViews in Android refers to a (J)Labels in Swing. EditTexts in Android refers to a (J)TextFields in Swing. Buttons in Android refers to a (J)Buttons in Swing.
  • 55. DIALOGS AND TOASTS A Dialog is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed. A Toast provides simple feedback about an operation in a small popup.
  • 60. WHY GOOD UI IS IMPORTANT Smooth performance. Attracts users and keeps them. Does not irritate users. Does what is expected. “No matter how useful or how good your app is, if its UI is not awesome it will have very few chances of remaining there in your user’s device.” Bad UI =
  • 63. USING THIRD PARTY LIBRARIES
  • 64. USING THIRD PARTY LIBRARIES Create your own customized UI components and reuse them. Use third party libraries created by expert developers. ● Github ● AndroidArsenal.com ● AndroidWeekly.net ● Jake Wharton ● ...and many more(Just Google it)
  • 67.
  • 68. BUT NOT TO WORRY... 800,0000 apps have < 100 downloads. Another 700,000 have < 1000 downloads. Another 400,000 have < 10,000 downloads. Only 35,000 apps are downloaded more than 500,000.
  • 69.
  • 70. HOW TO LEARN ANDROID https://developer.android.com/training/index.html https://www.udacity.com/course/developing -android-apps--ud853 Udacity Course Main Tutorial
  • 71. That's all. Quick start in android development.

Notes de l'éditeur

  1. Росказати історію Фрагментів. Для чого. Головна мета. Два види сервісів! Інтент Сервіс!
  2. Росказати історію Фрагментів. Для чого. Головна мета. Два види сервісів! Інтент Сервіс!
  3. Росказати історію Фрагментів. Для чого. Головна мета.