SlideShare une entreprise Scribd logo
1  sur  21
Android	
  User	
  
  Interface	
  


 Marko	
  Gargenta	
  
   Marakana	
  
HELLO	
  WORLD!	
  
Create	
  New	
  Project
                                         	
  
Use the Eclipse tool to create a new
Android project.

Here are some key constructs:


Project	
          Eclipse	
  construct	
  
Target	
           minimum	
  to	
  run	
  
App	
  name	
      whatever	
  
Package	
          Java	
  package	
  
AcBvity	
          Java	
  class	
  
The	
  Manifest	
  File	
  
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.marakana"
   android:versionCode="1"
   android:versionName="1.0">
  <application android:icon="@drawable/icon"
        android:label="@string/app_name">
    <activity android:name=".HelloAndroid"
           android:label="@string/app_name">
       <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
    </activity>
  </application>
  <uses-sdk android:minSdkVersion="5" />
</manifest>
The	
  Layout	
  Resource	
  

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  >
<TextView
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="@string/hello"
  />
</LinearLayout>
The	
  Java	
  File	
  
package com.marakana;

import android.app.Activity;
import android.os.Bundle;

public class HelloAndroid extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);
  }
}
ANDROID	
  USER	
  INTERFACE	
  
Two	
  UI	
  Approaches	
  
Procedural	
                              Declara;ve	
  
You	
  write	
  Java	
  code	
            You	
  write	
  XML	
  code	
  
Similar	
  to	
  Swing	
  or	
  AWT	
     Similar	
  to	
  HTML	
  of	
  a	
  web	
  page	
  




You can mix and match both styles.
Declarative is preferred: easier and
more tools
XML-­‐Based	
  User	
  Interface	
  




Use WYSIWYG tools to build powerful XML-based UI.
Easily customize it from Java. Separate concerns.
Dips	
  and	
  Sps	
  

px	
  (pixel)	
                                 Dots	
  on	
  the	
  screen	
  
in	
  (inches)	
                                Size	
  as	
  measured	
  by	
  a	
  ruler	
  
mm	
  (millimeters)	
                           Size	
  as	
  measured	
  by	
  a	
  ruler	
  
pt	
  (points)	
                                1/72	
  of	
  an	
  inch	
  
dp	
  (density-­‐independent	
  pixel)	
        Abstract	
  unit.	
  On	
  screen	
  with	
  160dpi,	
  
                                                1dp=1px	
  
dip	
                                           synonym	
  for	
  dp	
  and	
  o^en	
  used	
  by	
  Google	
  
sp	
                                            Similar	
  to	
  dp	
  but	
  also	
  scaled	
  by	
  users	
  font	
  
                                                size	
  preference	
  
Views	
  and	
  Layouts
                          	
  

                    ViewGroup




        ViewGroup               View




 View     View      View




ViewGroups contain other Views but
are also Views themselves.
Common	
  UI	
  Components
                                	
  
Android UI includes many
common modern UI
widgets, such as Buttons,
Tabs, Progress Bars, Date
and Time Pickers, etc.
SelecBon	
  Components
                              	
  

Some UI widgets may
be linked to zillions of
pieces of data.
Examples are ListView
and Spinners
(pull-downs).
Adapters
                         	
  


                      Adapter       Data
                                   Source




To make sure they run smoothly, Android uses
Adapters to connect them to their data sources. A
typical data source is an Array or a Database.
Complex	
  Components
                            	
  
Certain high-level components are simply
available just like Views. Adding a Map or a
Video to your application is almost like adding a
Button or a piece of text.
Menus	
  and	
  Dialogs
                      	
  
Graphics	
  &	
  AnimaBon	
  
Android has rich support for 2D graphics.
You can draw & animate from XML.
You can use OpenGL for 3D graphics.
MulBmedia	
  
AudioPlayer lets you simply specify
the audio resource and play it.

VideoView is a View that you can
drop anywhere in your activity, point
to a video file and play it.

XML:
<VideoView
  android:id="@+id/video"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_gravity="center” />

Java:
player = (VideoView) findViewById(R.id.video);
player.setVideoPath("/sdcard/samplevideo.3gp");
player.start();
Google	
  Maps
                                      	
  
Google Maps is an add-on in Android.
It is not part of open-source project.

