SlideShare ist ein Scribd-Unternehmen logo
1 von 142
Downloaden Sie, um offline zu lesen
The Joind.in
  Android App
  A story about Android programming, API
  compatibility and the lessons learned...




#4developers - 4 april 2011
Warsaw - Poland
Who am I?
Who am I?


Joshua Thijssen (32)
Who am I?


Joshua Thijssen (32)
Senior Software Engineer @ Enrise
Who am I?


Joshua Thijssen (32)
Senior Software Engineer @ Enrise
Development in PHP, Python, Perl,
C, Java....
Who am I?


Joshua Thijssen (32)
Senior Software Engineer @ Enrise
Development in PHP, Python, Perl,
C, Java....

Blogs: http://www.adayinthelifeof.nl
       http://www.enrise.com/blog
Who am I?


Joshua Thijssen (32)
Senior Software Engineer @ Enrise
Development in PHP, Python, Perl,
C, Java....

Blogs: http://www.adayinthelifeof.nl
       http://www.enrise.com/blog

Email: joshua@enrise.com
Who am I?


Joshua Thijssen (32)
Senior Software Engineer @ Enrise
Development in PHP, Python, Perl,
C, Java....

Blogs: http://www.adayinthelifeof.nl
       http://www.enrise.com/blog

Email: joshua@enrise.com
Twitter: @jaytaph
Identi.ca: jaytaph
What is this talk about?




‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
What is this talk about?




   The story about the joind.in website.




‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
What is this talk about?




   The story about the joind.in website.
   The story about the joind.in Android app.




‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
What is this talk about?




   The story about the joind.in website.
   The story about the joind.in Android app.
   The story about mobile API connectivity.




‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
What is this talk about?




   The story about the joind.in website.
   The story about the joind.in Android app.
   The story about mobile API connectivity.
   The story about android programming.



‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
The story about joind.in




http://joind.in/inc/img/splash.jpg
The story about joind.in (1)



    Launched by Chris Cornutt
    (phpdeveloper.org) in 2008
    Adopted by Lorna Mitchell and others.
    https://github.com/joindin/joind.in
    Large in the PHP community and
    gaining ground in others as well.
The story about joind.in (2)



    A website for conference organizers and
    attendees.
    Find information and give feedback on
    conference talks (like this one).
    Helps speakers to improve their talks.
    Over 10K registered users and over 30K
    page views per month.
The story about joind.in (3)



    What events are currently happening?
    Which talks are hot (or not)?
    Should I see talk X or Y?
    feedback = improvement
    your future conference planner
The story about the joind.in android app
The story about the joind.in android app (1)
The story about the joind.in android app (1)
The story about the joind.in android app (1)




 Simple buttons
The story about the joind.in android app (1)




 Simple buttons


    Loaded in
 separate thread
The story about the joind.in android app (1)




 Simple buttons                        “viewrow” inside
                                           listadapter


    Loaded in
 separate thread
The story about the joind.in android app (1)




 Simple buttons                        “viewrow” inside
                                           listadapter


    Loaded in
 separate thread

                                       Filtering /
                                      searchbox
The story about the joind.in android app (1)
The story about the joind.in android app (2)
The story about the joind.in android app (2)
The story about the joind.in android app (2)
The story about the joind.in android app (3)
The story about the joind.in android app (3)
The story about the joind.in android app (3)
The story about the joind.in android app (4)
The story about the joind.in android app (4)
The story about the joind.in android app (4)




  Loaded from
    gravatar /
 separate thread
The story about the joind.in android app (4)




  Loaded from
    gravatar /
 separate thread
                                        Gravatar
                                      not yet loaded
The story about the joind.in android app (4)
The story about the joind.in android app (5)




    First (serious) android project
    Open source
    http://github.com/jaytaph
    Biggest concern now & then:
    using the API.
Mobile API connectivity




http://www.flickr.com/photos/stevewilhelm/2591525747/sizes/l/in/photostream/
Mobile API connectivity (1)




        CRM                     Accounting




                          ERP


‣ ISOLATED APPLICATIONS
Mobile API connectivity (1)




        CRM                            Accounting
         API                              API

                                 API
                                 ERP


‣ API’S ON TOP OF APPLICATIONS
Mobile API connectivity (1)


                                           I haz yar info!
                       Oh hai!
                                              kthnxbai
                   I can haz info?


        CRM                                                   Accounting
        API                                                         API

                                     API                             sup!
                                                             sup!
                                 ERP


‣ LET’S START CHATTING
Mobile API connectivity (2)



                     Twitter
                       API




 Facebook                      YourBlog
Mobile API connectivity (2)



                     Twitter
                       API




 Facebook                      YourBlog
