SlideShare a Scribd company logo
Developing Efficient Android UI
Adapters in Android An Adapter object acts as a bridge between an View and the underlying data for that view. One side of the adapter is a data structure like a Java object storing data. the other side of the adapter, there is  view that the data structure was transformed into.   The Adapter is also responsible for making a View for each item in the data set .
 
Considering Adaptor for the List View Each List item in the List View would be calling its “ getView() ” method. This method would return a view for the List. But creating a new View for each list item would be complicated, and the UI would be slow down. Instead of creating new View for each item, Recycler save these view and passes it to the Adapter. Adapter uses these view sent by the recycler, when it has to produce any new views.
View Holders View Holders hold some data that related to an item to the view. View Holders minimizes the amount of work, while writing the same piece of code again and again. These are used while creating the views, where we have to use more than one time. (TextView)findViewById(R.Id.text); (ImageView)findViewById(R.Id.Icon); By using the View Holders, the views are saved into a class variable and can be called when needed. holder.text = (TextView)findViewById(R.id.text); holder.icon = (ImageView)findViewById(R.id.icon); convertView.setTag(holder); A tag can hold any kind of object, that can be set on the view.
 
Backgrounds Backgrounds can be any bitmap images or Colors or any resource from drawable directory. The background will completely fills the view. Scaling a bitmap at runtime would be difficult as it has to fill the complete view. Instead  pre-scale  the bitmap and then set it as background. Else use the solid colors as background to fill the view. This would increase the frame rate 50 frames per sec. (In normal we have 25 frames per sec).
Pre-scaling a bitmap Bitmap.createScaledBitmap( originalImage,  //bitmap to resize view.getwidth()  //new width view.getHeight() //new Height true); //bi-linear filterring
Drawing and Invalidating Invalidate is a method used to redraw Using invalidate method the entire screen is redrawn again. This may consume some time to return to the normal state. While invalidating two areas on the screen (say, top right and bottom left of the screen) the frame work would take the union of the area and redraws. Solution for these problems would be: invalidate(Rect)  and  invalidate(left, top, right, bottom) Frames would be increased to 50 per sec. (normally 18 frames)
Views and Layouts View is a basic building block of the user interface component. A view occupies a rectangle area on the screen and is responsible for drawing and event handling. UI containing many Views would make the application to run slower as it has to load every view accordingly. Drawing of objects on many views is a difficult task and requires more time to start an activity. This may cause  stackOverflow  Exception (as the stack size in android is 8kb). Deep hierarchies makes the UI very slow.
Compound Drawables <Linearlayout android:orientation = “horizantal” android:layout_width = “fill_parent” android:layout_height = “wrap_content” />   <TextView  android:layout_width = “wrap_content” android:layout_height = “wrap_content android:text = “@string/hello” /> <ImageView android:layout_width = “wrap_content” android:layout_height = “wrap_content” android:src = “@drawable/icon” /> </Linearlayout> The above code can be written as: <TextView android:layout_width = “wrap_content” android:layout_height = “wrap_content” android:text = “@string/hello” android:drawableLeft = “@drawable/icon” />
View Stub in android View Stub  is a dumb and lightweight view. It has no dimensions and does not participate in Layouts. View Stud is a feature that allows  runtime inflation  of views. <ViewStub   android:id=“@+id/stub”   android:inflateId=“@+id/panel_import”   android:lalyout = “@layout/progress_overlay”   android:gravity = “bottom” /> Inflating a View Stub…. findViewById(R.id.stub).setVisibility(View.VISIBLE); or View importPannel = ((ViewStub)findViewById(R.id.stub)).inflate();
Merge The <merge /> can only be the root tag in the xml file. This tag would reduces the levels of hierarchies in the xml layout file. <merge xlms:android=“”> <!– content -->  </merge>
Relative Layout Relative layout are powerful layout in android. Relative layout replaces the Linear layout as the widgets are placed in either horizontal or vertical way. Each child element is laid out in relation to other child elements. Relationships can be established so that children will start themselves where a previous child ends. Children can relate only to elements that are listed before them.
Custom Views Custom Views are very simple to use. Just need to override only two methods. onDraw(Canvas canvas)  onMeasure(int Width, int height)  We can define the dimensions of the view.
Custom Layouts Custom Layouts are used to define user defined layouts instead of using the pre-defined layouts. Using custom layout, user can define: height and width of the layout Childs residing on the layout Visibility of the children during runtime. To define custom layout, A class should extend  ViewGroup override  onMeasure  and  onLayout  methods.
Ad

More Related Content

What's hot (20)

Material Design Android
Material Design AndroidMaterial Design Android
Material Design Android
Samiullah Farooqui
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
Siva Kumar reddy Vasipally
 
Best Practices for Android UI by RapidValue Solutions
Best Practices for Android UI by RapidValue SolutionsBest Practices for Android UI by RapidValue Solutions
Best Practices for Android UI by RapidValue Solutions
RapidValue
 
Listview and Adapter
Listview and AdapterListview and Adapter
Listview and Adapter
Arif Huda
 
Android ui with xml
Android ui with xmlAndroid ui with xml
Android ui with xml
Egerton University
 
Android Widget
Android WidgetAndroid Widget
Android Widget
ELLURU Kalyan
 
Chapter 5 - Layouts
Chapter 5 - LayoutsChapter 5 - Layouts
Chapter 5 - Layouts
Sittiphol Phanvilai
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/Tips
Ken Yee
 
Android app material design from dev's perspective
Android app material design from dev's perspectiveAndroid app material design from dev's perspective
Android app material design from dev's perspective
DeSmart Agile Software House
 
Android Lollipop and Material Design
Android Lollipop and Material DesignAndroid Lollipop and Material Design
Android Lollipop and Material Design
James Montemagno
 
Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014
inovex GmbH
 
Building a simple user interface lesson2
Building a simple user interface lesson2Building a simple user interface lesson2
Building a simple user interface lesson2
Kalluri Vinay Reddy
 
Material design basics
Material design basicsMaterial design basics
Material design basics
Jorge Barroso
 
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
Deepu S Nath
 
Create an android app for database creation using.pptx
Create an android app for database creation using.pptxCreate an android app for database creation using.pptx
Create an android app for database creation using.pptx
vishal choudhary
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidget
Krazy Koder
 
Training Session 2
Training Session 2 Training Session 2
Training Session 2
Vivek Bhusal
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
Akira Hatsune
 
Android Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetAndroid Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection Widget
Prajyot Mainkar
 
Android Tutorials : Basic widgets
Android Tutorials : Basic widgetsAndroid Tutorials : Basic widgets
Android Tutorials : Basic widgets
Prajyot Mainkar
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
Siva Kumar reddy Vasipally
 
Best Practices for Android UI by RapidValue Solutions
Best Practices for Android UI by RapidValue SolutionsBest Practices for Android UI by RapidValue Solutions
Best Practices for Android UI by RapidValue Solutions
RapidValue
 
Listview and Adapter
Listview and AdapterListview and Adapter
Listview and Adapter
Arif Huda
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/Tips
Ken Yee
 
Android app material design from dev's perspective
Android app material design from dev's perspectiveAndroid app material design from dev's perspective
Android app material design from dev's perspective
DeSmart Agile Software House
 
Android Lollipop and Material Design
Android Lollipop and Material DesignAndroid Lollipop and Material Design
Android Lollipop and Material Design
James Montemagno
 
Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014Android Lollipop - Webinar vom 11.12.2014
Android Lollipop - Webinar vom 11.12.2014
inovex GmbH
 
Building a simple user interface lesson2
Building a simple user interface lesson2Building a simple user interface lesson2
Building a simple user interface lesson2
Kalluri Vinay Reddy
 
Material design basics
Material design basicsMaterial design basics
Material design basics
Jorge Barroso
 
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
Deepu S Nath
 
Create an android app for database creation using.pptx
Create an android app for database creation using.pptxCreate an android app for database creation using.pptx
Create an android app for database creation using.pptx
vishal choudhary
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidget
Krazy Koder
 
Training Session 2
Training Session 2 Training Session 2
Training Session 2
Vivek Bhusal
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
Akira Hatsune
 
Android Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection WidgetAndroid Tutorials - Powering with Selection Widget
Android Tutorials - Powering with Selection Widget
Prajyot Mainkar
 
Android Tutorials : Basic widgets
Android Tutorials : Basic widgetsAndroid Tutorials : Basic widgets
Android Tutorials : Basic widgets
Prajyot Mainkar
 

Viewers also liked (20)

Layouts in android
Layouts in androidLayouts in android
Layouts in android
Durai S
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
Krazy Koder
 
android layouts
android layoutsandroid layouts
android layouts
Deepa Rani
 
Input and Output Control
Input and Output ControlInput and Output Control
Input and Output Control
Techronology Inc.
 
Android ppt
Android ppt Android ppt
Android ppt
blogger at indiandswad
 
Make Recyclerview With Android Studio
Make Recyclerview With Android StudioMake Recyclerview With Android Studio
Make Recyclerview With Android Studio
Bayu Firmawan Paoh
 
Resume1
Resume1Resume1
Resume1
pasalasuneelkumar
 
Android networking in Hindi
Android networking in Hindi Android networking in Hindi
Android networking in Hindi
Vipin sharma
 
Learn java in hindi
Learn java in hindiLearn java in hindi
Learn java in hindi
Vipin sharma
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
Opersys inc.
 
Android Lesson 2
Android Lesson 2Android Lesson 2
Android Lesson 2
Daniela Da Cruz
 
Android ppt
Android pptAndroid ppt
Android ppt
Tarun Bamba
 
Intent in android
Intent in androidIntent in android
Intent in android
Durai S
 
Android intents
Android intentsAndroid intents
Android intents
Siva Ramakrishna kv
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast Receivers
CodeAndroid
 
Android ppt
Android pptAndroid ppt
Android ppt
Hari Krishna
 
Effective Android UI - English
Effective Android UI - EnglishEffective Android UI - English
Effective Android UI - English
Pedro Vicente Gómez Sánchez
 
Final year project presentation in android application
Final year project presentation in android applicationFinal year project presentation in android application
Final year project presentation in android application
Chirag Thaker
 
Android ppt
Android pptAndroid ppt
Android ppt
Pooja Garg
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
Benny Skogberg
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
Durai S
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
Krazy Koder
 
android layouts
android layoutsandroid layouts
android layouts
Deepa Rani
 
Make Recyclerview With Android Studio
Make Recyclerview With Android StudioMake Recyclerview With Android Studio
Make Recyclerview With Android Studio
Bayu Firmawan Paoh
 
Android networking in Hindi
Android networking in Hindi Android networking in Hindi
Android networking in Hindi
Vipin sharma
 
Learn java in hindi
Learn java in hindiLearn java in hindi
Learn java in hindi
Vipin sharma
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
Opersys inc.
 
Intent in android
Intent in androidIntent in android
Intent in android
Durai S
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast Receivers
CodeAndroid
 
Final year project presentation in android application
Final year project presentation in android applicationFinal year project presentation in android application
Final year project presentation in android application
Chirag Thaker
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
Benny Skogberg
 
Ad

Similar to Android Ui (20)

Hello Android
Hello AndroidHello Android
Hello Android
Trong Dinh
 
View groups containers
View groups containersView groups containers
View groups containers
Mani Selvaraj
 
Unit 2 part for information technology1 4.pptx
Unit 2 part for information technology1 4.pptxUnit 2 part for information technology1 4.pptx
Unit 2 part for information technology1 4.pptx
shambelworku8
 
Adapter and adapter views that are used in android
Adapter and adapter views that are used in androidAdapter and adapter views that are used in android
Adapter and adapter views that are used in android
JinalBhagat2
 
06. Android Basic Widget and Container
06. Android Basic Widget and Container06. Android Basic Widget and Container
06. Android Basic Widget and Container
Oum Saokosal
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
C.o. Nieto
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
InnovationM
 
MVVM & Data Binding Library
MVVM & Data Binding Library MVVM & Data Binding Library
MVVM & Data Binding Library
10Clouds
 
Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardAndroid | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted Neward
JAX London
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
Brenda Cook
 
Android xml-based layouts-chapter5
Android xml-based layouts-chapter5Android xml-based layouts-chapter5
Android xml-based layouts-chapter5
Dr. Ramkumar Lakshminarayanan
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid draw
info_zybotech
 
chp 4 UI component hdjdjdduudfinalt.pptx
chp 4 UI component hdjdjdduudfinalt.pptxchp 4 UI component hdjdjdduudfinalt.pptx
chp 4 UI component hdjdjdduudfinalt.pptx
Good490110
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
ImranS18
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
Fun2Do Labs
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
Diego Grancini
 
Lecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxLecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptx
GevitaChinnaiah
 
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfMobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdf
AbdullahMunir32
 
Android practice of layout in application-chapter6
Android practice of layout in application-chapter6Android practice of layout in application-chapter6
Android practice of layout in application-chapter6
Dr. Ramkumar Lakshminarayanan
 
View groups containers
View groups containersView groups containers
View groups containers
Mani Selvaraj
 
Unit 2 part for information technology1 4.pptx
Unit 2 part for information technology1 4.pptxUnit 2 part for information technology1 4.pptx
Unit 2 part for information technology1 4.pptx
shambelworku8
 
Adapter and adapter views that are used in android
Adapter and adapter views that are used in androidAdapter and adapter views that are used in android
Adapter and adapter views that are used in android
JinalBhagat2
 
06. Android Basic Widget and Container
06. Android Basic Widget and Container06. Android Basic Widget and Container
06. Android Basic Widget and Container
Oum Saokosal
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
C.o. Nieto
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
InnovationM
 
MVVM & Data Binding Library
MVVM & Data Binding Library MVVM & Data Binding Library
MVVM & Data Binding Library
10Clouds
 
Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardAndroid | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted Neward
JAX London
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
Brenda Cook
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid draw
info_zybotech
 
chp 4 UI component hdjdjdduudfinalt.pptx
chp 4 UI component hdjdjdduudfinalt.pptxchp 4 UI component hdjdjdduudfinalt.pptx
chp 4 UI component hdjdjdduudfinalt.pptx
Good490110
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
ImranS18
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
Fun2Do Labs
 
Android App Development - 04 Views and layouts
Android App Development - 04 Views and layoutsAndroid App Development - 04 Views and layouts
Android App Development - 04 Views and layouts
Diego Grancini
 
Lecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptxLecture 2 Styling and Layout in React Native.pptx
Lecture 2 Styling and Layout in React Native.pptx
GevitaChinnaiah
 
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfMobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdf
AbdullahMunir32
 
Ad

Recently uploaded (20)

#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 

Android Ui

  • 2. Adapters in Android An Adapter object acts as a bridge between an View and the underlying data for that view. One side of the adapter is a data structure like a Java object storing data. the other side of the adapter, there is view that the data structure was transformed into. The Adapter is also responsible for making a View for each item in the data set .
  • 3.  
  • 4. Considering Adaptor for the List View Each List item in the List View would be calling its “ getView() ” method. This method would return a view for the List. But creating a new View for each list item would be complicated, and the UI would be slow down. Instead of creating new View for each item, Recycler save these view and passes it to the Adapter. Adapter uses these view sent by the recycler, when it has to produce any new views.
  • 5. View Holders View Holders hold some data that related to an item to the view. View Holders minimizes the amount of work, while writing the same piece of code again and again. These are used while creating the views, where we have to use more than one time. (TextView)findViewById(R.Id.text); (ImageView)findViewById(R.Id.Icon); By using the View Holders, the views are saved into a class variable and can be called when needed. holder.text = (TextView)findViewById(R.id.text); holder.icon = (ImageView)findViewById(R.id.icon); convertView.setTag(holder); A tag can hold any kind of object, that can be set on the view.
  • 6.  
  • 7. Backgrounds Backgrounds can be any bitmap images or Colors or any resource from drawable directory. The background will completely fills the view. Scaling a bitmap at runtime would be difficult as it has to fill the complete view. Instead pre-scale the bitmap and then set it as background. Else use the solid colors as background to fill the view. This would increase the frame rate 50 frames per sec. (In normal we have 25 frames per sec).
  • 8. Pre-scaling a bitmap Bitmap.createScaledBitmap( originalImage, //bitmap to resize view.getwidth() //new width view.getHeight() //new Height true); //bi-linear filterring
  • 9. Drawing and Invalidating Invalidate is a method used to redraw Using invalidate method the entire screen is redrawn again. This may consume some time to return to the normal state. While invalidating two areas on the screen (say, top right and bottom left of the screen) the frame work would take the union of the area and redraws. Solution for these problems would be: invalidate(Rect) and invalidate(left, top, right, bottom) Frames would be increased to 50 per sec. (normally 18 frames)
  • 10. Views and Layouts View is a basic building block of the user interface component. A view occupies a rectangle area on the screen and is responsible for drawing and event handling. UI containing many Views would make the application to run slower as it has to load every view accordingly. Drawing of objects on many views is a difficult task and requires more time to start an activity. This may cause stackOverflow Exception (as the stack size in android is 8kb). Deep hierarchies makes the UI very slow.
  • 11. Compound Drawables <Linearlayout android:orientation = “horizantal” android:layout_width = “fill_parent” android:layout_height = “wrap_content” /> <TextView android:layout_width = “wrap_content” android:layout_height = “wrap_content android:text = “@string/hello” /> <ImageView android:layout_width = “wrap_content” android:layout_height = “wrap_content” android:src = “@drawable/icon” /> </Linearlayout> The above code can be written as: <TextView android:layout_width = “wrap_content” android:layout_height = “wrap_content” android:text = “@string/hello” android:drawableLeft = “@drawable/icon” />
  • 12. View Stub in android View Stub is a dumb and lightweight view. It has no dimensions and does not participate in Layouts. View Stud is a feature that allows runtime inflation of views. <ViewStub android:id=“@+id/stub” android:inflateId=“@+id/panel_import” android:lalyout = “@layout/progress_overlay” android:gravity = “bottom” /> Inflating a View Stub…. findViewById(R.id.stub).setVisibility(View.VISIBLE); or View importPannel = ((ViewStub)findViewById(R.id.stub)).inflate();
  • 13. Merge The <merge /> can only be the root tag in the xml file. This tag would reduces the levels of hierarchies in the xml layout file. <merge xlms:android=“”> <!– content --> </merge>
  • 14. Relative Layout Relative layout are powerful layout in android. Relative layout replaces the Linear layout as the widgets are placed in either horizontal or vertical way. Each child element is laid out in relation to other child elements. Relationships can be established so that children will start themselves where a previous child ends. Children can relate only to elements that are listed before them.
  • 15. Custom Views Custom Views are very simple to use. Just need to override only two methods. onDraw(Canvas canvas) onMeasure(int Width, int height) We can define the dimensions of the view.
  • 16. Custom Layouts Custom Layouts are used to define user defined layouts instead of using the pre-defined layouts. Using custom layout, user can define: height and width of the layout Childs residing on the layout Visibility of the children during runtime. To define custom layout, A class should extend ViewGroup override onMeasure and onLayout methods.