SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Android Apps Development – Training
Day - 2
XML
● Android's defined tags
● Used to define some of the resources:
– Layouts
– Strings
● Android Manifest
● Preferred way for defining UI elements:
– Separation of code
R class
● Auto-generated: DO NOT EDIT
● Contains ID of the project resources
● Use findViewById and Resources object to get
access to the resources:
– E.g. Button = (Button)findViewById(R.id.button);
– E.g. getResources().getString(R.string.hello);
Layout
● Eclipse has a great UI creator
– Generates all the XML for you !
● Composed of View objects
● Can be specified for portrait or landscape
– Different designs for different orientation.
Contd.
● A layout/activity is composed of Views and
ViewGroups.
● View is something that is visible.
● Examples:
– TextViews, Buttons,
TimePicker, DatePicker
Contd.
– Button
● <Button
android:id = “@+id/button”
android:layout_width = “fill_parent”
android:layout_height = “wrap_content”
android:text = “Button”/>
There are 3 ways
to declaring
width and height:
a. fill_parent
b. wrap_content
c. match_parent
Do not forget
to define us :)
Contd.
– EditText
● <EditText
android:id= “@+id/number”
android:layout_width= “fill_parent”
android:layout_height= “wrap_content”
android:inputType= “number”/>
You can change the
type of inputs as
necessary
Contd.
– TextView
● <TextView
android:id= “@+id/result”
android:layout_height= “wrap_content”
android:layout_width= “fill_parent”
android:visibility= “invisible”/>
Visibility types:
a. visible
b. invisible
c. gone
Contd.
● ViewGroups are the building blocks to Views:
– This is the <body> to your View
– One or more View can be grouped into a ViewGroup
● Types to ViewGroups:
– LinearLayout*
– RelativeLayout*
– FrameLayout
– TableLayout
– ScrollView*, etc.
● Each layout has something unique to it
● Each layout has a purpose !
LinearLayout
● <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/an
droid"
android:layout_width= “match_parent”
android:layout_height= “match_parent”
android:orientation= “vertical”>
… (TextViews, Buttons etc.)
</LinearLayout>
Declaring the XML
namespace
(done in the
1st ViewGroup)
Unique for this ViewGroup
a. vertical
b. horizontal
RelativeLayout
● Does not have any android:orientation.
● Affects the layouts inside it.
● Views are arranged according to references.
Contd.
● <RelativeLayout … >
<Button android:id= “@+id/btn”
android:layout_alignParentTop= "true" … />
<TextView android:layout_below = “@id/btn” … />
<TextView android:layout_toRightOf = “@id/btn” …/>
<TextView android:layout_toLeftOf = “@id/btn” …/>
<TextView android:layout_alignParentBottom =
“true” .../>
</RelativeLayout>
Various other positioning
techniques also there:
alignLeft
alignBaseLine
above, etc.
LinearLayout VS. RelativeLayout
LinearLayout RelativeLayout
Lets Unite !
<LinearLayout … >
<RelativeLayout … >
…
</RelativeLayout>
</LinearLayout>
● You can use Viewgroups within Viewgroups :
LAYOUTCEPTION !
Building a simple UI
Redirect to another page
with all the filled details
What is needed for this?
● Intents
– <a href= “target”>page 2</a>
– Intent = Redirecting !
– But wait …
– Intent is used to call into android's drivers, other
applications as well.
– Powerful inter/intra application message-passing
framework.
● Modification in the Android Manifest:
<activity android:name=".Classname">
<intent-filter>
<action
android:name="android.intent.action.NAME"/>
<category
android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
Declares an activity
(an Activity subclass)
that implements
part of the application's
visual user interface.
The types of
intents
that an app
can respond to
Adds a category
name to
an intent filter
Adds an
action
to an
intent filter.
● Confused ? Don't worry !
● Remeber this ?
● In your main class:
Intent i = new Intent(MainActivity.this,
ClassName.class); // Instantiating the intent class
i.putExtra(“name”, value); // values to be sent
startActivity(i); // Starting the intent
● Another class:
Intent i = getIntent(); //getting the intent object
String name = i.getStringExtra(“name”); //getting value
from passed intent
Explaining it all
● Create your form
– UI interface
– Result interface
● Create two classes that extend the UI
– FormClass?
– ResultClass?
● Add your ResultClass to the Android Manifest.
● Pass data from your FormClass to ResultClass using
intents.
What is Manifest ?
● Presents essential information about:
– The application to the Android system
● Information the system must have before it can run any
of the application's code.
Remember this ?
● Name of the Java package for the application.
● It describes the components of the application — the activities, services, broadcast
receivers, and content providers.
● It determines which processes will host application components.
● It declares which permissions the application must have in order to access
protected parts of the API and interact with other applications.
● It also declares the permissions that others are required to have in order to interact
with the application's components.
● It lists the Instrumentation classes that provide profiling and other information as the
application is running. These declarations are present in the manifest only while the
application is being developed and tested; they're removed before the application is
published.
● It declares the minimum level of the Android API that the application requires.
● It lists the libraries that the application must be linked against.
“Have you ever wondered
what happens when you press the back
button/ home button on android?”
Activity Life Cycle

