SlideShare a Scribd company logo
Android Application Development
 Being Active Through Activities & Intents




                                             Ahsanul Karim
                                ahsanul.karim@sentinelbd.com
                                     Sentinel Solutions Ltd.
                                   http://www.sentinelbd.com
Today We’re Covering…
•   Application Structure
•   Android Application Anatomy
•   Activity
•   Layout
•   Using Layouts from Activity
•   Activity to Activity Transition
•   Activity Lifecycle
•   Exercise
Android Activities
Activity
Activity provides a user generally with an interactive screen to do something like:
Dialing the phone, View a map List of something for user to select or Anything you
want your user to do
•   An application usually consists of multiple activities.
•   Typically, one activity in an application is specified as the "main" activity,
    which is presented to the user when launching the application for the first
    time. (which is specified in AndroidMenifest.xml)




The <action> element specifies that this is the "main" entry point to the application.
The <category> element specifies that this activity should be listed in the system's application
launcher (to allow users to launch this activity).
Android Activities (Contd..)
Creating Activity
We have already created Activities. But how did we create it?
Let’s revisit…




1. We created subclass of Activity base class
2. We implemented one callback method onCreate


 Open Questions:
1. What is creating subclass???
2. What is callback methods???
Android Activities (Contd..)
Next Step: Implementing User Interface
   1. Design res/layout/yourlayout.xml
   2. Use Views from Activity class

Next Step: Implementing User Interface
   <manifest ... >
    <application ... >
        <activity android:name=".ExampleActivity" />
        ...
    </application ... >
    ...
   </manifest >

 Next Step: Starting Activity
We can start another activity by calling startActivity(), passing it an Intent that describes the
activity you want to start.

   Intent intent = new Intent(this, ToActivity.class);
   startActivity(intent);
Android Activities Exercise
 1. We’ll make 2 Activities
 2. Registration with basic features and validation:
     1. Email address
     2. First Name, Last Name
     3. Date of Birth
     4. Password
     5. Confirm Password
     6. I agree to terms and conditions
     7. Buttons: Cancel, Submit
 3. Login
     1. Email address
     2. Password
     3. Buttons: New User, Login
     (To be added: Remember me)


     Link: http://developer.android.com/guide/appendix/faq/commontasks.html
Android Activities Exercise (Contd.)
 1. How to add new Activities to the application
 2. How to navigate from one Activity to another

 How to navigate from one Activity to another


                                         Intent


 Intent intent_1_to_2 = new Intent(this, Activity2.class);
 startActivity(intent_1_to_2);




                                              Intent


                                       Intent intent_2_to_1 = new Intent(this, Activity1.class);
                                       startActivity(intent_2_to_1);
Android Activities Exercise (Contd.)
 How to navigate from one Activity to another



                                          Intent


 Intent intent1to2 = new Intent(this, Activity2.class);
 startActivity(intent1to2);




                                               Intent


                                            Intent intent2to1 = new Intent(this, Activity1.class);
                                            startActivity(intent2to1);
Activity Lifecycle
Activity Lifecycle (Contd.)

More Related Content

PDF
Lecture 3 getting active through activities
PPTX
Android MapView and MapActivity
PPT
Day 4: Android: UI Widgets
PPTX
Day 15: Working in Background
PPTX
Android Workshop: Day 1 Part 3
PDF
Android Basic Components
PPTX
Android Application Component: BroadcastReceiver Tutorial
PPTX
Android components
Lecture 3 getting active through activities
Android MapView and MapActivity
Day 4: Android: UI Widgets
Day 15: Working in Background
Android Workshop: Day 1 Part 3
Android Basic Components
Android Application Component: BroadcastReceiver Tutorial
Android components

What's hot (20)