Mobile API connectivity (2)



                          Twitter
                            API




   Facebook                         YourBlog



‣ USING OTHER APPLICATION’S DATA
Mobile API connectivity (2)



                      Twitter
                          API



                       Android
   Facebook                              YourBlog
                 IPhone     Blackberry




‣ ONE TO MANY
Mobile API connectivity (3)
Mobile API connectivity (4)




Is your application REALLY ready for mobile connectivity?
Mobile API connectivity (5)




     Mobile bandwidth is expensive.
     Connectivity is slow and unreliable.
     Client side processing is harder.




‣ MOBILE FACTS
Mobile API connectivity (5)




     Not giving client what they want.
     Updating your API will be harder.
     BC breaks are a no-go.




‣ MOBILE FACTS
Mobile API connectivity (6)




‣ PROBLEMS WITH THE JOIND.IN API
Mobile API connectivity (6)



      Authentication




‣ PROBLEMS WITH THE JOIND.IN API
Mobile API connectivity (6)



      Authentication
      Too much data being returned
      (>300Kb per request)




‣ PROBLEMS WITH THE JOIND.IN API
Mobile API connectivity (6)



      Authentication
      Too much data being returned
      (>300Kb per request)

      No pagination (want first 10 talks, get 200+)




‣ PROBLEMS WITH THE JOIND.IN API
Mobile API connectivity (6)



      Authentication
      Too much data being returned
      (>300Kb per request)

      No pagination (want first 10 talks, get 200+)
      Duplicate data         (tracks, talks, speaker info)




‣ PROBLEMS WITH THE JOIND.IN API
Mobile API connectivity (6)



      Authentication
      Too much data being returned
      (>300Kb per request)

      No pagination (want first 10 talks, get 200+)
      Duplicate data         (tracks, talks, speaker info)

      Occasional BC breaks


‣ PROBLEMS WITH THE JOIND.IN API
Mobile API connectivity (7)




    This will all change in the v2.0 API release.
                       (hopefully)
Writing (native) Android applications
Writing (native) Android applications (1)
Writing (native) Android applications (1)




 ✓ Native (java)
 ✗ Non-native (php4android, html5/js)
Writing (native) Android applications (2)




http://developer.android.com/guide/basics/what-is-android.html
Writing (native) Android applications (2)




 You are
  here




http://developer.android.com/guide/basics/what-is-android.html
Writing (native) Android applications (3)




                 Activities
                 Layouts
                 Intents




http://developer.android.com/guide/basics/what-is-android.html
Activities (1)




http://developer.android.com/guide/basics/what-is-android.html
Activities (1)




                 provides a screen with which a user
                 can interact.




http://developer.android.com/guide/basics/what-is-android.html
Activities (1)




                 provides a screen with which a user
                 can interact.
                 activities are “stacked”.




http://developer.android.com/guide/basics/what-is-android.html
Activities (2)




http://developer.android.com/guide/basics/what-is-android.html
Activities (2)



                 activity 1 starts




http://developer.android.com/guide/basics/what-is-android.html
Activities (2)



                 activity 1 starts
                          activity 2 starts & activity 1 pauzes




http://developer.android.com/guide/basics/what-is-android.html
Activities (2)



                 activity 1 starts
                          activity 2 starts & activity 1 pauzes
                          activity 2 stops




http://developer.android.com/guide/basics/what-is-android.html
Activities (2)



                 activity 1 starts
                          activity 2 starts & activity 1 pauzes
                          activity 2 stops
                 activity 1 resumes




http://developer.android.com/guide/basics/what-is-android.html
Activities (3)




‣ ACTIVITY LIFE CYCLE
Activities (3)




‣ ACTIVITY LIFE CYCLE
Writing (native) Android applications (3)




                 Activities
                 Layouts
                 Intents




http://developer.android.com/guide/basics/what-is-android.html
Layouts (1)
Layouts (1)




         Get stuff onto your display
Layouts (1)




         Get stuff onto your display
         Created as XML resources
Layouts (1)




         Get stuff onto your display
         Created as XML resources
         “inflated” by android (costly)
Layouts (2)


   LinearLayout     Single column or row
   TableLayout      <table></table>
   FrameLayout      <placeholder>
   RelativeLayout
Layouts (2)


   LinearLayout     Single column or row
   TableLayout      <table></table>
   FrameLayout      <placeholder>
   RelativeLayout
Layouts (3)
Layouts (4)