However, adding Maps is relatively
easy using MapView.


XML:
<com.google.android.maps.MapView
android:id="@+id/map"
android:clickable="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0EfLSgdSCWIN…A"
/>
Building	
  UI	
  for	
  Performance	
  




A handy Hierarchy Viewer tool helps with optimizing the UI for performance
Summary	
  
     Main difference between Java and
     Android is User Interface.

     Android has two approaches to UI:
     programmatic and declarative. Best
     practice is to use both.

     Lifecycle of an activity is very
     important for overall performance of
     your app. So, optimize your UI.



     Marko Gargenta, Marakana.com
     marko@marakana.com
     +1-415-647-7000

     Licensed under Creative Commons
     License (cc-by-nc-nd). Please Share!

Contenu connexe

Tendances

Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Amit Saxena
 
Londroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsLondroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsRichard Hyndman
 
Android Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAndroid Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAhsanul Karim
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesAhsanul Karim
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesAhsanul Karim
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
View groups containers
View groups containersView groups containers
View groups containersMani Selvaraj
 
Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities Ahsanul Karim
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfacesC.o. Nieto
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layoutKrazy Koder
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 

Tendances (20)

Android session 2
Android session 2Android session 2
Android session 2
 
Android Widget
Android WidgetAndroid Widget
Android Widget
 
Android session 3
Android session 3Android session 3
Android session 3
 
Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1Android Tutorial For Beginners Part-1
Android Tutorial For Beginners Part-1
 
Londroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsLondroid Android Home Screen Widgets
Londroid Android Home Screen Widgets
 
Android UI
Android UIAndroid UI
Android UI
 
Android session 1
Android session 1Android session 1
Android session 1
 
Android Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver TutorialAndroid Application Component: BroadcastReceiver Tutorial
Android Application Component: BroadcastReceiver Tutorial
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
Day 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through ActivitiesDay 4: Android: Getting Active through Activities
Day 4: Android: Getting Active through Activities
 
android layouts
android layoutsandroid layouts
android layouts
 
Unit2
Unit2Unit2
Unit2
 
View groups containers
View groups containersView groups containers
View groups containers
 
Android Services
Android ServicesAndroid Services
Android Services
 
Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
 
Android xml-based layouts-chapter5
Android xml-based layouts-chapter5Android xml-based layouts-chapter5
Android xml-based layouts-chapter5
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 

En vedette

Corporate Wellness - Presented by Beneplan & the House of Verona
Corporate Wellness - Presented by Beneplan & the House of VeronaCorporate Wellness - Presented by Beneplan & the House of Verona
Corporate Wellness - Presented by Beneplan & the House of VeronaYafa Sakkejha
 
Smoking Hypnosis - Say No To The Cancer Sticks
Smoking Hypnosis - Say No To The Cancer SticksSmoking Hypnosis - Say No To The Cancer Sticks
Smoking Hypnosis - Say No To The Cancer SticksBiotherapy-clinic Usa
 
Rusu 2012 clubs affil pack
Rusu 2012 clubs affil packRusu 2012 clubs affil pack
Rusu 2012 clubs affil packMohammad Hassan
 
Llengües d'origen 30 setembre 2011
Llengües d'origen 30 setembre 2011Llengües d'origen 30 setembre 2011
Llengües d'origen 30 setembre 2011Arnau Cerdà
 
Quick prototyping apps using JS - Ciklum, Vinnitsa
Quick prototyping apps using JS - Ciklum, VinnitsaQuick prototyping apps using JS - Ciklum, Vinnitsa
Quick prototyping apps using JS - Ciklum, VinnitsaYuriy Silvestrov
 
Alan Stevens - #smib10 Presentation
Alan Stevens - #smib10 Presentation Alan Stevens - #smib10 Presentation
Alan Stevens - #smib10 Presentation smibevents
 
David Parfect - #smib10 Presentation
David Parfect - #smib10 Presentation David Parfect - #smib10 Presentation
David Parfect - #smib10 Presentation smibevents
 
Android for Java Developers at OSCON 2010
Android for Java Developers at OSCON 2010Android for Java Developers at OSCON 2010
Android for Java Developers at OSCON 2010Marko Gargenta
 
