SlideShare a Scribd company logo
1 of 45
Mobile Monday
     Competence Centre
                     Android
Steven Palmaers - Friedger Müffke - Joris de Sutter




                         1
Agenda


✓ Introduction - Steven (XIOS)
✓ Google I/O 2011 highlights - Friedger (OpenIntents)
✓ Android UX - Joris (Smartphonehelp.be)
✓ Android developer quickstart - Steven




                                  2
Introduction - devices




          3
Introduction - tablets




          4
Android Platform



       5
Android
✓ Android is everywhere
  ✓ Smartphones
  ✓ Tablets
  ✓ set-top boxes (Google TV)
  ✓ car entertainment systems
  ✓ development boards / embedded systems
  ✓ ...

✓ Focus: smartphones
  ✓ relatively small screen
  ✓ usually no hardware keyboard



                                    6
Android platform




       7
Android platform
✓ core applications (sms, e-mail, calender, maps, browser)
✓ Access to the application framework (applications can use each others
  functionality)
✓ Some libraries (C/C++) : SQLite, FreeType
✓ Android runtime
   ✓ Some core libraries
   ✓ Every Android applicatie has its own process, with an own instance of the Dalvik
     VM (.dex format - NO JVM !!!)
     ✓ Dalvik VM is register-based
✓ Linux Kernel for security, memory management, proces management,
  networking, drivers
   ✓ abstraction layer between hardware and software stack



                                       8
Installation
SDK - ADT plugin - Android platform




                 9
Installation SDK & plug-in
✓ Android SDK (contains some tools)
✓ installation + configuration ADT Eclipse plug-in
✓ Android SDK: http://developer.android.com/sdk/index.html
✓ Download & unzip SDK
✓ [Add the unzip location to your PATH] (if you want to work command-line)
✓ Install the ADT (Android Developer Tools) plugin for Eclipse (update site: https://dl-ssl.google.com/
  android/eclipse/)
✓ Restart Eclipse en change the Android preferences (Window / Preferences)
✓ Use the Android SDK and AVD manager to add at least one platform


✓ A physical device is not required to get started !

✓ Details: http://developer.android.com/sdk/installing.html



                                                   10
Emulator

✓   Simulates one or more Android devices
✓   Development without a device
✓   Test configurations you don't have physically
✓   Configuration: AVD, Android Virtual Device
✓   SDK &AVD manager


✓ First startup takes some time
✓ No need to close the emulator for an updates build




                                            11
Visually




           12
New Android project
✓ Let's create a new android project
✓ File > New > Project
✓ In the folder "Android" choose "Android project"
✓ We need to fill out some values:
   ✓ Project name: HelloAndroid (name Eclipse project / directory)
   ✓ Application name: Hello, Android (human readable name, shown on device)
   ✓ Package name: be.xios.helloandroid (package namespace)
       ✓ unique per device / application !
  ✓ Create Activity: HelloAndroid (name of stub class created by ADT plugin, Activity
     subclass). Base for an application
  ✓ Min SDK version (minimal API level needed)
✓ We are now ready !!!




                                                 13
14
Folder structure
✓ AndroidManifest.xml XML file; describes application and components
✓ bin/ contains the application (after compilation)
✓ libs/ third-party libraries
✓ res/ resources, images, sounds, layout files, ...
✓ src/ contains Java source code


✓ assets/ contains static files
✓ gen/ contains generated source code
✓ build.xml, *.properties
✓ proguard.cfg (code obfuscation)



                                          15
What are we going to do?
✓ We will create a "light" mobile monday android application
  ✓ events
  ✓ sessions
  ✓ locations
  ✓ speakers
  ✓ check in
  ✓ share
  ✓ ..

✓ Download the code from

   ✓http://bit.ly/izjuXT

                                          16
Intermezzo: resources
✓ Some subdirectories /res:
  ✓ res/drawable: contains images (png, jpeg, ...)
  ✓ res/layout: xml-based layout specifications
  ✓ res/menu: xml-based menu specifications
  ✓ res/raw: raw files, an audioclip, a csv file, ...
  ✓ res/values: strings, dimensions, ...
  ✓ res/xml: other general-purpose xml-files


✓ Some have a suffix, e.g. res/drawable-hdpi
  ✓ Those resources are only used when specific circumstances are valid



                                           17
Other resources
✓ Dimensions
   ✓ <resources>
        <dimen name="thin">10dip</dimen>
        <dimen name="fat">1in</dimen>
     </resources>
   ✓ @dimen/thin
  ✓ dip = density independent pixels (important - use these, not px)