PPT
Android Basics
PPTX
Android Tutorials : Basic widgets
PPTX
Android Widget
PDF
Marakana Android User Interface
PDF
Android appwidget
PPTX
04 activities - Android
ODP
Ppt 2 android_basics
PDF
Android session 2
PDF
Android session 1
PDF
Android session 3
PPTX
Android apps development
PDF
Android UI Fundamentals part 1
PDF
Day 8: Dealing with Lists and ListViews
PDF
Android Components
PDF
Lecture 2(b) Android Internals A Quick Overview
PPTX
PPT
View groups containers
PPTX
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
PPTX
Android Fundamental
PDF
Android activities & views
Android Basics
Android Tutorials : Basic widgets
Android Widget
Marakana Android User Interface
Android appwidget
04 activities - Android
Ppt 2 android_basics
Android session 2
Android session 1
Android session 3
Android apps development
Android UI Fundamentals part 1
Day 8: Dealing with Lists and ListViews
Android Components
Lecture 2(b) Android Internals A Quick Overview
View groups containers
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android Fundamental
Android activities & views
Ad

Viewers also liked (20)

PPTX
Day 9: Make Your App Location Aware using Location API
PPT
Android User Interface: Basic Form Widgets
PPTX
Android Services
PDF
Day 2 android internals a quick overview
PPTX
Day: 1 Introduction to Mobile Application Development (in Android)
PPTX
Android GPS Tutorial
PPTX
Android 1.8 sensor
PDF
List Views
PPTX
Creating the first app with android studio
PPT
Day 6: Android BroadcastReceiver Component
PPTX
Action Bar Sherlock tutorial
PPT
Day 5: Android User Interface [View Widgets]
PDF
Day1 before getting_started
PDF
Training android
PDF
Sensors in Android (old)
PDF
GCM for Android
PPTX
Android Workshop Day 1 Part 2
PPTX
Mcq peresentation
PDF
AndroidManifest
PDF
Ui layout (incomplete)
Day 9: Make Your App Location Aware using Location API
Android User Interface: Basic Form Widgets
Android Services
Day 2 android internals a quick overview
Day: 1 Introduction to Mobile Application Development (in Android)
Android GPS Tutorial
Android 1.8 sensor
List Views
Creating the first app with android studio
Day 6: Android BroadcastReceiver Component
Action Bar Sherlock tutorial
Day 5: Android User Interface [View Widgets]
Day1 before getting_started
Training android
Sensors in Android (old)
GCM for Android
Android Workshop Day 1 Part 2
Mcq peresentation
AndroidManifest
Ui layout (incomplete)
Ad

Similar to Day 4: Android: Getting Active through Activities (20)

PPT
Multiple Activity and Navigation Primer
PPTX
Activity & Shared Preference
PPTX
Pertemuan 03 - Activities and intents.pptx
PDF
Android activity
PDF
Android activity
PPTX
Unit 5 Activity and Activity Life Cycle.pptx
PDF
Android platform activity
PPTX
learn about Android Extended Intents.pptx
PPT
Day 3: Getting Active Through Activities
PPT
Day 3: Getting Active Through Activities
PPTX
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
PPT
android activity
PPTX
Android development session 2 - intent and activity
DOCX
Android building blocks and application life cycle-chapter3
PPTX
Unit-1.2 Android-Activities, Fragments, and Intents (1).pptx
PDF
Android development - Activities, Views & Intents
ODP
Android App Development - 02 Activity and intent
PPT
Best android classes in mumbai
PPT
Android Bootcamp Tanzania:intents
PPT
Android_ver_01
Multiple Activity and Navigation Primer
Activity & Shared Preference
Pertemuan 03 - Activities and intents.pptx
Android activity
Android activity
Unit 5 Activity and Activity Life Cycle.pptx
Android platform activity
learn about Android Extended Intents.pptx
Day 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
android activity
Android development session 2 - intent and activity
Android building blocks and application life cycle-chapter3
Unit-1.2 Android-Activities, Fragments, and Intents (1).pptx
Android development - Activities, Views & Intents
Android App Development - 02 Activity and intent
Best android classes in mumbai
Android Bootcamp Tanzania:intents
Android_ver_01

More from Ahsanul Karim (11)