24015127 Consell Social De La Llengua Catalana Llengua I Joves
24015127 Consell Social De La Llengua Catalana Llengua I Joves24015127 Consell Social De La Llengua Catalana Llengua I Joves
24015127 Consell Social De La Llengua Catalana Llengua I JovesArnau Cerdà
 
Effective Benefit Plan Administration
Effective Benefit Plan AdministrationEffective Benefit Plan Administration
Effective Benefit Plan AdministrationYafa Sakkejha
 
Reinforcement 4
Reinforcement 4Reinforcement 4
Reinforcement 4Sonia
 
Copia De Loba
Copia De LobaCopia De Loba
Copia De Lobaamezola
 
New Orleans Tag11 09 Linked In
New Orleans Tag11 09 Linked InNew Orleans Tag11 09 Linked In
New Orleans Tag11 09 Linked InLisa_PPL
 

En vedette (20)

Corporate Wellness - Presented by Beneplan & the House of Verona
Corporate Wellness - Presented by Beneplan & the House of VeronaCorporate Wellness - Presented by Beneplan & the House of Verona
Corporate Wellness - Presented by Beneplan & the House of Verona
 
Smoking Hypnosis - Say No To The Cancer Sticks
Smoking Hypnosis - Say No To The Cancer SticksSmoking Hypnosis - Say No To The Cancer Sticks
Smoking Hypnosis - Say No To The Cancer Sticks
 
Presentación earth, air, weather, pollution
Presentación earth, air, weather, pollutionPresentación earth, air, weather, pollution
Presentación earth, air, weather, pollution
 
Your Data, Your Interface
Your Data, Your InterfaceYour Data, Your Interface
Your Data, Your Interface
 
Resursele Regenerabile (2)
Resursele Regenerabile  (2)Resursele Regenerabile  (2)
Resursele Regenerabile (2)
 
Rusu 2012 clubs affil pack
Rusu 2012 clubs affil packRusu 2012 clubs affil pack
Rusu 2012 clubs affil pack
 
Llengües d'origen 30 setembre 2011
Llengües d'origen 30 setembre 2011Llengües d'origen 30 setembre 2011
Llengües d'origen 30 setembre 2011
 
Mitä mun puhelin2909
Mitä mun puhelin2909Mitä mun puhelin2909
Mitä mun puhelin2909
 
Quick prototyping apps using JS - Ciklum, Vinnitsa
Quick prototyping apps using JS - Ciklum, VinnitsaQuick prototyping apps using JS - Ciklum, Vinnitsa
Quick prototyping apps using JS - Ciklum, Vinnitsa
 
Alan Stevens - #smib10 Presentation
Alan Stevens - #smib10 Presentation Alan Stevens - #smib10 Presentation
Alan Stevens - #smib10 Presentation
 
Marketing Innovation In India
Marketing Innovation In IndiaMarketing Innovation In India
Marketing Innovation In India
 
Creative loverz (workshop)
Creative loverz (workshop)Creative loverz (workshop)
Creative loverz (workshop)
 
David Parfect - #smib10 Presentation
David Parfect - #smib10 Presentation David Parfect - #smib10 Presentation
David Parfect - #smib10 Presentation
 
Android for Java Developers at OSCON 2010
Android for Java Developers at OSCON 2010Android for Java Developers at OSCON 2010
Android for Java Developers at OSCON 2010
 
24015127 Consell Social De La Llengua Catalana Llengua I Joves
24015127 Consell Social De La Llengua Catalana Llengua I Joves24015127 Consell Social De La Llengua Catalana Llengua I Joves
24015127 Consell Social De La Llengua Catalana Llengua I Joves
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Effective Benefit Plan Administration
Effective Benefit Plan AdministrationEffective Benefit Plan Administration
Effective Benefit Plan Administration
 
Reinforcement 4
Reinforcement 4Reinforcement 4
Reinforcement 4
 
Copia De Loba
Copia De LobaCopia De Loba
Copia De Loba
 
New Orleans Tag11 09 Linked In
New Orleans Tag11 09 Linked InNew Orleans Tag11 09 Linked In
New Orleans Tag11 09 Linked In
 

Similaire à Marakana Android User Interface

Basic android development
Basic android developmentBasic android development
Basic android developmentUpanya Singh
 
Basic android development
Basic android developmentBasic android development
Basic android developmentUpanya Singh
 