✓ Colors
  ✓ 4 styles
  ✓ #RGB or #ARGB
  ✓ #RRGGBB or #AARRGGBB (A == Alpha)
   ✓ <resources><color name="yellow_orange">#FFD555</color></resources>
   ✓ @color/yellow_orange



                                            18
Other resources
✓ Arrays
  ✓ List of strings
   ✓ <resources>
        <string-array name="cities">
           <item>Eindhoven</item>
           <item>Maastricht</item>
           <item>Antwerpen</item>
           <item>Hasselt</item>
        </string>
     </resources>
   ✓ Java: Resources.getStringArray(R.array.cities);



                                    19
I18N
✓ Normally, when using only 1 language
  ✓ strings are put in /res/values/strings.xml
✓ English / Spanish
  ✓ res/values-en/strings.xml and res/values-es/strings.xml
     ✓ choice is based on device settings
✓ Better:
  ✓ default language (e.g. English)
    ✓ res/values/strings.xml
  ✓ other languages (such as Spanish)
     ✓ res/values-es/strings.xml




                                         20
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="be.mobilemonday"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="9" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Hello"
                  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>
</manifest>



                                         21
AndroidManifest.xml
✓ Android project route; source of your application
✓ What is inside yout application?
  ✓ Activities
  ✓ Services
  ✓ Which activity / activities should be in the launch menu of your device?
✓ root: <manifest> element
✓ attributes use the android namespace !
✓ a package is given, a dot (.) can be used to designate the default package
✓ unique package per application / device
✓ versionCode & versionName are used for updates
   ✓ name can be a string value, code must be an integer




                                             22
AndroidManifest.xml
✓ <application> children are an important part
✓ Inside <application> is now 1 <activity> element
   ✓ android:name designates the class used for implementing this activity
   ✓ android:label is the name of the activity
   ✓ <intent-filter> describes under which circumstances these activity is displayed
         ✓ android.intent.category.LAUNCHER
         ✓ android.intent.action.MAIN (main intent)
      ✓ an application typically consists of several activities
        ✓ splash, main screen, about, settings, ...
        ✓ all activities have to be listed in the manifest file !!!




                                                 23
Code
✓ In the package explorer, there is a src folder
✓ Underneath is a package, be.mobilemonday.helloandroid
✓ This contains HelloAndroid.java
✓ Notice that the names match with the values given when creating the project
✓ The code can be found on the next slide

✓ This class is an Activity subclass
✓ An Activity is an entity used in an application to execute actions. An application contains
   typically > 1 Activity
✓ The onCreate() method is called by the Android system when the Activity starts. It is used
  for initialisation and user interface setup
✓ Let's code !



                                                   24
Code snippet
package be.mobilemonday.helloandroid;

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);
    }
}




                                         25
Let's change the code...
✓ Lets replace some code

     TextView tv = new TextView(this);
     tv.setText("Hello, Android");
     setContentView(tv);

✓ An Android user interface consists of Views
✓ A View can be an image, a button, a label, ...
✓ In this case, we create a TextView, with the class constructor, taking a Context as parameter.
✓ A Context is a handle to the system, and enables access to database, user preferences, resources, ...
✓ Activity is a subclass of Context so this can be used to pass
✓ The text is set by calling setText()
✓ Finally, we set the TextView as being the content of the current Activity, using setContentView()




                                                        26
User Interface



      27
Button



  28
TextView



   29
EditText



   30
Style



  31
ListView



   32
User Interface

