Mobile Apps 2010
           iPhone and Android
                     March 9, 2010

           Norman McEntire, Founder
   ...
Legal Info
●   Android is a trademark of Google Inc.
●   iPhone is a trademark of Apple Inc.
●   Servin is a trademark of ...
About Servin Corporation
●   Servin On-Site Training
    ●   “Get Your Development Team Up To Speed Fast!”
●   Servin Web-...
Servin On-Site Training
●   “Get Your Development Team Up To Speed
    Fast!”
●   iPhone Programming Courses
    –   Intro...
Servin Web-Based Training
●   “Watch Code Written Before Your Eyes!”
    –   Uses Cisco WebEx Player
    –   Cicso WebEx P...
Servin Books
●   Books available on Amazon Kindle and
    Amazon Kindle Reader (iPhone, PC,
    Blackberry)
    –   iPhone...
Servin Apps
               25+ iPhone Apps
–   Technology Professionals
     ●   Device Info Plus
           – Device ID I...
UCSD Extension Courses
●   These courses are taught by Norman McEntire
    and fill up quickly so register early
    ●   i...
Opening Remarks
●   Welcome!
●   Thank you!
●   My Promise To You
    ●   Show you Mobile App Development 2010!
        –i...
PDF Slides and WebEx Recording
Will Be Posted on http://servin.com
●   My goal is to show you, faster than any
    method ...
Demo is very focused.
            Here are the Guideposts
●   Guidepost #1
    ●   Use only the latest native SDKs downloa...
Briefly...because the question
              always comes up...
●   Question: Are there alternatives to using the
    nati...
Introducing the SDKs




 Copyright (c) 2010 Servin Corporation - http://servin.com   13
iPhone SDK 3.2 Beta 3
●   Hardware Requirements
    ●   Mac (running Mac OS 10.6 Snow Leopard)
●   Membership Requirements...
Android SDK 2.1
●   Hardware Requirements
    ●   Any Hardware running Linux, Mac, or Windows
●   Membership Requirements
...
Time for the Demos!




 Copyright (c) 2010 Servin Corporation - http://servin.com   16
Demo 1

Building the Default App




   Copyright (c) 2010 Servin Corporation - http://servin.com   17
Demo 1: iPhone SDK
Xcode: File > New Project




      Copyright (c) 2010 Servin Corporation - http://servin.com   18
Demo 1: iPhone SDK
   Xcode IDE




   Copyright (c) 2010 Servin Corporation - http://servin.com   19
Demo 1: iPhone SDK
iPhone Simulator – iPad Mode




        Copyright (c) 2010 Servin Corporation - http://servin.com   20
Demo 1: iPhone SDK
iPhone Simulator – iPhone Mode

                                User Interface Observations

          ...
Demo 1: Android SDK
Eclipse: New Android Project




        Copyright (c) 2010 Servin Corporation - http://servin.com   22
Demo 1: Android SDK
   Eclipse IDE




   Copyright (c) 2010 Servin Corporation - http://servin.com   23
Demo 1: Android SDK
  Android Emulator
                                                User Interface Observations

      ...
Demo 2

Application Startup and Logging




      Copyright (c) 2010 Servin Corporation - http://servin.com   25
Demo 2: iPhone SDK
      Logging: NSLog() - C Function
//   SDSICAppDelegate.m

...code not shown...

- (BOOL)application:...
Demo 2: iPhone SDK
Xcode: Run > Console




    Copyright (c) 2010 Servin Corporation - http://servin.com   27
Demo 2: Android SDK
        Logging: Log.v() - Java Class
                                                                ...
Demo 2: Android SDK
Eclipse: Window > Show View > Other

                                     The LogCat view shows
      ...
Demo 2: Android SDK
Eclipse: LogCat After Running




       Copyright (c) 2010 Servin Corporation - http://servin.com   30
Demo 3

        Debugging




Copyright (c) 2010 Servin Corporation - http://servin.com   31
Demo 3: iPhone SDK
 Xcode: Debugger




   Copyright (c) 2010 Servin Corporation - http://servin.com   32
Demo 3: Android SDK
Eclipse: Debug Perspective




      Copyright (c) 2010 Servin Corporation - http://servin.com   33
Demo 4

Create UITextView/TextView at Runtime

         iPhone: UITextView
          Android: TextView


          Copyrig...
Demo 4: iPhone SDK
            UITextView at Runtime
- (BOOL)application:(UIApplication *)application
    didFinishLaunchi...
Demo 4: iPhone SDK
UITextView at Runtime




    Copyright (c) 2010 Servin Corporation - http://servin.com   36