XML                                                            Light theme   Dark (normal) theme
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:alwaysDrawnWithCache="true">
     <TableLayout
     	 android:id="@+id/tableLayout1"
     	 android:layout_width="match_parent"
     	 android:layout_height="wrap_content"
     	 android:layout_gravity="center_vertical"
     	 android:layout_margin="10dip">
          <TableRow
          	 android:id="@+id/tableRow5"
          	 android:layout_width="wrap_content"
          	 android:layout_height="match_parent">
              <TextView
              	   android:layout_height="wrap_content"
              	   android:layout_width="wrap_content"
              	   android:textStyle="bold"
              	   android:id="@+id/TextView01"
              	   android:textSize="20dip"
              	   android:text="Username"></TextView>
          </TableRow>
....




    ∂ DEFINING ANDROID LAYOUTS
Writing (native) Android applications (3)




                 Activities
                 Layouts
                 Intents




http://developer.android.com/guide/basics/what-is-android.html
Intents (1)




http://developer.android.com/guide/basics/what-is-android.html
Intents (1)




                 “message queue” between different
                 android components.




http://developer.android.com/guide/basics/what-is-android.html
Intents (1)




                 “message queue” between different
                 android components.
                 Explicit & implicit intents




http://developer.android.com/guide/basics/what-is-android.html
Intents (2)
Intents (2)


Start a new activity (explicit):
   Intent myIntent = new Intent ();
   myIntent.setClass(class.this, com.another.class);
   myIntent.putExtra("Data", "somedata");
   startActivity(myIntent);
Intents (2)


    Start a new activity (explicit):
         Intent myIntent = new Intent ();
         myIntent.setClass(class.this, com.another.class);
         myIntent.putExtra("Data", "somedata");
         startActivity(myIntent);



    Dial a number (implicit):
	   	    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123-456789"));
	   	    startActivity(intent);
Intents (2)


    Start a new activity (explicit):
         Intent myIntent = new Intent ();
         myIntent.setClass(class.this, com.another.class);
         myIntent.putExtra("Data", "somedata");
         startActivity(myIntent);



    Dial a number (implicit):
	   	    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123-456789"));
	   	    startActivity(intent);
Intents (2)


    Start a new activity (explicit):
         Intent myIntent = new Intent ();
         myIntent.setClass(class.this, com.another.class);
         myIntent.putExtra("Data", "somedata");
         startActivity(myIntent);



    Dial a number (implicit):
	   	    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123-456789"));
	   	    startActivity(intent);
Intents (3)
Intents (3)




    Visit a website (implicit):
	   	   Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
	   	   startActivity(intent);
Intents (3)




    Visit a website (implicit):
	   	   Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
	   	   startActivity(intent);
Intents (3)




    Visit a website (implicit):
	   	   Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
	   	   startActivity(intent);
Intents (3)




        Visit a website (implicit):
	       	    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
	       	    startActivity(intent);




        Open Google Maps (implicit):
    	       Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:52.257651,21.058044?z=17"));
    	       startActivity(intent);
Intents (3)




        Visit a website (implicit):
	       	    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
	       	    startActivity(intent);




        Open Google Maps (implicit):
    	       Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:52.257651,21.058044?z=17"));
    	       startActivity(intent);
Intents (3)




        Visit a website (implicit):
	       	    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
	       	    startActivity(intent);




        Open Google Maps (implicit):
    	       Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:52.257651,21.058044?z=17"));
    	       startActivity(intent);
Nine-patch (1)
Nine-patch (1)
Nine-patch (1)




   Scalable images that automatically resizes
   according to the size of your display (view).
Nine-patch (2)




http://www.pookiescreations.com/images/lrg%209%20patch%20kit%20005.jpg
Nine-patch (2)




http://www.pookiescreations.com/images/lrg%209%20patch%20kit%20005.jpg
Nine-patch (3)




http://www.pookiescreations.com/images/lrg%209%20patch%20kit%20005.jpg
Nine-patch (4)




‣ ALMOST IMPOSSIBLE TO TELL THAT THIS IS PHOTOSHOPPED
Nine-patch (5)




        ‣ A BETTER EXAMPLE


http://developer.android.com/images/draw9patch-norm.png
Code examples




http://www.flickr.com/photos/oskay/472097903/
Code examples (1)



res/layout/main.xml
<?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">
    <Button
    	
    android:text="Clickme"
    	
    android:id="@+id/button1"
    	
    android:layout_height="wrap_content"
    	
    android:layout_width="fill_parent"></Button>
</LinearLayout>




‣ DEFINE LAYOUT
Code examples (2)


package com.fourdevelopers;

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

public class Main extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

}




‣ HELLO WORLD
Code examples (2)


package com.fourdevelopers;            Activity
import android.app.Activity;
import android.os.Bundle;

public class Main extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

}




‣ HELLO WORLD
Code examples (2)


package com.fourdevelopers;            Activity
import android.app.Activity;                        Saved state after
import android.os.Bundle;
                                                  onSaveInstanceState()
public class Main extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

}