PDF
Lecture 5: Storage: Saving Data Database, Files & Preferences
PDF
Lecture 1 Session 1 Before Getting Started
PDF
লেকচার ১ (ক)- শুরুর আগে:
PPTX
Day 15: Content Provider: Using Contacts API
PDF
Day 8: Dealing with Lists and ListViews
DOC
Day 4: Activity lifecycle
PDF
Day 1 Android: Before Getting Started
PDF
Mobile Banking in Bangladesh: An Incomplete Study
PPTX
Android before getting started
PPTX
Introduction to Android Development: Before Getting Started
PPTX
Client-Server
Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 1 Session 1 Before Getting Started
লেকচার ১ (ক)- শুরুর আগে:
Day 15: Content Provider: Using Contacts API
Day 8: Dealing with Lists and ListViews
Day 4: Activity lifecycle
Day 1 Android: Before Getting Started
Mobile Banking in Bangladesh: An Incomplete Study
Android before getting started
Introduction to Android Development: Before Getting Started
Client-Server

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Cloud computing and distributed systems.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Chapter 3 Spatial Domain Image Processing.pdf
Big Data Technologies - Introduction.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Monthly Chronicles - July 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Cloud computing and distributed systems.
The AUB Centre for AI in Media Proposal.docx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Unlocking AI with Model Context Protocol (MCP)

Day 4: Android: Getting Active through Activities

  • 1. Android Application Development Being Active Through Activities & Intents Ahsanul Karim ahsanul.karim@sentinelbd.com Sentinel Solutions Ltd. http://www.sentinelbd.com
  • 2. Today We’re Covering… • Application Structure • Android Application Anatomy • Activity • Layout • Using Layouts from Activity • Activity to Activity Transition • Activity Lifecycle • Exercise
  • 3. Android Activities Activity Activity provides a user generally with an interactive screen to do something like: Dialing the phone, View a map List of something for user to select or Anything you want your user to do • An application usually consists of multiple activities. • Typically, one activity in an application is specified as the "main" activity, which is presented to the user when launching the application for the first time. (which is specified in AndroidMenifest.xml) The <action> element specifies that this is the "main" entry point to the application. The <category> element specifies that this activity should be listed in the system's application launcher (to allow users to launch this activity).
  • 4. Android Activities (Contd..) Creating Activity We have already created Activities. But how did we create it? Let’s revisit… 1. We created subclass of Activity base class 2. We implemented one callback method onCreate Open Questions: 1. What is creating subclass??? 2. What is callback methods???
  • 5. Android Activities (Contd..) Next Step: Implementing User Interface 1. Design res/layout/yourlayout.xml 2. Use Views from Activity class Next Step: Implementing User Interface <manifest ... > <application ... > <activity android:name=".ExampleActivity" /> ... </application ... > ... </manifest > Next Step: Starting Activity We can start another activity by calling startActivity(), passing it an Intent that describes the activity you want to start. Intent intent = new Intent(this, ToActivity.class); startActivity(intent);
  • 6. Android Activities Exercise 1. We’ll make 2 Activities 2. Registration with basic features and validation: 1. Email address 2. First Name, Last Name 3. Date of Birth 4. Password 5. Confirm Password 6. I agree to terms and conditions 7. Buttons: Cancel, Submit 3. Login 1. Email address 2. Password 3. Buttons: New User, Login (To be added: Remember me) Link: http://developer.android.com/guide/appendix/faq/commontasks.html
  • 7. Android Activities Exercise (Contd.) 1. How to add new Activities to the application 2. How to navigate from one Activity to another How to navigate from one Activity to another Intent Intent intent_1_to_2 = new Intent(this, Activity2.class); startActivity(intent_1_to_2); Intent Intent intent_2_to_1 = new Intent(this, Activity1.class); startActivity(intent_2_to_1);
  • 8. Android Activities Exercise (Contd.) How to navigate from one Activity to another Intent Intent intent1to2 = new Intent(this, Activity2.class); startActivity(intent1to2); Intent Intent intent2to1 = new Intent(this, Activity1.class); startActivity(intent2to1);