Java talks. Android intoduction for develompment
Java talks. Android intoduction for develompmentJava talks. Android intoduction for develompment
Java talks. Android intoduction for develompmentAlexei Miliutin
 
Build Mobile Application In Android
Build Mobile Application In AndroidBuild Mobile Application In Android
Build Mobile Application In Androiddnnddane
 
Technology and Android.pptx
Technology and Android.pptxTechnology and Android.pptx
Technology and Android.pptxmuthulakshmi cse
 
DevFest Sul 2014 - Android 4 lazy iOS Devs
DevFest Sul 2014 - Android 4 lazy iOS DevsDevFest Sul 2014 - Android 4 lazy iOS Devs
DevFest Sul 2014 - Android 4 lazy iOS DevsJackson F. de A. Mafra
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentProf. Erwin Globio
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
Synapseindia android apps intro to android development
Synapseindia android apps  intro to android developmentSynapseindia android apps  intro to android development
Synapseindia android apps intro to android developmentSynapseindiappsdevelopment
 
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...DicodingEvent
 
Training Session 2 - Day 2
Training Session 2 - Day 2Training Session 2 - Day 2
Training Session 2 - Day 2Vivek Bhusal
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development pptsaitej15
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications developmentAlfredo Morresi
 
Mobile application development
Mobile application developmentMobile application development
Mobile application developmentumesh patil
 

Similaire à Marakana Android User Interface (20)

PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Android Deep Dive
Android Deep DiveAndroid Deep Dive
Android Deep Dive
 
Basic android development
Basic android developmentBasic android development
Basic android development
 
Basic android development
Basic android developmentBasic android development
Basic android development
 
Java talks. Android intoduction for develompment
Java talks. Android intoduction for develompmentJava talks. Android intoduction for develompment
Java talks. Android intoduction for develompment
 
Build Mobile Application In Android
Build Mobile Application In AndroidBuild Mobile Application In Android
Build Mobile Application In Android
 
Technology and Android.pptx
Technology and Android.pptxTechnology and Android.pptx
Technology and Android.pptx
 
DevFest Sul 2014 - Android 4 lazy iOS Devs
DevFest Sul 2014 - Android 4 lazy iOS DevsDevFest Sul 2014 - Android 4 lazy iOS Devs
DevFest Sul 2014 - Android 4 lazy iOS Devs
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android
AndroidAndroid
Android
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Synapseindia android apps intro to android development
Synapseindia android apps  intro to android developmentSynapseindia android apps  intro to android development
Synapseindia android apps intro to android development
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
 
Training Session 2 - Day 2
Training Session 2 - Day 2Training Session 2 - Day 2
Training Session 2 - Day 2
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications development
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 

Plus de Marko Gargenta

LTE: Building New Killer Apps
LTE: Building New Killer AppsLTE: Building New Killer Apps
LTE: Building New Killer AppsMarko Gargenta
 
Android Beyond The Phone
Android Beyond The PhoneAndroid Beyond The Phone
Android Beyond The PhoneMarko Gargenta
 
Android for Java Developers
Android for Java DevelopersAndroid for Java Developers
Android for Java DevelopersMarko Gargenta
 
Android: A 9,000-foot Overview
Android: A 9,000-foot OverviewAndroid: A 9,000-foot Overview
Android: A 9,000-foot OverviewMarko Gargenta
 
Marakana Android Internals
Marakana Android InternalsMarakana Android Internals
Marakana Android InternalsMarko Gargenta
 
Android For Managers Slides
Android For Managers SlidesAndroid For Managers Slides
Android For Managers SlidesMarko Gargenta
 
Why Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaMarko Gargenta
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardMarko Gargenta
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardMarko Gargenta
 

Plus de Marko Gargenta (13)

Open Android
Open AndroidOpen Android
Open Android
 
LTE: Building New Killer Apps
LTE: Building New Killer AppsLTE: Building New Killer Apps
LTE: Building New Killer Apps
 
Java Champion Wanted
Java Champion WantedJava Champion Wanted
Java Champion Wanted
 
Android Beyond The Phone
Android Beyond The PhoneAndroid Beyond The Phone
Android Beyond The Phone
 
Android for Java Developers
Android for Java DevelopersAndroid for Java Developers
Android for Java Developers
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Android: A 9,000-foot Overview
Android: A 9,000-foot OverviewAndroid: A 9,000-foot Overview
Android: A 9,000-foot Overview
 