‣ HELLO WORLD
Code examples (2)


package com.fourdevelopers;            Activity
import android.app.Activity;                        Saved state after
import android.os.Bundle;
                                                  onSaveInstanceState()
public class Main extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

}
                                          Layout XML to display


‣ HELLO WORLD
Code examples (3)

package com.fourdevelopers;

import   android.app.Activity;
import   android.os.Bundle;
import   android.view.View;
import   android.view.View.OnClickListener;
import   android.widget.Button;
import   android.widget.Toast;

public class main extends Activity implements OnClickListener {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

         Button button = (Button)findViewById(R.id.button1);
         button.setOnClickListener(this);
    }

    public void onClick(View v) {
    	   Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show();
    }

}




‣ REMEMBER: TMTOWTDI!
Code examples (3)

package com.fourdevelopers;

import   android.app.Activity;
import   android.os.Bundle;                                    Imports
import   android.view.View;
import   android.view.View.OnClickListener;
import   android.widget.Button;
import   android.widget.Toast;

public class main extends Activity implements OnClickListener {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

         Button button = (Button)findViewById(R.id.button1);
         button.setOnClickListener(this);
    }

    public void onClick(View v) {
    	   Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show();
    }

}




‣ REMEMBER: TMTOWTDI!
Code examples (3)

package com.fourdevelopers;

import   android.app.Activity;
import   android.os.Bundle;                                    Imports
import   android.view.View;
import   android.view.View.OnClickListener;
import   android.widget.Button;
import   android.widget.Toast;                                          Implement click listener
public class main extends Activity implements OnClickListener {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

         Button button = (Button)findViewById(R.id.button1);
         button.setOnClickListener(this);
    }

    public void onClick(View v) {
    	   Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show();
    }

}




‣ REMEMBER: TMTOWTDI!
Code examples (3)

package com.fourdevelopers;

import   android.app.Activity;
import   android.os.Bundle;                                    Imports
import   android.view.View;
import   android.view.View.OnClickListener;
import   android.widget.Button;
import   android.widget.Toast;                                          Implement click listener
public class main extends Activity implements OnClickListener {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);                                   Connect click listener to button
         Button button = (Button)findViewById(R.id.button1);
         button.setOnClickListener(this);
    }

    public void onClick(View v) {
    	   Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show();
    }

}




‣ REMEMBER: TMTOWTDI!
Code examples (3)

package com.fourdevelopers;

import   android.app.Activity;
import   android.os.Bundle;                                    Imports
import   android.view.View;
import   android.view.View.OnClickListener;
import   android.widget.Button;
import   android.widget.Toast;                                          Implement click listener
public class main extends Activity implements OnClickListener {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);                                   Connect click listener to button
         Button button = (Button)findViewById(R.id.button1);
         button.setOnClickListener(this);
    }
                                                                   Called when “something” is clicked
    public void onClick(View v) {
    	   Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show();
    }

}




‣ REMEMBER: TMTOWTDI!
Code examples (4)
Code examples (4)




  Simple button
Code examples (4)




  Simple button
Code examples (4)




  Simple button




         Toast
About the catches
Tips for writing Android applications (1)
Tips for writing Android applications (1)




   Don’t assume anything (Phones,
   Tablets, TV?, desktop?)
Tips for writing Android applications (1)




   Don’t assume anything (Phones,
   Tablets, TV?, desktop?)
   Don’t assume connectivity.
Tips for writing Android applications (1)




   Don’t assume anything (Phones,
   Tablets, TV?, desktop?)
   Don’t assume connectivity.
   You’re not alone. Don’t hog
   resources.
Writing (native) Android applications (2)
Writing (native) Android applications (2)



   Do your business in separate threads.
Writing (native) Android applications (2)



   Do your business in separate threads.
   Cache EVERYTHING!
Writing (native) Android applications (2)



   Do your business in separate threads.
   Cache EVERYTHING!
   show what you can, fetch more up-
   to-date info in the background.
Writing (native) Android applications (2)



   Do your business in separate threads.
   Cache EVERYTHING!
   show what you can, fetch more up-
   to-date info in the background.
   Don’t quit when something fails,
   display what you know.
Writing (native) Android applications (2)
Writing (native) Android applications (2)




   BC breaks are a no-go.
Writing (native) Android applications (2)




   BC breaks are a no-go.
   Make sure you portrait and landscape
   are working.
Writing (native) Android applications (2)




   BC breaks are a no-go.
   Make sure you portrait and landscape
   are working.
   Usability is an art   (and I’m not an artist)
Sizes and usability (1)




Pixels
instead
of
Dip’s
Sizes and usability (2)
Sizes and usability (3)




Scaled
properly                     Scaled
                             properly