✓ An android XML-file has a simple structure, a tree of XML elements
✓ In our case: 1 TextView, with 5 attributes:
   ✓ xmlns:android (XML namespace)
   ✓ android:id (unique identifier for this element; can be used in other XML-files or in the code)
   ✓ android:layout_width (how much of the available width is used; a constant (fill_parent or
      wrap_content or a value, such as 40dp)
   ✓ android:layout_height (height)
   ✓ android:text (text of a button / TextView - hard-coded or reference to string resource)
✓ Should be placed in res/layout




                                                  33
User Interface


✓ String resources, placed in res/values:

       <?xml version="1.0" encoding="utf-8"?>
       <resources>
           <string name="hello">Hello World, HelloAndroid!</string>
           <string name="app_name">Hello, Android</string>
       </resources>




                                            34
User Interface: R klasse
✓ R.java is an auto-generated file (located in gen - generated)
                                                package be.mobilemonday.helloandroid;

✓ Example:                                          public final class R {
                                                        public static final class attr {
                                                        }
                                                        public static final class drawable {
                                                            public static final int icon=0x7f020000;
                                                        }
                                                        public static final class layout {
                                                            public static final int main=0x7f030000;
                                                        }
                                                        public static final class string {
                                                            public static final int app_name=0x7f040001;
                                                            public static final int hello=0x7f040000;
                                                        }
                                                    }


✓ Index of resources in your project
✓ Code completion in Eclipse IDE
✓ Auto-updated when adding / modifying resources
✓ NEVER EVER change this file yourself!



                                                     35
Logging

✓ Log class
  ✓ Log.v() ==> VERBOSE
  ✓ Log.d() ==> DEBUG
  ✓ Log.i() ==> INFO
  ✓ Log.w() ==> WARN
  ✓ Log.e() ==> ERROR


✓ Example: Log.w("MyFirstActivity", "connection lost...");




                                 36
Intermezzo: ADT + DDMS

✓ Android Developer Tools
✓ Plugin for Eclipse IDE

✓ Project wizards for Android project
✓ Integration with Eclipse IDE (Run, ...)
✓ Tooltips
✓ Drag & Drop UI editor




                                        37
Intermezzo: ADT + DDMS

✓ DDMS
  ✓ Perspective in Eclipse
  ✓ LogCat, simulate sms messages, location, ...
     ✓ Log.i(...)
     ✓ System.out.println("Hello") ==> LogCat ( INFO level, tag System.out)
     ✓ Application crashes ==> stack trace ends up in LogCat (runtime exceptions, ...)




                                         38
UI elements


                          Widgets en views:
✓ Layouts:
                           ✓ Date Picker / Time Picker
  ✓ Linear Layout
                           ✓ Forms (EditText, CheckBox, ...)
  ✓ Relative Layout
                           ✓ Spinner
  ✓ Table Layout
                           ✓ Auto Complete
  ✓ Tab Layout
                           ✓ Web View
  ✓ List View
                           ✓ Gallery
                           ✓ Google Map View




                           39
UI - Linear Layout

   ✓ ViewGroup to group child Views horizontally / vertically
   ✓ attributes for setting properties

<LinearLayout
      android:orientation="horizontal"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_weight="1">
      <TextView
          android:text="red"
          android:gravity="center_horizontal"
          android:background="#aa0000"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_weight="1"/>
      <TextView
          android:text="green"
          android:gravity="center_horizontal"
          android:background="#00aa00"
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:layout_weight="1"/>
</LinearLayout>
                                                40
User Interface
✓ TextView label, user can't change the value
✓ Most important attribute: text
✓ Other attributes: layout_width, textColor, ...


✓ Button
✓ click event
   ✓ OnClickListener (use setOnClickListener())
   ✓ or set the onclick attribute in layout xml (since version 1.6), such as
     android:onClick="click"
      ✓ public void click(View v) { ... }


✓ Images: ImageView (~ TextView) / ImageButton (~ Button)



                                             41
User Interface

✓ EditText: text field
✓ Attributes:
   ✓ android:autoText : spelling check
   ✓ android:capitalize
   ✓ android:digits : only digits
   ✓ android:singleLine : 1 line or multiline?


✓ Auto completion is possible with AutoCompleteTextView




                                         42
User Interface - selection

✓ Easiest to use adapter: ArrayAdapter
✓ Java array / List instance
✓ In the example at the bottom
   ✓ (1) application context (typically this)
   ✓ (2) resource ID for the view to be used (here we use a built-in format)
   ✓ (3) array / list of items
✓ toString() is called to convert each item to a TextView; so if you use this method,
  override the toString() method

 String[] items = {"this", "is","a","test"};
 new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items);



                                           43
User Interface - selection

✓ Classic listbox in Android: ListView
✓ Use setAdapter() to set the values to be shown
✓ Use setOnItemClickListener() to know when an item is selected
✓ It is also possible to use a specific Activity subclass, ListActivity


✓ ListView in Activity: setAdapter(...)
✓ ListActivity: setListAdapter(...)




                                         44
BEDROID


✓ Look for #bedroid on Twitter

✓ Next meeting: 30th June

✓ Location: TBD




                                 45

More Related Content

Viewers also liked

Top 5 Tips - Social Media for Your School
Top 5 Tips - Social Media for Your SchoolTop 5 Tips - Social Media for Your School
Top 5 Tips - Social Media for Your SchoolOur Kids Media
 
Facebook webinar 7-6-10 slideshare
Facebook webinar   7-6-10 slideshareFacebook webinar   7-6-10 slideshare
Facebook webinar 7-6-10 slideshareOur Kids Media
 
