1 / 72

Native iOS Application Development C ST 594 – Mobile Computing

Native iOS Application Development C ST 594 – Mobile Computing. Team Members Purva Ajit Huilgol Shruthi Sambasivan Shivani Nayar Xidong Wang Shawn Pike. Overview. Introduction to iOS History Architecture Platform Introduction to Objective-C

graham
Download Presentation

Native iOS Application Development C ST 594 – Mobile Computing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Native iOS Application DevelopmentCST 594 – Mobile Computing Team Members PurvaAjitHuilgol ShruthiSambasivan Shivani Nayar Xidong Wang Shawn Pike

  2. Overview • Introduction to iOS • History • Architecture • Platform • Introduction to Objective-C • Development environment and Application lifecycle. • HelloWorld! App • TableViews • SQLite and Code Data • Webservices • Location services and Gestures • Jailbreak

  3. Introduction to iOSThe Beginnings • Apple's Steve Jobs introduced the iPhone to the world on January 10th, 2007 • iOS actually began life with a different name: OS X • When the original iPhone launched, the OS was called "iPhone OS" and it kept that name for 4 years. • Its use is extened to iPod Touch, iPad and Apple TV.

  4. iOS 1: The iPhone is born • Windows Mobile, Palm OS, Symbian, and even BlackBerry were all established systems in 2007, with a wide and deep array of features. • Comparatively, the iPhone didn't support • 3G • multitasking • 3rd party apps, • MMS • Exchange push email and tethering, • it hid the file-system from users • editing Office documents • voice dialing, and it was • almost entirely locked down to hackers and developers.

  5. iOS 1: The iPhone is born • Few of the many innovations were revolutionary for the mobile industry. • The core iOS user interface. • Mobile Safari web browser • Google Maps • Visual voicemail • The software keyboard 

  6. iOS 1: The iPhone is born Some specific iOS updates

  7. iOS 2.0

  8. iOS 3.0

  9. iOS 3.2 : The iPad arrives • New UI paradigms for a larger screen • left-hand sidebar list • no "back" button required for most apps • pop-over list • New app designs. • dedicated row for bookmarks in Safari • Photos app  • Skeumorphism • The Notepad app

  10. iOS 4.0 : Multitasking

  11. iOS 4.0 Updates

  12. iOS 5.0: Siri & Much More… • Siri • Notification Center • iMessage • No PC required • iTunes Wi-Fi Sync • Over-the-air updates • iCloud

  13. iOS 6 : Goodbye to Google Maps • Maps • Siri enhancements • Notification Center. • Facebook integration • Passbook • Shared Photo Streams • iCloud Tabs and Reading List enhancements • FaceTime over cellular and better Apple ID integration

  14. iOS : Software Architecture

  15. The Cocoa Touch Layer • Primarily written in Objective-C • Is based on the standard Mac OS X Cocoa API • Provides the following frameworks for iPhone app development: • UI Kit Framework • Map Kit Framework • Push Notification Service • Message UI Framework • Address UI Framework • Game Kit UI Framework • iAd Framework • Event Kit UI Framework

  16. UI Kit Framework User interface creation and management Application lifecycle management Application event handling Multitasking Wireless Printing Data protection via encryption Web and text content presentation and management Connection to external displays Blue tooth Cut, copy, and paste functionality Data handling Inter-application integration Local notifications Accessibility Accelerometer, battery, proximity sensor, camera. Touch screen gesture recognition File sharing

  17. Map Kit Framework • Provides a programming interface that enables you to build map based capabilities into your own applications. • Display • scrollable maps for any location • map corresponding to the current geographical location of the device and • annotate the map in a variety of ways.

  18. Other Frameworks • Push Notification Service : Allows applications to notify users of an event. • Message UI Framework : Allows users to compose and send emails from within the application.

  19. Other Frameworks • Game Kit Framework : Provides peer-to-peer connectivity and voice communication • Address Book UI Framework : Enable user to access contact information from the iPhone address book from the application.

  20. Other Frameworks • iAd Framework: Allows developers to include banner advertising within their applications. • Event Kit UI Framework:  Allows the calendar events to be accessed and edited from within an application.

  21. Hardware Details of iPhone5 Processor: 1.3 GHz Dual Core Apple-designed ARMv7s Apple A6 and PowerVR SGX543MP3 (3-Core) GPU Memory: 1GB DRAM The A6 is said to use a 1.3 GHz custom Apple-designed ARMv7 based dual-core CPU, called Swift.

  22. Objective-C • Objective-C is an object-oriented programming language used by Apple primarily for programming Mac OS X and iOS applications. • It is a super set of C. • Objective-C source code files are contained in two types of files: .h— header files .m— implementation files

  23. Classes The @interface Section @interface NewClassName: ParentClassName { memberDeclarations; } methodDeclarations; @end Instance variables Class and instance methods

  24. The @implementation Section @implementation NewClassName methodDefinitions; @end The @class Section @class Classname; Used as forward declaration to reference another class defined in another file.

  25. Example #import <Foundation/Foundation.h> @interface Fraction: NSObject { int numerator; int denominator; } -(void) print; -(void) setNumerator: (int) n; -(void) setDenominator: (int) d; @end

  26. @implementation Fraction -(void) print { NSLog (@”%i/%i”, numerator, denominator); } -(void) setNumerator: (int) n { numerator = n; } -(void) setDenominator: (int) d { denominator = d; } @end

  27. int main (int argc, char *argv[]) { @autoreleasepool{ Fraction *myFraction; // Create an instance of a Fraction myFraction = [Fraction alloc]; myFraction = [myFraction init]; [myFraction setNumerator: 1]; [myFraction setDenominator: 3]; NSLog (@”The value of myFraction is:”); [myFraction print]; } return 0; }

  28. Synthesized Accessor Methods @interface Fraction : NSObject { int numerator; int denominator; } @property int numerator, denominator; Properties are often your instance variables.The Objective-C compiler automatically generates or synthesize the getter and setter methods using @synthesize directive as shown below. #import “Fraction.h” @implementation Fraction @synthesize numerator, denominator;

  29. Protocols A protocol declares methods that can be implemented by any class. @interface Myclass:NSObject <UIApplicationDelegate, AnotherProtocol> {……..} @end; Categories A category in Objective-C enables you to add methods to an existing class without the need to subclass it. You can also use a category to override the implementation of an existing class.

  30. Data Types

  31. Environment To write an iPhone application, you have to install Xcode and the iPhone SDK. https://developer.apple.com/xcode/

  32. First iPhone Application

  33. Application Lifecycle

  34. Responding to Interrupts

  35. Moving from Foreground to Background

  36. Moving from Background to Foreground

  37. Publishing app to the App Store

  38. Data Management -SQLite • Sqlite (http://www.sqlite.org/index.html) is an open source embedded database. The original implementation was designed by D. Richard Hipp. • In 2000 version 1.0 of SQLite was released. This initial release was based off of GDBM (GNU Database Manager). • Version 3.0 added many useful improvements. • Open source RDBMS. • Single File database • Works as library not database. • Major users of SQLite: Adobe (PS and RE), Apple(mail and Safari), Google (Desktop and Gears) etc.. • Thus, widely used in testing, analysis and embedded devices.

  39. Configuration Steps… • Add the Framework for SQLite i.e.libsqlite3.0.dylib • In xcode v4+, select project then in project settings editor select summary. Scroll down to frameworks and select add (+). • In the .h file #import “sqlite3.h” • Open connection with path and file. You can use any file format such as .db, .sqland .sqlite

  40. SQLite Disadvantages • Problem with foreign key • Single user • No procedures • No security • Problem with 64bit system….

  41. Table Views • A table view is an instance of the UITableView class in one of two basic styles, plain or grouped. • Table views have many purposes: • To let users navigate through hierarchically structured data • To present an indexed list of items • To display detail information and controls in visually distinct groupings • To present a selectable list of options

  42. Single View vs Table view bases Architecture main App Delegate main App Delegate View Controller1 View Controller3 View Controller View Controller2 MainWindow MainWindow View Controller3 Screen view View Controller Screen view View Controller1 Screen view View Controller2 Screen view

  43. Steps • Start a new project. • Open Storyboard. • Add three table view controllers (TvC1, TvC2, TvC3) • Add Navigation Controller: select TvC1, Editor -> Embed in -> Navigation Controller. • To connect, select TvC1 drag TvC1 cell to TvC2 toolbar and select push segue…. • select each table view Cell to give a Identifier in table view cell properties. • Select the segue and give the identifier name to each. • Create three obj-c classes extended from UITableViewController. Link these classes to the views on storyboard. • Add barbuttonItem to each view toolbar and link them to IBAction buttons in respective viewControllers.

  44. Segue

  45. Link the two views using Segue.. • Update methods: • numberOfSectionsInTableView • NumberOfRowsInSection • cellForRowAt

  46. Core DataA framework that supports creation of model objects that encapsulate your application data and logic in the Model-View-Controller design pattern. • Built-in management of undo and redo beyond basic text editing. • Automatic validation of property values. • Maintaining the consistency of relationships among objects • Grouping, filtering, and organizing data in memory and in the user interface • Automatic support for storing objects in external data repositories https://developer.apple.com/library/mac/#referencelibrary/GettingStarted/GettingStartedWithCoreData/

  47. Steps • Create an empty Application • * make sure “Use Core Data” is checked.

More Related