Weitere ähnliche Inhalte

Was ist angesagt?

Commit University - Exploring Angular 2
Commit University - Exploring Angular 2Commit University - Exploring Angular 2
Commit University - Exploring Angular 2Commit University
 
Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Ross Dederer
 
Feedback using Angularjs + Typescript at Serenytics
Feedback using Angularjs +  Typescript at SerenyticsFeedback using Angularjs +  Typescript at Serenytics
Feedback using Angularjs + Typescript at SerenyticsAdrien Chauve
 
Basic of Java Netbeans
Basic of Java NetbeansBasic of Java Netbeans
Basic of Java NetbeansShrey Goswami
 
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Codemotion
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next FrameworkCommit University
 
Java- GUI- Mazenet solution
Java- GUI- Mazenet solutionJava- GUI- Mazenet solution
Java- GUI- Mazenet solutionMazenetsolution
 
Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Minko Gechev
 
JSF Custom Components
JSF Custom ComponentsJSF Custom Components
JSF Custom ComponentsMichael Fons
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2Naveen Pete
 
View groups containers
View groups containersView groups containers
View groups containersMani Selvaraj
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2Knoldus Inc.
 
iOS Layout Overview
iOS Layout OverviewiOS Layout Overview
iOS Layout OverviewMake School
 
준비하세요 Angular js 2.0
준비하세요 Angular js 2.0준비하세요 Angular js 2.0
준비하세요 Angular js 2.0Jeado Ko
 
What's new and exciting with JSF 2.0
What's new and exciting with JSF 2.0What's new and exciting with JSF 2.0
What's new and exciting with JSF 2.0Michael Fons
 

Was ist angesagt? (20)

Session 2- day 3
Session 2- day 3Session 2- day 3
Session 2- day 3
 
Commit University - Exploring Angular 2
Commit University - Exploring Angular 2Commit University - Exploring Angular 2
Commit University - Exploring Angular 2
 
Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2
 
Feedback using Angularjs + Typescript at Serenytics
Feedback using Angularjs +  Typescript at SerenyticsFeedback using Angularjs +  Typescript at Serenytics
Feedback using Angularjs + Typescript at Serenytics
 
Basic of Java Netbeans
Basic of Java NetbeansBasic of Java Netbeans
Basic of Java Netbeans
 
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
 
Angular
AngularAngular
Angular
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
 
Java- GUI- Mazenet solution
Java- GUI- Mazenet solutionJava- GUI- Mazenet solution
Java- GUI- Mazenet solution
 
Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Building Universal Applications with Angular 2
Building Universal Applications with Angular 2
 
JSF Custom Components
JSF Custom ComponentsJSF Custom Components
JSF Custom Components
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
View groups containers
View groups containersView groups containers
View groups containers
 
React render props
React render propsReact render props
React render props
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
iOS Layout Overview
iOS Layout OverviewiOS Layout Overview
iOS Layout Overview
 
Angular2 - In Action
Angular2  - In ActionAngular2  - In Action
Angular2 - In Action
 
준비하세요 Angular js 2.0
준비하세요 Angular js 2.0준비하세요 Angular js 2.0
준비하세요 Angular js 2.0
 
GUI Programming with Java
GUI Programming with JavaGUI Programming with Java
GUI Programming with Java
 
What's new and exciting with JSF 2.0
What's new and exciting with JSF 2.0What's new and exciting with JSF 2.0
What's new and exciting with JSF 2.0
 

Andere mochten auch

Android進階UI控制元件
Android進階UI控制元件Android進階UI控制元件
Android進階UI控制元件艾鍗科技
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)Khaled Anaqwa
 
不同尺寸與解析度的螢幕下,Android 程式 UI 的設計與解決方式
不同尺寸與解析度的螢幕下,Android 程式 UI 的設計與解決方式不同尺寸與解析度的螢幕下,Android 程式 UI 的設計與解決方式
不同尺寸與解析度的螢幕下,Android 程式 UI 的設計與解決方式信宏 陳
 
Android Layout模組化介紹
Android Layout模組化介紹Android Layout模組化介紹
Android Layout模組化介紹Chris Jeng
 
簡單上手Android studio
簡單上手Android studio簡單上手Android studio
簡單上手Android studio琨堯 林
 

Andere mochten auch (6)

Basic Android Layout
Basic Android LayoutBasic Android Layout
Basic Android Layout
 