Inbound Content Marketing for Retirement Living: What, Why, How?
Inbound Content Marketing for Retirement Living: What, Why, How?Inbound Content Marketing for Retirement Living: What, Why, How?
Inbound Content Marketing for Retirement Living: What, Why, How?Our Kids Media
 
Meeting of the Minds 2010
Meeting of the Minds 2010Meeting of the Minds 2010
Meeting of the Minds 2010Our Kids Media
 
Антон Волнухин. Микроблоги и новое в социальных сетях: что в этом такого
Антон Волнухин.  Микроблоги и новое  в социальных сетях:  что в этом такогоАнтон Волнухин.  Микроблоги и новое  в социальных сетях:  что в этом такого
Антон Волнухин. Микроблоги и новое в социальных сетях: что в этом такогоДоп.Реальность
 
Recruitment Retention & Referrals | For Private Schools & Summer Camps
Recruitment Retention & Referrals | For Private Schools & Summer CampsRecruitment Retention & Referrals | For Private Schools & Summer Camps
Recruitment Retention & Referrals | For Private Schools & Summer CampsOur Kids Media
 
Максим Спиридонов. Практика развития веб-проектов: путь от идеи к сайту с мас...
Максим Спиридонов. Практика развития веб-проектов: путь от идеи к сайту с мас...Максим Спиридонов. Практика развития веб-проектов: путь от идеи к сайту с мас...
Максим Спиридонов. Практика развития веб-проектов: путь от идеи к сайту с мас...Доп.Реальность
 
Facebook Marketing for Private Schools
Facebook Marketing for Private SchoolsFacebook Marketing for Private Schools
Facebook Marketing for Private SchoolsOur Kids Media
 
Integrating openSUSE Ceph Block Device & OpenStack
Integrating openSUSE Ceph Block Device & OpenStack Integrating openSUSE Ceph Block Device & OpenStack
Integrating openSUSE Ceph Block Device & OpenStack utianayuba
 
Social media tools for marketing retirement communities
Social media tools for marketing retirement communitiesSocial media tools for marketing retirement communities
Social media tools for marketing retirement communitiesOur Kids Media
 
ComfortLife Marketing Academy: Social value of community
ComfortLife Marketing Academy: Social value of communityComfortLife Marketing Academy: Social value of community
ComfortLife Marketing Academy: Social value of communityOur Kids Media
 
Social value of community
Social value of communitySocial value of community
Social value of communityOur Kids Media
 
Retirement home marketing: shifts in the online advertising
Retirement home marketing: shifts in the online advertisingRetirement home marketing: shifts in the online advertising
Retirement home marketing: shifts in the online advertisingOur Kids Media
 
How To Get Media Coverage
How To Get Media Coverage How To Get Media Coverage
How To Get Media Coverage Our Kids Media
 
Ольга Стерник. Измерения в социальных медиа: как, что, зачем?
Ольга Стерник. Измерения в социальных медиа: как, что, зачем?Ольга Стерник. Измерения в социальных медиа: как, что, зачем?
Ольга Стерник. Измерения в социальных медиа: как, что, зачем?Доп.Реальность
 
Google Analytics : Overview & Basic Customization for Retirement Communities
Google Analytics : Overview & Basic Customization for Retirement CommunitiesGoogle Analytics : Overview & Basic Customization for Retirement Communities
Google Analytics : Overview & Basic Customization for Retirement CommunitiesOur Kids Media
 
Advertising & Marketing Trends 2014 | Marketing Retirement Communities and Se...
Advertising & Marketing Trends 2014 | Marketing Retirement Communities and Se...Advertising & Marketing Trends 2014 | Marketing Retirement Communities and Se...
Advertising & Marketing Trends 2014 | Marketing Retirement Communities and Se...Our Kids Media
 
Maximize your online listing with OurKids.net
Maximize your online listing with OurKids.netMaximize your online listing with OurKids.net
Maximize your online listing with OurKids.netOur Kids Media
 
How retirement homes can use social media to aid in marketing and communications
How retirement homes can use social media to aid in marketing and communicationsHow retirement homes can use social media to aid in marketing and communications
How retirement homes can use social media to aid in marketing and communicationsOur Kids Media
 

Viewers also liked (20)

Top 5 Tips - Social Media for Your School
Top 5 Tips - Social Media for Your SchoolTop 5 Tips - Social Media for Your School
Top 5 Tips - Social Media for Your School
 
Facebook webinar 7-6-10 slideshare
Facebook webinar   7-6-10 slideshareFacebook webinar   7-6-10 slideshare
Facebook webinar 7-6-10 slideshare
 