Demo 4: Android SDK
               TextView at Runtime
// Demo.java

...code not shown...

   public void onCreate(Bundle ...
Demo 4: Android SDK
TextView at Runtime




   Copyright (c) 2010 Servin Corporation - http://servin.com   38
Demo 5

Create UIButton/Button using Layout Tools




           Copyright (c) 2010 Servin Corporation - http://servin.com...
Demo 5: iPhone SDK
Interface Builder and UIButton




        Copyright (c) 2010 Servin Corporation - http://servin.com   ...
Demo 5: iPhone SDK
  Running the App




   Copyright (c) 2010 Servin Corporation - http://servin.com   41
Demo 5: Andriod SDK
Eclipse: XML Layout




   Copyright (c) 2010 Servin Corporation - http://servin.com   42
Demo 5: Android SDK
  Running the App




   Copyright (c) 2010 Servin Corporation - http://servin.com   43
Demo 6

Change Value of UIButton/Button At Runtime




            Copyright (c) 2010 Servin Corporation - http://servin.c...
Demo 6: iPhone SDK
     IBOutlet - SDSICViewController.h
//   SDSICViewController.h

#import <UIKit/UIKit.h>

@interface S...
Demo 6: iPhone SDK
            SDSICViewController.m
//   SDSICViewController.m

#import "SDSICViewController.h"

@impleme...
Demo 6: iPhone SDK
Interface Builder - Control-Click-Drag




To connect the IBOutlet:
Control-Click-Drag
FROM File's Owne...
Demo 6: iPhone SDK
     Running




   Copyright (c) 2010 Servin Corporation - http://servin.com   48
Demo 6: Android SDK
              Button As Runtime
package com.servin.android.mon2;

...code not shown...

public class D...
Demo 6: Android SDK
 Button As Runtime




   Copyright (c) 2010 Servin Corporation - http://servin.com   50
Demo 7

Handle UIButton/Button Events




      Copyright (c) 2010 Servin Corporation - http://servin.com   51
Demo 7: iPhone SDK
     IBOutlet - SDSICViewController.h
//   SDSICViewController.h

#import <UIKit/UIKit.h>

@interface S...
Demo 7: iPhone SDK
            SDSICViewController.m
//   SDSICViewController.m

...code not shown...

-(IBAction) doButto...
Demo 7: iPhone SDK
Interface Builder - Control-Click-Drag




To connect the IBAction:
Control-Click-Drag
FROM UIButton
TO...
Demo 7: iPhone SDK
     Running




   Copyright (c) 2010 Servin Corporation - http://servin.com   55
Demo 7: Android SDK
              Demo.java - 1
public class Demo extends Activity
                      implements OnClic...
Demo 7: Android SDK
             Demo.java - 2
@Override
public void onClick(View v) {
   Counter++;
    // Either method ...
Demo 7: Android SDK
 Button As Runtime




   Copyright (c) 2010 Servin Corporation - http://servin.com   58
We Are Done!

       Thank You!




Copyright (c) 2010 Servin Corporation - http://servin.com   59
Upcoming SlideShare
Loading in …5
×

Mobile Apps 2010 iPhone and Android

1,466 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,466
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
35
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mobile Apps 2010 iPhone and Android

  1. 1. Mobile Apps 2010 iPhone and Android March 9, 2010 Norman McEntire, Founder Servin Corporation - http://servin.com Technology Training for Technology ProfessionalsTM norman.mcentire@servin.com Copyright (c) 2010 Servin Corporation - http://servin.com 1
  2. 2. Legal Info ● Android is a trademark of Google Inc. ● iPhone is a trademark of Apple Inc. ● Servin is a trademark of Servin Corporation. Copyright (c) 2010 Servin Corporation - http://servin.com 2
  3. 3. About Servin Corporation ● Servin On-Site Training ● “Get Your Development Team Up To Speed Fast!” ● Servin Web-Based Training ● “Watch Code Written Before Your Eyes!” ● Servin Books ● Books available on Amazon Kindle and Amazon Kindle Reader (iPhone, PC, Blackberry) ● Servin Apps ● 25+ iPhone Apps in various categories Copyright (c) 2010 Servin Corporation - http://servin.com 3
  4. 4. Servin On-Site Training ● “Get Your Development Team Up To Speed Fast!” ● iPhone Programming Courses – Intro and Advanced ● Android Programming Courses – Intro and Advanced ● Linux Programming Courses – Embedded Linux – Device Drivers – Services/Daemons Copyright (c) 2010 Servin Corporation - http://servin.com 4
  5. 5. Servin Web-Based Training ● “Watch Code Written Before Your Eyes!” – Uses Cisco WebEx Player – Cicso WebEx Player supported on ● Linux ● Mac ● Windows ● This demo/presentation is also available as Web- Based Training – http://servin.com Copyright (c) 2010 Servin Corporation - http://servin.com 5
  6. 6. Servin Books ● Books available on Amazon Kindle and Amazon Kindle Reader (iPhone, PC, Blackberry) – iPhone Objective-C 2.0 Programming Exercises – iPhone Database Programming Exercises: SQLite – iPhone Camera Programming Exercises – iPhone External Accessory Programming Exercises – iPhone Flashlight Programming Tutorial – iPhone 3 Programming Templates Explained – Red Hat Enterprise Linux 5 Admin Skills – SUSE Linux Enterprise Server 11 Admin Skills Copyright (c) 2010 Servin Corporation - http://servin.com 6
  7. 7. Servin Apps 25+ iPhone Apps – Technology Professionals ● Device Info Plus – Device ID Info, Font Info, CPU Info, Network Info, and more! ● Accelerometer Fun – Display, record, and export accelerometer info ● Process Log – Display list of processes – Health/Fitness ● Weight Log Simple – keep log of your weight ● Sleep Log Simple – keep log of your sleep – Games and Entertainment ● Touch Fast – how fast can you touch the screen? ● Simon Says Face Up – can you do as simon says? Copyright (c) 2010 Servin Corporation - http://servin.com 7
  8. 8. UCSD Extension Courses ● These courses are taught by Norman McEntire and fill up quickly so register early ● iPhone Programming: Touch, Sound, and More! – Spring 2010 Session: April 7 – June 2 – Wednesdays, 6PM - 9PM ● Introduction to Objective-C – Spring 2010 Session: April 8 – June 3 – Thursdays, 7pm – 9:50pm ● iPhone Programming: Advanced – Summer 2010 Session: Watch Catalog for Dates/Times Copyright (c) 2010 Servin Corporation - http://servin.com 8
  9. 9. Opening Remarks ● Welcome! ● Thank you! ● My Promise To You ● Show you Mobile App Development 2010! –iPhone OS SDK 3.2 Beta 3 (includes iPad) – Android SDK 2.1 ● My style – Show a few slides – Do lots of live demos – Questions at anytime are great! Copyright (c) 2010 Servin Corporation - http://servin.com 9
  10. 10. PDF Slides and WebEx Recording Will Be Posted on http://servin.com ● My goal is to show you, faster than any method on planet earth, how to use both the iPhone SDK and the Android SDK ● The tools. The Methods. The Source Code. ● This demo is fast paced but PDF slides and WebEx recording will be posted on http://servin.com ● The PDF Slides include the source code ● The WebEx Recording can be paused/replayed Copyright (c) 2010 Servin Corporation - http://servin.com 10
  11. 11. Demo is very focused. Here are the Guideposts ● Guidepost #1 ● Use only the latest native SDKs downloaded March 2010 –iPhone OS SDK 3.2 Beta 3 (iPhone, iPod Touch, iPad) – Android SDK 2.1 ● Guidepost #2. ● Make zero changes or modifications to the native SDKs – use the defaults as they come ● Guidepost #3. ● Use no 3rd party tools or add-ons – just the SDKs Copyright (c) 2010 Servin Corporation - http://servin.com 11
  12. 12. Briefly...because the question always comes up... ● Question: Are there alternatives to using the native SDKs? ● Answer: Yes. Many alternatives, but that is not the focus of this demo/presentation. ● Some alternatives to native SDKs – great topics for other SDSIC speakers ● Rhomobile.com - “HTML + Ruby” Native Apps ● PhoneGap.com - “HTML + JavaScript” Native Apps ● MonoTouch.net - “C#” Native Apps Copyright (c) 2010 Servin Corporation - http://servin.com 12
  13. 13. Introducing the SDKs Copyright (c) 2010 Servin Corporation - http://servin.com 13
  14. 14. iPhone SDK 3.2 Beta 3 ● Hardware Requirements ● Mac (running Mac OS 10.6 Snow Leopard) ● Membership Requirements ● To download SDK – Register as Apple Developer. Free registration. ● To run on device and submit to store – Join iPhone Developer Program. Yearly fee. ● Software Requirements ● iPhone SDK. Includes everything. Copyright (c) 2010 Servin Corporation - http://servin.com 14
  15. 15. Android SDK 2.1 ● Hardware Requirements ● Any Hardware running Linux, Mac, or Windows ● Membership Requirements ● To download SDK: None ● To run on device: None ● To submit to store: Small One-Time Fee ● Software Requirements ● Java SDK + Java IDE for Eclipse + Android SDK + Android Plugin for Eclipse Copyright (c) 2010 Servin Corporation - http://servin.com 15
  16. 16. Time for the Demos! Copyright (c) 2010 Servin Corporation - http://servin.com 16
  17. 17. Demo 1 Building the Default App Copyright (c) 2010 Servin Corporation - http://servin.com 17
  18. 18. Demo 1: iPhone SDK Xcode: File > New Project Copyright (c) 2010 Servin Corporation - http://servin.com 18
  19. 19. Demo 1: iPhone SDK Xcode IDE Copyright (c) 2010 Servin Corporation - http://servin.com 19
  20. 20. Demo 1: iPhone SDK iPhone Simulator – iPad Mode Copyright (c) 2010 Servin Corporation - http://servin.com 20
  21. 21. Demo 1: iPhone SDK iPhone Simulator – iPhone Mode User Interface Observations 1. Status bar at top 2. Single Home Button at bottom Copyright (c) 2010 Servin Corporation - http://servin.com 21
  22. 22. Demo 1: Android SDK Eclipse: New Android Project Copyright (c) 2010 Servin Corporation - http://servin.com 22
  23. 23. Demo 1: Android SDK Eclipse IDE Copyright (c) 2010 Servin Corporation - http://servin.com 23
  24. 24. Demo 1: Android SDK Android Emulator User Interface Observations 1. Status bar at top 2. Title Bar 3. Multiple Buttons - Home - Menu - Return - Search - D-Pad (Directional Pad) - Others 4. Keyboard Copyright (c) 2010 Servin Corporation - http://servin.com 24
  25. 25. Demo 2 Application Startup and Logging Copyright (c) 2010 Servin Corporation - http://servin.com 25
  26. 26. Demo 2: iPhone SDK Logging: NSLog() - C Function // SDSICAppDelegate.m ...code not shown... - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Log a startup message NSLog(@"Application Startup!"); NSLog(@"application: %@", [application description]); NSLog(@"launchOptions: %@", [launchOptions description]); [window addSubview:viewController.view]; [window makeKeyAndVisible]; return YES; } Copyright (c) 2010 Servin Corporation - http://servin.com 26
  27. 27. Demo 2: iPhone SDK Xcode: Run > Console Copyright (c) 2010 Servin Corporation - http://servin.com 27
  28. 28. Demo 2: Android SDK Logging: Log.v() - Java Class This code crashes if // Demo.java savedInstanceState is NULL. That is part of ...code not shown... the demo... public class Demo extends Activity { private static final String TAG = "SDSIC"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Log a startup message Log.v(TAG,"Application Startup!"); Log.v(TAG, "savedInstanceState: " + savedInstanceState.toString()); setContentView(R.layout.main); } Copyright (c) 2010 Servin Corporation - http://servin.com 28 }
  29. 29. Demo 2: Android SDK Eclipse: Window > Show View > Other The LogCat view shows messages output from the Log class Copyright (c) 2010 Servin Corporation - http://servin.com 29
  30. 30. Demo 2: Android SDK Eclipse: LogCat After Running Copyright (c) 2010 Servin Corporation - http://servin.com 30
  31. 31. Demo 3 Debugging Copyright (c) 2010 Servin Corporation - http://servin.com 31
  32. 32. Demo 3: iPhone SDK Xcode: Debugger Copyright (c) 2010 Servin Corporation - http://servin.com 32
  33. 33. Demo 3: Android SDK Eclipse: Debug Perspective Copyright (c) 2010 Servin Corporation - http://servin.com 33
  34. 34. Demo 4 Create UITextView/TextView at Runtime iPhone: UITextView Android: TextView Copyright (c) 2010 Servin Corporation - http://servin.com 34
  35. 35. Demo 4: iPhone SDK UITextView at Runtime - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ...code not shown... CGRect frame = viewController.view.bounds; UITextView *myTextView = [[UITextView alloc] initWithFrame:frame]; myTextView.text = @"SDSIC Demon" @"This is a testnBe at your best"; myTextView.editable = NO; [viewController.view addSubview:myTextView]; [window addSubview:viewController.view]; [window makeKeyAndVisible]; return YES; Copyright (c) 2010 Servin Corporation - http://servin.com 35 }
  36. 36. Demo 4: iPhone SDK UITextView at Runtime Copyright (c) 2010 Servin Corporation - http://servin.com 36
  37. 37. Demo 4: Android SDK TextView at Runtime // Demo.java ...code not shown... public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...code not shown TextView myTextView = new TextView(this); myTextView.setText("SDIC Demon" + "This is a testnBe at your best."); this.setContentView(myTextView); } Copyright (c) 2010 Servin Corporation - http://servin.com 37
  38. 38. Demo 4: Android SDK TextView at Runtime Copyright (c) 2010 Servin Corporation - http://servin.com 38
  39. 39. Demo 5 Create UIButton/Button using Layout Tools Copyright (c) 2010 Servin Corporation - http://servin.com 39
  40. 40. Demo 5: iPhone SDK Interface Builder and UIButton Copyright (c) 2010 Servin Corporation - http://servin.com 40
  41. 41. Demo 5: iPhone SDK Running the App Copyright (c) 2010 Servin Corporation - http://servin.com 41
  42. 42. Demo 5: Andriod SDK Eclipse: XML Layout Copyright (c) 2010 Servin Corporation - http://servin.com 42
  43. 43. Demo 5: Android SDK Running the App Copyright (c) 2010 Servin Corporation - http://servin.com 43
  44. 44. Demo 6 Change Value of UIButton/Button At Runtime Copyright (c) 2010 Servin Corporation - http://servin.com 44
  45. 45. Demo 6: iPhone SDK IBOutlet - SDSICViewController.h // SDSICViewController.h #import <UIKit/UIKit.h> @interface SDSICViewController : UIViewController { IBOutlet UIButton *myButton; } Copyright (c) 2010 Servin Corporation - http://servin.com 45
  46. 46. Demo 6: iPhone SDK SDSICViewController.m // SDSICViewController.m #import "SDSICViewController.h" @implementation SDSICViewController - (void)viewDidLoad { [super viewDidLoad]; [myButton setTitle:@"0" forState:UIControlStateNormal]; } @end Copyright (c) 2010 Servin Corporation - http://servin.com 46
  47. 47. Demo 6: iPhone SDK Interface Builder - Control-Click-Drag To connect the IBOutlet: Control-Click-Drag FROM File's Owner TO the UIButton. Copyright (c) 2010 Servin Corporation - http://servin.com 47
  48. 48. Demo 6: iPhone SDK Running Copyright (c) 2010 Servin Corporation - http://servin.com 48
  49. 49. Demo 6: Android SDK Button As Runtime package com.servin.android.mon2; ...code not shown... public class Demo extends Activity { private Button myButton; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); myButton = (Button) this.findViewById(R.id.Button01); myButton.setText("0"); } Copyright (c) 2010 Servin Corporation - http://servin.com 49 }
  50. 50. Demo 6: Android SDK Button As Runtime Copyright (c) 2010 Servin Corporation - http://servin.com 50
  51. 51. Demo 7 Handle UIButton/Button Events Copyright (c) 2010 Servin Corporation - http://servin.com 51
  52. 52. Demo 7: iPhone SDK IBOutlet - SDSICViewController.h // SDSICViewController.h #import <UIKit/UIKit.h> @interface SDSICViewController : UIViewController { IBOutlet UIButton *myButton; int counter; } -(IBAction) doButton; @end Copyright (c) 2010 Servin Corporation - http://servin.com 52
  53. 53. Demo 7: iPhone SDK SDSICViewController.m // SDSICViewController.m ...code not shown... -(IBAction) doButton { counter++; NSString *s = [NSString stringWithFormat:@"%d", counter]; [myButton setTitle:s forState:UIControlStateNormal]; } Copyright (c) 2010 Servin Corporation - http://servin.com 53
  54. 54. Demo 7: iPhone SDK Interface Builder - Control-Click-Drag To connect the IBAction: Control-Click-Drag FROM UIButton TO File's Owner. Copyright (c) 2010 Servin Corporation - http://servin.com 54
  55. 55. Demo 7: iPhone SDK Running Copyright (c) 2010 Servin Corporation - http://servin.com 55
  56. 56. Demo 7: Android SDK Demo.java - 1 public class Demo extends Activity implements OnClickListener { private Button button; private int counter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); button = (Button) this.findViewById(R.id.Button01); button.setText("0"); button.setOnClickListener(this); } Copyright (c) 2010 Servin Corporation - http://servin.com 56
  57. 57. Demo 7: Android SDK Demo.java - 2 @Override public void onClick(View v) { Counter++; // Either method will work //myButton.setText(String.format("%d", counter)); myButton.setText("" + counter); } Copyright (c) 2010 Servin Corporation - http://servin.com 57
  58. 58. Demo 7: Android SDK Button As Runtime Copyright (c) 2010 Servin Corporation - http://servin.com 58
  59. 59. We Are Done! Thank You! Copyright (c) 2010 Servin Corporation - http://servin.com 59

×