Android進階UI控制元件
Android進階UI控制元件Android進階UI控制元件
Android進階UI控制元件
 
Android Training (Android UI)
Android Training (Android UI)Android Training (Android UI)
Android Training (Android UI)
 
不同尺寸與解析度的螢幕下,Android 程式 UI 的設計與解決方式
不同尺寸與解析度的螢幕下,Android 程式 UI 的設計與解決方式不同尺寸與解析度的螢幕下,Android 程式 UI 的設計與解決方式
不同尺寸與解析度的螢幕下,Android 程式 UI 的設計與解決方式
 
Android Layout模組化介紹
Android Layout模組化介紹Android Layout模組化介紹
Android Layout模組化介紹
 
簡單上手Android studio
簡單上手Android studio簡單上手Android studio
簡單上手Android studio
 

Ähnlich wie Android training day 2

mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-TejamFandat
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentMonir Zzaman
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layoutKrazy Koder
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
Android Tutorial
Android TutorialAndroid Tutorial
Android TutorialFun2Do Labs
 
Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Kavya Barnadhya Hazarika
 
Android Apps Development Basic
Android Apps Development BasicAndroid Apps Development Basic
Android Apps Development BasicMonir Zzaman
 
Mobile application development
Mobile application developmentMobile application development
Mobile application developmentumesh patil
 
Training Session 2 - Day 2
Training Session 2 - Day 2Training Session 2 - Day 2
Training Session 2 - Day 2Vivek Bhusal
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Androidguest213e237
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2Tadas Jurelevičius
 
Lecture 02: Android Layouts.pptx
Lecture 02: Android Layouts.pptxLecture 02: Android Layouts.pptx
Lecture 02: Android Layouts.pptxYousef Alamir
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101Michael Angelo Rivera
 
Hello android world
Hello android worldHello android world
Hello android worldeleksdev
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureVijay Rastogi
 

Ähnlich wie Android training day 2 (20)

mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
 
android layouts
android layoutsandroid layouts
android layouts
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
 
Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)
 
Android session 2
Android session 2Android session 2
Android session 2
 
Android Apps Development Basic
Android Apps Development BasicAndroid Apps Development Basic
Android Apps Development Basic
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Hierarchy viewer
Hierarchy viewerHierarchy viewer
Hierarchy viewer
 
Training Session 2 - Day 2
Training Session 2 - Day 2Training Session 2 - Day 2
Training Session 2 - Day 2
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Android
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
 
Lecture 02: Android Layouts.pptx
Lecture 02: Android Layouts.pptxLecture 02: Android Layouts.pptx
Lecture 02: Android Layouts.pptx
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 
Hello android world
Hello android worldHello android world
Hello android world
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Android App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structureAndroid App development and test environment, Understaing android app structure
Android App development and test environment, Understaing android app structure
 

Mehr von Vivek Bhusal

Training Session 2
Training Session 2 Training Session 2
Training Session 2 Vivek Bhusal
 
Stores munk presentation_aug10 (1)
Stores munk presentation_aug10 (1)Stores munk presentation_aug10 (1)
Stores munk presentation_aug10 (1)Vivek Bhusal
 
Wisevote - opendataweek @
Wisevote - opendataweek @Wisevote - opendataweek @
Wisevote - opendataweek @Vivek Bhusal
 
Android training at GDG kathmandu Startup weekend bootcamp
Android training at GDG kathmandu Startup weekend bootcampAndroid training at GDG kathmandu Startup weekend bootcamp
Android training at GDG kathmandu Startup weekend bootcampVivek Bhusal
 

Mehr von Vivek Bhusal (6)

Training Session 2
Training Session 2 Training Session 2
Training Session 2
 
Stores munk presentation_aug10 (1)
Stores munk presentation_aug10 (1)Stores munk presentation_aug10 (1)
Stores munk presentation_aug10 (1)
 
Mybudget
MybudgetMybudget
Mybudget
 
Wisevote - opendataweek @
Wisevote - opendataweek @Wisevote - opendataweek @
Wisevote - opendataweek @
 
Android training at GDG kathmandu Startup weekend bootcamp
Android training at GDG kathmandu Startup weekend bootcampAndroid training at GDG kathmandu Startup weekend bootcamp
Android training at GDG kathmandu Startup weekend bootcamp
 
My medical info
My medical infoMy medical info
My medical info
 