Inbound Content Marketing for Retirement Living: What, Why, How?
Inbound Content Marketing for Retirement Living: What, Why, How?Inbound Content Marketing for Retirement Living: What, Why, How?
Inbound Content Marketing for Retirement Living: What, Why, How?
 
Meeting of the Minds 2010
Meeting of the Minds 2010Meeting of the Minds 2010
Meeting of the Minds 2010
 
Антон Волнухин. Микроблоги и новое в социальных сетях: что в этом такого
Антон Волнухин.  Микроблоги и новое  в социальных сетях:  что в этом такогоАнтон Волнухин.  Микроблоги и новое  в социальных сетях:  что в этом такого
Антон Волнухин. Микроблоги и новое в социальных сетях: что в этом такого
 
Recruitment Retention & Referrals | For Private Schools & Summer Camps
Recruitment Retention & Referrals | For Private Schools & Summer CampsRecruitment Retention & Referrals | For Private Schools & Summer Camps
Recruitment Retention & Referrals | For Private Schools & Summer Camps
 
Максим Спиридонов. Практика развития веб-проектов: путь от идеи к сайту с мас...
Максим Спиридонов. Практика развития веб-проектов: путь от идеи к сайту с мас...Максим Спиридонов. Практика развития веб-проектов: путь от идеи к сайту с мас...
Максим Спиридонов. Практика развития веб-проектов: путь от идеи к сайту с мас...
 
Facebook Marketing for Private Schools
Facebook Marketing for Private SchoolsFacebook Marketing for Private Schools
Facebook Marketing for Private Schools
 
Integrating openSUSE Ceph Block Device & OpenStack
Integrating openSUSE Ceph Block Device & OpenStack Integrating openSUSE Ceph Block Device & OpenStack
Integrating openSUSE Ceph Block Device & OpenStack
 
Social media tools for marketing retirement communities
Social media tools for marketing retirement communitiesSocial media tools for marketing retirement communities
Social media tools for marketing retirement communities
 
ComfortLife Marketing Academy: Social value of community
ComfortLife Marketing Academy: Social value of communityComfortLife Marketing Academy: Social value of community
ComfortLife Marketing Academy: Social value of community
 
Social value of community
Social value of communitySocial value of community
Social value of community
 
Retirement home marketing: shifts in the online advertising
Retirement home marketing: shifts in the online advertisingRetirement home marketing: shifts in the online advertising
Retirement home marketing: shifts in the online advertising
 
How To Get Media Coverage
How To Get Media Coverage How To Get Media Coverage
How To Get Media Coverage
 
Ольга Стерник. Измерения в социальных медиа: как, что, зачем?
Ольга Стерник. Измерения в социальных медиа: как, что, зачем?Ольга Стерник. Измерения в социальных медиа: как, что, зачем?
Ольга Стерник. Измерения в социальных медиа: как, что, зачем?
 
Google Analytics : Overview & Basic Customization for Retirement Communities
Google Analytics : Overview & Basic Customization for Retirement CommunitiesGoogle Analytics : Overview & Basic Customization for Retirement Communities
Google Analytics : Overview & Basic Customization for Retirement Communities
 
Online advertising
Online advertisingOnline advertising
Online advertising
 
Advertising & Marketing Trends 2014 | Marketing Retirement Communities and Se...
Advertising & Marketing Trends 2014 | Marketing Retirement Communities and Se...Advertising & Marketing Trends 2014 | Marketing Retirement Communities and Se...
Advertising & Marketing Trends 2014 | Marketing Retirement Communities and Se...
 
Maximize your online listing with OurKids.net
Maximize your online listing with OurKids.netMaximize your online listing with OurKids.net
Maximize your online listing with OurKids.net
 
How retirement homes can use social media to aid in marketing and communications
How retirement homes can use social media to aid in marketing and communicationsHow retirement homes can use social media to aid in marketing and communications
How retirement homes can use social media to aid in marketing and communications
 

Similar to Android momobxl

Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_programEyad Almasri
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
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
 
android training_material ravy ramio
android training_material ravy ramioandroid training_material ravy ramio
android training_material ravy ramioslesulvy
 
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample ProjectAndroid Development Made Easy - With Sample Project
Android Development Made Easy - With Sample ProjectJoemarie Amparo
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldTarunsingh198
 
presentation on Android
presentation on Android presentation on Android
presentation on Android nipun pasnoori
 
Android studio
Android studioAndroid studio
Android studioAndri Yabu
 
Android application development
Android application developmentAndroid application development
Android application developmentslidesuren
 
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
 