Sizes and usability (4)




                             Here
Gravatar                     it’s
image                        ok
not
scaled
properly
The most useful link




       developer.android.com
And of course...




   http://joind.in/talk/view/3180
Any questions?




      ‣ QUESTIONS?


http://farm1.static.flickr.com/73/163450213_18478d3aa6_d.jpg
‣ THANK YOU FOR YOUR ATTENTION

Weitere ähnliche Inhalte

Andere mochten auch

PFZ WorkshopDay Linux - Basic
PFZ WorkshopDay Linux - BasicPFZ WorkshopDay Linux - Basic
PFZ WorkshopDay Linux - BasicJoshua Thijssen
 
15 protips for mysql users pfz
15 protips for mysql users   pfz15 protips for mysql users   pfz
15 protips for mysql users pfzJoshua Thijssen
 
Alice & bob public key cryptography 101
Alice & bob  public key cryptography 101Alice & bob  public key cryptography 101
Alice & bob public key cryptography 101Joshua Thijssen
 
Alice & bob public key cryptography 101
Alice & bob  public key cryptography 101Alice & bob  public key cryptography 101
Alice & bob public key cryptography 101Joshua Thijssen
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionJoshua Thijssen
 
Unix command-line tools
Unix command-line toolsUnix command-line tools
Unix command-line toolsEric Wilson
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duoJoshua Thijssen
 

Andere mochten auch (11)

PFZ WorkshopDay Linux - Basic
PFZ WorkshopDay Linux - BasicPFZ WorkshopDay Linux - Basic
PFZ WorkshopDay Linux - Basic
 
15 protips for mysql users pfz
15 protips for mysql users   pfz15 protips for mysql users   pfz
15 protips for mysql users pfz
 
Alice & bob public key cryptography 101
Alice & bob  public key cryptography 101Alice & bob  public key cryptography 101
Alice & bob public key cryptography 101
 
Cipher block modes
Cipher block modesCipher block modes
Cipher block modes
 
Awk programming
Awk programming Awk programming
Awk programming
 
Czzawk
CzzawkCzzawk
Czzawk
 
Alice & bob public key cryptography 101
Alice & bob  public key cryptography 101Alice & bob  public key cryptography 101
Alice & bob public key cryptography 101
 
Naive Bayes
Naive Bayes Naive Bayes
Naive Bayes
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 Edition
 
Unix command-line tools
Unix command-line toolsUnix command-line tools
Unix command-line tools
 
Sed & awk the dynamic duo
Sed & awk   the dynamic duoSed & awk   the dynamic duo
Sed & awk the dynamic duo
 

Kürzlich hochgeladen

Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 

Kürzlich hochgeladen (20)

Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 