Kürzlich hochgeladen

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Android training day 2

  • 1. Android Apps Development – Training Day - 2
  • 2. XML ● Android's defined tags ● Used to define some of the resources: – Layouts – Strings ● Android Manifest ● Preferred way for defining UI elements: – Separation of code
  • 3. R class ● Auto-generated: DO NOT EDIT ● Contains ID of the project resources ● Use findViewById and Resources object to get access to the resources: – E.g. Button = (Button)findViewById(R.id.button); – E.g. getResources().getString(R.string.hello);
  • 4. Layout ● Eclipse has a great UI creator – Generates all the XML for you ! ● Composed of View objects ● Can be specified for portrait or landscape – Different designs for different orientation.
  • 5. Contd. ● A layout/activity is composed of Views and ViewGroups. ● View is something that is visible. ● Examples: – TextViews, Buttons, TimePicker, DatePicker
  • 6. Contd. – Button ● <Button android:id = “@+id/button” android:layout_width = “fill_parent” android:layout_height = “wrap_content” android:text = “Button”/> There are 3 ways to declaring width and height: a. fill_parent b. wrap_content c. match_parent Do not forget to define us :)
  • 7. Contd. – EditText ● <EditText android:id= “@+id/number” android:layout_width= “fill_parent” android:layout_height= “wrap_content” android:inputType= “number”/> You can change the type of inputs as necessary
  • 8. Contd. – TextView ● <TextView android:id= “@+id/result” android:layout_height= “wrap_content” android:layout_width= “fill_parent” android:visibility= “invisible”/> Visibility types: a. visible b. invisible c. gone
  • 9. Contd. ● ViewGroups are the building blocks to Views: – This is the <body> to your View – One or more View can be grouped into a ViewGroup ● Types to ViewGroups: – LinearLayout* – RelativeLayout* – FrameLayout – TableLayout – ScrollView*, etc.
  • 10. ● Each layout has something unique to it ● Each layout has a purpose !
  • 11. LinearLayout ● <LinearLayout xmlns:android="http://schemas.android.com/apk/res/an droid" android:layout_width= “match_parent” android:layout_height= “match_parent” android:orientation= “vertical”> … (TextViews, Buttons etc.) </LinearLayout> Declaring the XML namespace (done in the 1st ViewGroup) Unique for this ViewGroup a. vertical b. horizontal
  • 12. RelativeLayout ● Does not have any android:orientation. ● Affects the layouts inside it. ● Views are arranged according to references.
  • 13. Contd. ● <RelativeLayout … > <Button android:id= “@+id/btn” android:layout_alignParentTop= "true" … /> <TextView android:layout_below = “@id/btn” … /> <TextView android:layout_toRightOf = “@id/btn” …/> <TextView android:layout_toLeftOf = “@id/btn” …/> <TextView android:layout_alignParentBottom = “true” .../> </RelativeLayout> Various other positioning techniques also there: alignLeft alignBaseLine above, etc.
  • 15. Lets Unite ! <LinearLayout … > <RelativeLayout … > … </RelativeLayout> </LinearLayout> ● You can use Viewgroups within Viewgroups : LAYOUTCEPTION !
  • 16. Building a simple UI Redirect to another page with all the filled details
  • 17. What is needed for this? ● Intents – <a href= “target”>page 2</a> – Intent = Redirecting ! – But wait … – Intent is used to call into android's drivers, other applications as well. – Powerful inter/intra application message-passing framework.
  • 18. ● Modification in the Android Manifest: <activity android:name=".Classname"> <intent-filter> <action android:name="android.intent.action.NAME"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> </activity> Declares an activity (an Activity subclass) that implements part of the application's visual user interface. The types of intents that an app can respond to Adds a category name to an intent filter Adds an action to an intent filter.
  • 19. ● Confused ? Don't worry ! ● Remeber this ?
  • 20. ● In your main class: Intent i = new Intent(MainActivity.this, ClassName.class); // Instantiating the intent class i.putExtra(“name”, value); // values to be sent startActivity(i); // Starting the intent ● Another class: Intent i = getIntent(); //getting the intent object String name = i.getStringExtra(“name”); //getting value from passed intent
  • 21. Explaining it all ● Create your form – UI interface – Result interface ● Create two classes that extend the UI – FormClass? – ResultClass? ● Add your ResultClass to the Android Manifest. ● Pass data from your FormClass to ResultClass using intents.
  • 22. What is Manifest ? ● Presents essential information about: – The application to the Android system ● Information the system must have before it can run any of the application's code.
  • 24. ● Name of the Java package for the application. ● It describes the components of the application — the activities, services, broadcast receivers, and content providers. ● It determines which processes will host application components. ● It declares which permissions the application must have in order to access protected parts of the API and interact with other applications. ● It also declares the permissions that others are required to have in order to interact with the application's components. ● It lists the Instrumentation classes that provide profiling and other information as the application is running. These declarations are present in the manifest only while the application is being developed and tested; they're removed before the application is published. ● It declares the minimum level of the Android API that the application requires. ● It lists the libraries that the application must be linked against.
  • 25. “Have you ever wondered what happens when you press the back button/ home button on android?”