Android training in mumbai
Android training in mumbaiAndroid training in mumbai
Android training in mumbaiCIBIL
 
Android Development
Android DevelopmentAndroid Development
Android Developmentmclougm4
 

Similar to Android momobxl (20)

Android Development project
Android Development projectAndroid Development project
Android Development project
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_program
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Android
AndroidAndroid
Android
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Part 2 android application development 101
Part 2 android application development 101Part 2 android application development 101
Part 2 android application development 101
 
android training_material ravy ramio
android training_material ravy ramioandroid training_material ravy ramio
android training_material ravy ramio
 
Android basics
Android basicsAndroid basics
Android basics
 
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample ProjectAndroid Development Made Easy - With Sample Project
Android Development Made Easy - With Sample Project
 
Android Technology
Android TechnologyAndroid Technology
Android Technology
 
Android Intro
Android IntroAndroid Intro
Android Intro
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello world
 
presentation on Android
presentation on Android presentation on Android
presentation on Android
 
Code to go Android
Code to go AndroidCode to go Android
Code to go Android
 
Android studio
Android studioAndroid studio
Android studio
 
Android application development
Android application developmentAndroid application development
Android application development
 
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
 
pebble - Building apps on pebble
pebble - Building apps on pebblepebble - Building apps on pebble
pebble - Building apps on pebble
 
Android training in mumbai
Android training in mumbaiAndroid training in mumbai
Android training in mumbai
 
Android Development
Android DevelopmentAndroid Development
Android Development
 