Joind.in Application for Android

  • 1. The Joind.in Android App A story about Android programming, API compatibility and the lessons learned... #4developers - 4 april 2011 Warsaw - Poland
  • 3. Who am I? Joshua Thijssen (32)
  • 4. Who am I? Joshua Thijssen (32) Senior Software Engineer @ Enrise
  • 5. Who am I? Joshua Thijssen (32) Senior Software Engineer @ Enrise Development in PHP, Python, Perl, C, Java....
  • 6. Who am I? Joshua Thijssen (32) Senior Software Engineer @ Enrise Development in PHP, Python, Perl, C, Java.... Blogs: http://www.adayinthelifeof.nl http://www.enrise.com/blog
  • 7. Who am I? Joshua Thijssen (32) Senior Software Engineer @ Enrise Development in PHP, Python, Perl, C, Java.... Blogs: http://www.adayinthelifeof.nl http://www.enrise.com/blog Email: joshua@enrise.com
  • 8. Who am I? Joshua Thijssen (32) Senior Software Engineer @ Enrise Development in PHP, Python, Perl, C, Java.... Blogs: http://www.adayinthelifeof.nl http://www.enrise.com/blog Email: joshua@enrise.com Twitter: @jaytaph Identi.ca: jaytaph
  • 9. What is this talk about? ‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
  • 10. What is this talk about? The story about the joind.in website. ‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
  • 11. What is this talk about? The story about the joind.in website. The story about the joind.in Android app. ‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
  • 12. What is this talk about? The story about the joind.in website. The story about the joind.in Android app. The story about mobile API connectivity. ‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
  • 13. What is this talk about? The story about the joind.in website. The story about the joind.in Android app. The story about mobile API connectivity. The story about android programming. ‣ QUESTIONS? RAISE YOUR HAND OR YELL LOUD
  • 14. The story about joind.in http://joind.in/inc/img/splash.jpg
  • 15. The story about joind.in (1) Launched by Chris Cornutt (phpdeveloper.org) in 2008 Adopted by Lorna Mitchell and others. https://github.com/joindin/joind.in Large in the PHP community and gaining ground in others as well.
  • 16. The story about joind.in (2) A website for conference organizers and attendees. Find information and give feedback on conference talks (like this one). Helps speakers to improve their talks. Over 10K registered users and over 30K page views per month.
  • 17. The story about joind.in (3) What events are currently happening? Which talks are hot (or not)? Should I see talk X or Y? feedback = improvement your future conference planner
  • 18. The story about the joind.in android app
  • 19. The story about the joind.in android app (1)
  • 20. The story about the joind.in android app (1)
  • 21. The story about the joind.in android app (1) Simple buttons
  • 22. The story about the joind.in android app (1) Simple buttons Loaded in separate thread
  • 23. The story about the joind.in android app (1) Simple buttons “viewrow” inside listadapter Loaded in separate thread
  • 24. The story about the joind.in android app (1) Simple buttons “viewrow” inside listadapter Loaded in separate thread Filtering / searchbox
  • 25. The story about the joind.in android app (1)
  • 26. The story about the joind.in android app (2)
  • 27. The story about the joind.in android app (2)
  • 28. The story about the joind.in android app (2)
  • 29. The story about the joind.in android app (3)
  • 30. The story about the joind.in android app (3)
  • 31. The story about the joind.in android app (3)
  • 32. The story about the joind.in android app (4)
  • 33. The story about the joind.in android app (4)
  • 34. The story about the joind.in android app (4) Loaded from gravatar / separate thread
  • 35. The story about the joind.in android app (4) Loaded from gravatar / separate thread Gravatar not yet loaded
  • 36. The story about the joind.in android app (4)
  • 37. The story about the joind.in android app (5) First (serious) android project Open source http://github.com/jaytaph Biggest concern now & then: using the API.
  • 39. Mobile API connectivity (1) CRM Accounting ERP ‣ ISOLATED APPLICATIONS
  • 40. Mobile API connectivity (1) CRM Accounting API API API ERP ‣ API’S ON TOP OF APPLICATIONS
  • 41. Mobile API connectivity (1) I haz yar info! Oh hai! kthnxbai I can haz info? CRM Accounting API API API sup! sup! ERP ‣ LET’S START CHATTING
  • 42. Mobile API connectivity (2) Twitter API Facebook YourBlog
  • 43. Mobile API connectivity (2) Twitter API Facebook YourBlog
  • 44. Mobile API connectivity (2) Twitter API Facebook YourBlog ‣ USING OTHER APPLICATION’S DATA
  • 45. Mobile API connectivity (2) Twitter API Android Facebook YourBlog IPhone Blackberry ‣ ONE TO MANY
  • 47. Mobile API connectivity (4) Is your application REALLY ready for mobile connectivity?
  • 48. Mobile API connectivity (5) Mobile bandwidth is expensive. Connectivity is slow and unreliable. Client side processing is harder. ‣ MOBILE FACTS
  • 49. Mobile API connectivity (5) Not giving client what they want. Updating your API will be harder. BC breaks are a no-go. ‣ MOBILE FACTS
  • 50. Mobile API connectivity (6) ‣ PROBLEMS WITH THE JOIND.IN API
  • 51. Mobile API connectivity (6) Authentication ‣ PROBLEMS WITH THE JOIND.IN API
  • 52. Mobile API connectivity (6) Authentication Too much data being returned (>300Kb per request) ‣ PROBLEMS WITH THE JOIND.IN API
  • 53. Mobile API connectivity (6) Authentication Too much data being returned (>300Kb per request) No pagination (want first 10 talks, get 200+) ‣ PROBLEMS WITH THE JOIND.IN API
  • 54. Mobile API connectivity (6) Authentication Too much data being returned (>300Kb per request) No pagination (want first 10 talks, get 200+) Duplicate data (tracks, talks, speaker info) ‣ PROBLEMS WITH THE JOIND.IN API
  • 55. Mobile API connectivity (6) Authentication Too much data being returned (>300Kb per request) No pagination (want first 10 talks, get 200+) Duplicate data (tracks, talks, speaker info) Occasional BC breaks ‣ PROBLEMS WITH THE JOIND.IN API
  • 56. Mobile API connectivity (7) This will all change in the v2.0 API release. (hopefully)
  • 57. Writing (native) Android applications
  • 58. Writing (native) Android applications (1)
  • 59. Writing (native) Android applications (1) ✓ Native (java) ✗ Non-native (php4android, html5/js)
  • 60. Writing (native) Android applications (2) http://developer.android.com/guide/basics/what-is-android.html
  • 61. Writing (native) Android applications (2) You are here http://developer.android.com/guide/basics/what-is-android.html
  • 62. Writing (native) Android applications (3) Activities Layouts Intents http://developer.android.com/guide/basics/what-is-android.html
  • 64. Activities (1) provides a screen with which a user can interact. http://developer.android.com/guide/basics/what-is-android.html
  • 65. Activities (1) provides a screen with which a user can interact. activities are “stacked”. http://developer.android.com/guide/basics/what-is-android.html
  • 67. Activities (2) activity 1 starts http://developer.android.com/guide/basics/what-is-android.html
  • 68. Activities (2) activity 1 starts activity 2 starts & activity 1 pauzes http://developer.android.com/guide/basics/what-is-android.html
  • 69. Activities (2) activity 1 starts activity 2 starts & activity 1 pauzes activity 2 stops http://developer.android.com/guide/basics/what-is-android.html
  • 70. Activities (2) activity 1 starts activity 2 starts & activity 1 pauzes activity 2 stops activity 1 resumes http://developer.android.com/guide/basics/what-is-android.html
  • 73. Writing (native) Android applications (3) Activities Layouts Intents http://developer.android.com/guide/basics/what-is-android.html
  • 75. Layouts (1) Get stuff onto your display
  • 76. Layouts (1) Get stuff onto your display Created as XML resources
  • 77. Layouts (1) Get stuff onto your display Created as XML resources “inflated” by android (costly)
  • 78. Layouts (2) LinearLayout Single column or row TableLayout <table></table> FrameLayout <placeholder> RelativeLayout
  • 79. Layouts (2) LinearLayout Single column or row TableLayout <table></table> FrameLayout <placeholder> RelativeLayout
  • 81. Layouts (4) XML Light theme Dark (normal) theme <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:alwaysDrawnWithCache="true"> <TableLayout android:id="@+id/tableLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_margin="10dip"> <TableRow android:id="@+id/tableRow5" android:layout_width="wrap_content" android:layout_height="match_parent"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:textStyle="bold" android:id="@+id/TextView01" android:textSize="20dip" android:text="Username"></TextView> </TableRow> .... ∂ DEFINING ANDROID LAYOUTS
  • 82. Writing (native) Android applications (3) Activities Layouts Intents http://developer.android.com/guide/basics/what-is-android.html
  • 84. Intents (1) “message queue” between different android components. http://developer.android.com/guide/basics/what-is-android.html
  • 85. Intents (1) “message queue” between different android components. Explicit & implicit intents http://developer.android.com/guide/basics/what-is-android.html
  • 87. Intents (2) Start a new activity (explicit): Intent myIntent = new Intent (); myIntent.setClass(class.this, com.another.class); myIntent.putExtra("Data", "somedata"); startActivity(myIntent);
  • 88. Intents (2) Start a new activity (explicit): Intent myIntent = new Intent (); myIntent.setClass(class.this, com.another.class); myIntent.putExtra("Data", "somedata"); startActivity(myIntent); Dial a number (implicit): Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123-456789")); startActivity(intent);
  • 89. Intents (2) Start a new activity (explicit): Intent myIntent = new Intent (); myIntent.setClass(class.this, com.another.class); myIntent.putExtra("Data", "somedata"); startActivity(myIntent); Dial a number (implicit): Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123-456789")); startActivity(intent);
  • 90. Intents (2) Start a new activity (explicit): Intent myIntent = new Intent (); myIntent.setClass(class.this, com.another.class); myIntent.putExtra("Data", "somedata"); startActivity(myIntent); Dial a number (implicit): Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:123-456789")); startActivity(intent);
  • 92. Intents (3) Visit a website (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); startActivity(intent);
  • 93. Intents (3) Visit a website (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); startActivity(intent);
  • 94. Intents (3) Visit a website (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); startActivity(intent);
  • 95. Intents (3) Visit a website (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); startActivity(intent); Open Google Maps (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:52.257651,21.058044?z=17")); startActivity(intent);
  • 96. Intents (3) Visit a website (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); startActivity(intent); Open Google Maps (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:52.257651,21.058044?z=17")); startActivity(intent);
  • 97. Intents (3) Visit a website (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); startActivity(intent); Open Google Maps (implicit): Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:52.257651,21.058044?z=17")); startActivity(intent);
  • 100. Nine-patch (1) Scalable images that automatically resizes according to the size of your display (view).
  • 104. Nine-patch (4) ‣ ALMOST IMPOSSIBLE TO TELL THAT THIS IS PHOTOSHOPPED
  • 105. Nine-patch (5) ‣ A BETTER EXAMPLE http://developer.android.com/images/draw9patch-norm.png
  • 107. Code examples (1) res/layout/main.xml <?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"> <Button android:text="Clickme" android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="fill_parent"></Button> </LinearLayout> ‣ DEFINE LAYOUT
  • 108. Code examples (2) package com.fourdevelopers; import android.app.Activity; import android.os.Bundle; public class Main extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } ‣ HELLO WORLD
  • 109. Code examples (2) package com.fourdevelopers; Activity import android.app.Activity; import android.os.Bundle; public class Main extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } ‣ HELLO WORLD
  • 110. Code examples (2) package com.fourdevelopers; Activity import android.app.Activity; Saved state after import android.os.Bundle; onSaveInstanceState() public class Main extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } ‣ HELLO WORLD
  • 111. Code examples (2) package com.fourdevelopers; Activity import android.app.Activity; Saved state after import android.os.Bundle; onSaveInstanceState() public class Main extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } Layout XML to display ‣ HELLO WORLD
  • 112. Code examples (3) package com.fourdevelopers; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; public class main extends Activity implements OnClickListener { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button)findViewById(R.id.button1); button.setOnClickListener(this); } public void onClick(View v) { Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show(); } } ‣ REMEMBER: TMTOWTDI!
  • 113. Code examples (3) package com.fourdevelopers; import android.app.Activity; import android.os.Bundle; Imports import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; public class main extends Activity implements OnClickListener { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button)findViewById(R.id.button1); button.setOnClickListener(this); } public void onClick(View v) { Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show(); } } ‣ REMEMBER: TMTOWTDI!
  • 114. Code examples (3) package com.fourdevelopers; import android.app.Activity; import android.os.Bundle; Imports import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; Implement click listener public class main extends Activity implements OnClickListener { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button)findViewById(R.id.button1); button.setOnClickListener(this); } public void onClick(View v) { Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show(); } } ‣ REMEMBER: TMTOWTDI!
  • 115. Code examples (3) package com.fourdevelopers; import android.app.Activity; import android.os.Bundle; Imports import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; Implement click listener public class main extends Activity implements OnClickListener { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Connect click listener to button Button button = (Button)findViewById(R.id.button1); button.setOnClickListener(this); } public void onClick(View v) { Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show(); } } ‣ REMEMBER: TMTOWTDI!
  • 116. Code examples (3) package com.fourdevelopers; import android.app.Activity; import android.os.Bundle; Imports import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; Implement click listener public class main extends Activity implements OnClickListener { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Connect click listener to button Button button = (Button)findViewById(R.id.button1); button.setOnClickListener(this); } Called when “something” is clicked public void onClick(View v) { Toast.makeText(this, "Button clicked", Toast.LENGTH_SHORT).show(); } } ‣ REMEMBER: TMTOWTDI!
  • 118. Code examples (4) Simple button
  • 119. Code examples (4) Simple button
  • 120. Code examples (4) Simple button Toast
  • 122. Tips for writing Android applications (1)
  • 123. Tips for writing Android applications (1) Don’t assume anything (Phones, Tablets, TV?, desktop?)
  • 124. Tips for writing Android applications (1) Don’t assume anything (Phones, Tablets, TV?, desktop?) Don’t assume connectivity.
  • 125. Tips for writing Android applications (1) Don’t assume anything (Phones, Tablets, TV?, desktop?) Don’t assume connectivity. You’re not alone. Don’t hog resources.
  • 126. Writing (native) Android applications (2)
  • 127. Writing (native) Android applications (2) Do your business in separate threads.
  • 128. Writing (native) Android applications (2) Do your business in separate threads. Cache EVERYTHING!
  • 129. Writing (native) Android applications (2) Do your business in separate threads. Cache EVERYTHING! show what you can, fetch more up- to-date info in the background.
  • 130. Writing (native) Android applications (2) Do your business in separate threads. Cache EVERYTHING! show what you can, fetch more up- to-date info in the background. Don’t quit when something fails, display what you know.
  • 131. Writing (native) Android applications (2)
  • 132. Writing (native) Android applications (2) BC breaks are a no-go.
  • 133. Writing (native) Android applications (2) BC breaks are a no-go. Make sure you portrait and landscape are working.
  • 134. Writing (native) Android applications (2) BC breaks are a no-go. Make sure you portrait and landscape are working. Usability is an art (and I’m not an artist)
  • 135. Sizes and usability (1) Pixels instead of Dip’s
  • 137. Sizes and usability (3) Scaled properly Scaled properly
  • 138. Sizes and usability (4) Here Gravatar it’s image ok not scaled properly
  • 139. The most useful link developer.android.com
  • 140. And of course... http://joind.in/talk/view/3180
  • 141. Any questions? ‣ QUESTIONS? http://farm1.static.flickr.com/73/163450213_18478d3aa6_d.jpg
  • 142. ‣ THANK YOU FOR YOUR ATTENTION

Hinweis der Redaktion

  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
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n