Marakana Android Internals
Marakana Android InternalsMarakana Android Internals
Marakana Android Internals
 
Scrum Overview
Scrum OverviewScrum Overview
Scrum Overview
 
Android For Managers Slides
Android For Managers SlidesAndroid For Managers Slides
Android For Managers Slides
 
Why Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, MarakanaWhy Python by Marilyn Davis, Marakana
Why Python by Marilyn Davis, Marakana
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So Hard
 
Jens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So HardJens Østergaard on Why Scrum Is So Hard
Jens Østergaard on Why Scrum Is So Hard
 

Dernier

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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
 
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
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Dernier (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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...
 
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
 
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...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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 ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Marakana Android User Interface

  • 1. Android  User   Interface   Marko  Gargenta   Marakana  
  • 3. Create  New  Project   Use the Eclipse tool to create a new Android project. Here are some key constructs: Project   Eclipse  construct   Target   minimum  to  run   App  name   whatever   Package   Java  package   AcBvity   Java  class  
  • 4. The  Manifest  File   <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.marakana" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="5" /> </manifest>
  • 5. The  Layout  Resource   <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>
  • 6. The  Java  File   package com.marakana; import android.app.Activity; import android.os.Bundle; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
  • 8. Two  UI  Approaches   Procedural   Declara;ve   You  write  Java  code   You  write  XML  code   Similar  to  Swing  or  AWT   Similar  to  HTML  of  a  web  page   You can mix and match both styles. Declarative is preferred: easier and more tools
  • 9. XML-­‐Based  User  Interface   Use WYSIWYG tools to build powerful XML-based UI. Easily customize it from Java. Separate concerns.
  • 10. Dips  and  Sps   px  (pixel)   Dots  on  the  screen   in  (inches)   Size  as  measured  by  a  ruler   mm  (millimeters)   Size  as  measured  by  a  ruler   pt  (points)   1/72  of  an  inch   dp  (density-­‐independent  pixel)   Abstract  unit.  On  screen  with  160dpi,   1dp=1px   dip   synonym  for  dp  and  o^en  used  by  Google   sp   Similar  to  dp  but  also  scaled  by  users  font   size  preference  
  • 11. Views  and  Layouts   ViewGroup ViewGroup View View View View ViewGroups contain other Views but are also Views themselves.
  • 12. Common  UI  Components   Android UI includes many common modern UI widgets, such as Buttons, Tabs, Progress Bars, Date and Time Pickers, etc.
  • 13. SelecBon  Components   Some UI widgets may be linked to zillions of pieces of data. Examples are ListView and Spinners (pull-downs).
  • 14. Adapters   Adapter Data Source To make sure they run smoothly, Android uses Adapters to connect them to their data sources. A typical data source is an Array or a Database.
  • 15. Complex  Components   Certain high-level components are simply available just like Views. Adding a Map or a Video to your application is almost like adding a Button or a piece of text.
  • 17. Graphics  &  AnimaBon   Android has rich support for 2D graphics. You can draw & animate from XML. You can use OpenGL for 3D graphics.
  • 18. MulBmedia   AudioPlayer lets you simply specify the audio resource and play it. VideoView is a View that you can drop anywhere in your activity, point to a video file and play it. XML: <VideoView android:id="@+id/video" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center” /> Java: player = (VideoView) findViewById(R.id.video); player.setVideoPath("/sdcard/samplevideo.3gp"); player.start();
  • 19. Google  Maps   Google Maps is an add-on in Android. It is not part of open-source project. However, adding Maps is relatively easy using MapView. XML: <com.google.android.maps.MapView android:id="@+id/map" android:clickable="true" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="0EfLSgdSCWIN…A" />
  • 20. Building  UI  for  Performance   A handy Hierarchy Viewer tool helps with optimizing the UI for performance
  • 21. Summary   Main difference between Java and Android is User Interface. Android has two approaches to UI: programmatic and declarative. Best practice is to use both. Lifecycle of an activity is very important for overall performance of your app. So, optimize your UI. Marko Gargenta, Marakana.com marko@marakana.com +1-415-647-7000 Licensed under Creative Commons License (cc-by-nc-nd). Please Share!