Recently uploaded

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Android momobxl

  • 1. Mobile Monday Competence Centre Android Steven Palmaers - Friedger Müffke - Joris de Sutter 1
  • 2. Agenda ✓ Introduction - Steven (XIOS) ✓ Google I/O 2011 highlights - Friedger (OpenIntents) ✓ Android UX - Joris (Smartphonehelp.be) ✓ Android developer quickstart - Steven 2
  • 6. Android ✓ Android is everywhere ✓ Smartphones ✓ Tablets ✓ set-top boxes (Google TV) ✓ car entertainment systems ✓ development boards / embedded systems ✓ ... ✓ Focus: smartphones ✓ relatively small screen ✓ usually no hardware keyboard 6
  • 8. Android platform ✓ core applications (sms, e-mail, calender, maps, browser) ✓ Access to the application framework (applications can use each others functionality) ✓ Some libraries (C/C++) : SQLite, FreeType ✓ Android runtime ✓ Some core libraries ✓ Every Android applicatie has its own process, with an own instance of the Dalvik VM (.dex format - NO JVM !!!) ✓ Dalvik VM is register-based ✓ Linux Kernel for security, memory management, proces management, networking, drivers ✓ abstraction layer between hardware and software stack 8
  • 9. Installation SDK - ADT plugin - Android platform 9
  • 10. Installation SDK & plug-in ✓ Android SDK (contains some tools) ✓ installation + configuration ADT Eclipse plug-in ✓ Android SDK: http://developer.android.com/sdk/index.html ✓ Download & unzip SDK ✓ [Add the unzip location to your PATH] (if you want to work command-line) ✓ Install the ADT (Android Developer Tools) plugin for Eclipse (update site: https://dl-ssl.google.com/ android/eclipse/) ✓ Restart Eclipse en change the Android preferences (Window / Preferences) ✓ Use the Android SDK and AVD manager to add at least one platform ✓ A physical device is not required to get started ! ✓ Details: http://developer.android.com/sdk/installing.html 10
  • 11. Emulator ✓ Simulates one or more Android devices ✓ Development without a device ✓ Test configurations you don't have physically ✓ Configuration: AVD, Android Virtual Device ✓ SDK &AVD manager ✓ First startup takes some time ✓ No need to close the emulator for an updates build 11
  • 12. Visually 12
  • 13. New Android project ✓ Let's create a new android project ✓ File > New > Project ✓ In the folder "Android" choose "Android project" ✓ We need to fill out some values: ✓ Project name: HelloAndroid (name Eclipse project / directory) ✓ Application name: Hello, Android (human readable name, shown on device) ✓ Package name: be.xios.helloandroid (package namespace) ✓ unique per device / application ! ✓ Create Activity: HelloAndroid (name of stub class created by ADT plugin, Activity subclass). Base for an application ✓ Min SDK version (minimal API level needed) ✓ We are now ready !!! 13
  • 14. 14
  • 15. Folder structure ✓ AndroidManifest.xml XML file; describes application and components ✓ bin/ contains the application (after compilation) ✓ libs/ third-party libraries ✓ res/ resources, images, sounds, layout files, ... ✓ src/ contains Java source code ✓ assets/ contains static files ✓ gen/ contains generated source code ✓ build.xml, *.properties ✓ proguard.cfg (code obfuscation) 15
  • 16. What are we going to do? ✓ We will create a "light" mobile monday android application ✓ events ✓ sessions ✓ locations ✓ speakers ✓ check in ✓ share ✓ .. ✓ Download the code from ✓http://bit.ly/izjuXT 16
  • 17. Intermezzo: resources ✓ Some subdirectories /res: ✓ res/drawable: contains images (png, jpeg, ...) ✓ res/layout: xml-based layout specifications ✓ res/menu: xml-based menu specifications ✓ res/raw: raw files, an audioclip, a csv file, ... ✓ res/values: strings, dimensions, ... ✓ res/xml: other general-purpose xml-files ✓ Some have a suffix, e.g. res/drawable-hdpi ✓ Those resources are only used when specific circumstances are valid 17
  • 18. Other resources ✓ Dimensions ✓ <resources> <dimen name="thin">10dip</dimen> <dimen name="fat">1in</dimen> </resources> ✓ @dimen/thin ✓ dip = density independent pixels (important - use these, not px) ✓ Colors ✓ 4 styles ✓ #RGB or #ARGB ✓ #RRGGBB or #AARRGGBB (A == Alpha) ✓ <resources><color name="yellow_orange">#FFD555</color></resources> ✓ @color/yellow_orange 18
  • 19. Other resources ✓ Arrays ✓ List of strings ✓ <resources> <string-array name="cities"> <item>Eindhoven</item> <item>Maastricht</item> <item>Antwerpen</item> <item>Hasselt</item> </string> </resources> ✓ Java: Resources.getStringArray(R.array.cities); 19
  • 20. I18N ✓ Normally, when using only 1 language ✓ strings are put in /res/values/strings.xml ✓ English / Spanish ✓ res/values-en/strings.xml and res/values-es/strings.xml ✓ choice is based on device settings ✓ Better: ✓ default language (e.g. English) ✓ res/values/strings.xml ✓ other languages (such as Spanish) ✓ res/values-es/strings.xml 20
  • 21. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="be.mobilemonday" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="9" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Hello" 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> </manifest> 21
  • 22. AndroidManifest.xml ✓ Android project route; source of your application ✓ What is inside yout application? ✓ Activities ✓ Services ✓ Which activity / activities should be in the launch menu of your device? ✓ root: <manifest> element ✓ attributes use the android namespace ! ✓ a package is given, a dot (.) can be used to designate the default package ✓ unique package per application / device ✓ versionCode & versionName are used for updates ✓ name can be a string value, code must be an integer 22
  • 23. AndroidManifest.xml ✓ <application> children are an important part ✓ Inside <application> is now 1 <activity> element ✓ android:name designates the class used for implementing this activity ✓ android:label is the name of the activity ✓ <intent-filter> describes under which circumstances these activity is displayed ✓ android.intent.category.LAUNCHER ✓ android.intent.action.MAIN (main intent) ✓ an application typically consists of several activities ✓ splash, main screen, about, settings, ... ✓ all activities have to be listed in the manifest file !!! 23
  • 24. Code ✓ In the package explorer, there is a src folder ✓ Underneath is a package, be.mobilemonday.helloandroid ✓ This contains HelloAndroid.java ✓ Notice that the names match with the values given when creating the project ✓ The code can be found on the next slide ✓ This class is an Activity subclass ✓ An Activity is an entity used in an application to execute actions. An application contains typically > 1 Activity ✓ The onCreate() method is called by the Android system when the Activity starts. It is used for initialisation and user interface setup ✓ Let's code ! 24
  • 25. Code snippet package be.mobilemonday.helloandroid; 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); } } 25
  • 26. Let's change the code... ✓ Lets replace some code TextView tv = new TextView(this); tv.setText("Hello, Android"); setContentView(tv); ✓ An Android user interface consists of Views ✓ A View can be an image, a button, a label, ... ✓ In this case, we create a TextView, with the class constructor, taking a Context as parameter. ✓ A Context is a handle to the system, and enables access to database, user preferences, resources, ... ✓ Activity is a subclass of Context so this can be used to pass ✓ The text is set by calling setText() ✓ Finally, we set the TextView as being the content of the current Activity, using setContentView() 26
  • 29. TextView 29
  • 30. EditText 30
  • 32. ListView 32
  • 33. User Interface ✓ An android XML-file has a simple structure, a tree of XML elements ✓ In our case: 1 TextView, with 5 attributes: ✓ xmlns:android (XML namespace) ✓ android:id (unique identifier for this element; can be used in other XML-files or in the code) ✓ android:layout_width (how much of the available width is used; a constant (fill_parent or wrap_content or a value, such as 40dp) ✓ android:layout_height (height) ✓ android:text (text of a button / TextView - hard-coded or reference to string resource) ✓ Should be placed in res/layout 33
  • 34. User Interface ✓ String resources, placed in res/values: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello World, HelloAndroid!</string> <string name="app_name">Hello, Android</string> </resources> 34
  • 35. User Interface: R klasse ✓ R.java is an auto-generated file (located in gen - generated) package be.mobilemonday.helloandroid; ✓ Example: public final class R { public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000; } } ✓ Index of resources in your project ✓ Code completion in Eclipse IDE ✓ Auto-updated when adding / modifying resources ✓ NEVER EVER change this file yourself! 35
  • 36. Logging ✓ Log class ✓ Log.v() ==> VERBOSE ✓ Log.d() ==> DEBUG ✓ Log.i() ==> INFO ✓ Log.w() ==> WARN ✓ Log.e() ==> ERROR ✓ Example: Log.w("MyFirstActivity", "connection lost..."); 36
  • 37. Intermezzo: ADT + DDMS ✓ Android Developer Tools ✓ Plugin for Eclipse IDE ✓ Project wizards for Android project ✓ Integration with Eclipse IDE (Run, ...) ✓ Tooltips ✓ Drag & Drop UI editor 37
  • 38. Intermezzo: ADT + DDMS ✓ DDMS ✓ Perspective in Eclipse ✓ LogCat, simulate sms messages, location, ... ✓ Log.i(...) ✓ System.out.println("Hello") ==> LogCat ( INFO level, tag System.out) ✓ Application crashes ==> stack trace ends up in LogCat (runtime exceptions, ...) 38
  • 39. UI elements Widgets en views: ✓ Layouts: ✓ Date Picker / Time Picker ✓ Linear Layout ✓ Forms (EditText, CheckBox, ...) ✓ Relative Layout ✓ Spinner ✓ Table Layout ✓ Auto Complete ✓ Tab Layout ✓ Web View ✓ List View ✓ Gallery ✓ Google Map View 39
  • 40. UI - Linear Layout ✓ ViewGroup to group child Views horizontally / vertically ✓ attributes for setting properties <LinearLayout       android:orientation="horizontal"       android:layout_width="fill_parent"       android:layout_height="fill_parent"       android:layout_weight="1">       <TextView           android:text="red"           android:gravity="center_horizontal"           android:background="#aa0000"           android:layout_width="wrap_content"           android:layout_height="fill_parent"           android:layout_weight="1"/>       <TextView           android:text="green"           android:gravity="center_horizontal"           android:background="#00aa00"           android:layout_width="wrap_content"           android:layout_height="fill_parent"           android:layout_weight="1"/> </LinearLayout> 40
  • 41. User Interface ✓ TextView label, user can't change the value ✓ Most important attribute: text ✓ Other attributes: layout_width, textColor, ... ✓ Button ✓ click event ✓ OnClickListener (use setOnClickListener()) ✓ or set the onclick attribute in layout xml (since version 1.6), such as android:onClick="click" ✓ public void click(View v) { ... } ✓ Images: ImageView (~ TextView) / ImageButton (~ Button) 41
  • 42. User Interface ✓ EditText: text field ✓ Attributes: ✓ android:autoText : spelling check ✓ android:capitalize ✓ android:digits : only digits ✓ android:singleLine : 1 line or multiline? ✓ Auto completion is possible with AutoCompleteTextView 42
  • 43. User Interface - selection ✓ Easiest to use adapter: ArrayAdapter ✓ Java array / List instance ✓ In the example at the bottom ✓ (1) application context (typically this) ✓ (2) resource ID for the view to be used (here we use a built-in format) ✓ (3) array / list of items ✓ toString() is called to convert each item to a TextView; so if you use this method, override the toString() method String[] items = {"this", "is","a","test"}; new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items); 43
  • 44. User Interface - selection ✓ Classic listbox in Android: ListView ✓ Use setAdapter() to set the values to be shown ✓ Use setOnItemClickListener() to know when an item is selected ✓ It is also possible to use a specific Activity subclass, ListActivity ✓ ListView in Activity: setAdapter(...) ✓ ListActivity: setListAdapter(...) 44
  • 45. BEDROID ✓ Look for #bedroid on Twitter ✓ Next meeting: 30th June ✓ Location: TBD 45

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n