Ios Application for Sharing and Managing Contact Information
Total Page:16
File Type:pdf, Size:1020Kb
MASARYKOVA UNIVERZITA FAKULTA}w¡¢£¤¥¦§¨ INFORMATIKY !"#$%&'()+,-./012345<yA| iOS application for sharing and managing contact information BACHELOR THESIS Radomír Vinkler Brno, spring 2015 Declaration Hereby I declare, that this paper is my original authorial work, which I have worked out by my own. All sources, references and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Radomír Vinkler Advisor: RNDr. Vojtˇech Rehák,ˇ Ph.D. ii Acknowledgement I would like to thank my advisor RNDr. Vojtˇech Rehák,ˇ Ph.D., for his help, valuable advice, comments and willingness during the prepa- ration and writing of this thesis. Furthermore I would like to thank my friend Michal Kaprál for his valuable ideas and support. Finally I want to thank my family for their support during my studies. iii Abstract The aim of this work was to create a mobile application for iOS that would allow the user to share his contact information with his friends and then get the same information from them. This data would be saved in an online database. Part of this work is also a brief descrip- tion of iOS operating system, description of BaaS services and anal- ysis, design and implementation of created application. iv Keywords iOS, mobile application, Apple, BaaS, synchronization, Parse, back- end v Contents 1 Introduction ............................1 2 iOS .................................2 2.1 History of iOS ........................2 2.2 Development Tools .....................4 2.3 Development Language ..................4 2.4 Application distribution and publishing .........6 3 BAAS services ...........................8 3.1 Introduction to BaaS ....................8 3.2 Top BaaS Providers ..................... 10 3.3 Parse ............................. 13 4 Application ............................ 18 4.1 Existing solutions ...................... 18 4.2 Analysis and Design .................... 20 4.3 Implementation ....................... 22 4.4 Testing ............................ 28 5 Conclusion ............................. 30 A Application screenshots ..................... 33 vi 1 Introduction Smart devices are one of the characteristics of today’s world. In this modern world almost everyone possesses some sort of smart device, be it smart phone or a tablet. The rise of these devices goes hand in hand with the increasing importance of social networking. While social networks allows people to engage in social interactions while being online, the smartphones allow them to take their social net- works with them everywhere they go. This on the other hand has caused the creation of a number of different social networks. These networks can change very quickly, generating a need to update the information about your friend’s profiles often. It is almost impossible to keep up to date with all these changes. The aim of this work is to create an application for smartphone that would satisfy this need. The application should run on the iOS oper- ating system and the development is aimed at releasing this applica- tion for public. The application should minimize the need to update the contact information for your friends by gathering all this infor- mation from the user and allowing his friends to view this informa- tion. This way the user only needs to update his contact information once for all his friends to see this update. The online database should be implemented using some type of BaaS1 service that will eliminate the need to create and maintain my own server. This work is divided into three major parts. The second chapter discusses the iOS operating system from the point of view of ap- plication developer. The next chapter is dedicated to description of different BaaS services, the basics behind this solution and the choice of service provider for my application. The last major part describes the actual implementation of my application and explains the design choices and important parts of my application. 1. Backend-as-a-Service 1 2 iOS The aim of this chapter is to provide an overview of the iOS operating system and the ecosystem provided by Apple1. We cover the major changes that happened in the history of iOS and in the recent ver- sions. After that we move on to currently used tools in development of iOS applications and provide an overview of the language that is being used when developing these applications. The last part of this chapter is dedicated to the distribution of finished applications. 2.1 History of iOS iOS (or iPhone OS2) is a mobile operating system created by the com- pany Apple Inc. It is an operating system specifically designed for use in Apple products, such as iPhone, iPad or iPod, and is being used exclusively in these Apple devices, since Apple chose not to provide licensing to other device manufacturers. iOS was revealed early in 2007 [6] and released later that year in June. The purpose of this new operating system was to create an ex- tension to an existing operating system Mac OS X, used in personal computers, that would support the new hardware (new generation of smartphones), while allowing existing developers to write soft- ware with minimal retraining, as described in [17]. The important milestone for software developers was in March 2008, when the offi- cial SDK3 was released and developers could start creating new ap- plications for new hardware that runs iOS. 2.1.1 Versions Since the release, there have been introduced 8 major iterations of the operating system. The major versions released annually (named iOS 6.0, 7.0, ..) always come with new hardware (new version of 1. Apple Inc., a US based company 2. Name iPhone OS was replaced with iOS 4 after release [16]. 3. Software Development Kit 2 2. IOS iPhone), and usually bring major updates in design, core applica- tions and frameworks4. Minor versions (called iOS 8.0, iOS 8.1, ..) usually bring smaller upgrades, redesigns or support for newly in- troduced hardware. From the point of view of the developer, it is important to note that the new versions of iOS are able to run applications written for the former version, and that the hardware is generally supported for at least 4 years. This means that with the introduction of a new major version, the applications should be functioning properly with only small changes in code. New versions usually introduce new design patterns and functions, while still supporting the older ones. The distribution of iOS versions is very uniform, since the updates are provided free of charge to most of the existing hardware. Ac- cording to the data retrieved from official Apple website [8] 82% of devices using the AppStore, an official application from Apple used to download other software, are running iOS 8. iOS 7 takes 17% share of the distribution, and only 2% of devices use older version. This means that developers have to support only the two latest versions in most cases. Figure 2.1: iOS version distribution among devices, from [8] 4. Framework is a software structure that provides particular functionality to fa- cilitate the development. 3 2. IOS 2.2 Development Tools There are not many options in what tools you can use when devel- oping for iOS. The basic requirement that you need to fulfill is to own a computer running Mac OS 10.9.4 or later, Xcode IDE5 and iOS SDK, as in [11]. Xcode is a program that can be downloaded via Mac AppStore and is free of charge. After installing Xcode on your Mac, you will get several tools that will help you with development of your applications. I’m listing the core tools that are essential and that I used during the development of my application. The main part of Xcode is the editor, which is used when writing code, compiling, debugging and analyzing the application. It pro- vides error checking, documentation, warning messages and auto- completion, which all facilitate the coding part. The editor also has built-in interface builder, a tool that is used to create and design your application looks. Its most important feature is the display of storyboards, which provide you with an overview of all your ap- plication screens, and the flow of control between them. This brings us to iOS Simulator, which simulates the actual hardware (iPhone, iPad, ..) and provides us with means to test the functionality, and show the design of our application. The last featured tool is instru- ments, which allows us to analyze running applications and collect data about performance, memory usage or network connection. All this and more is described on the official Apple website [13]. 2.3 Development Language Application development for iOS is done using language called Objective-C. Objective-C is an extension to commonly used C pro- gramming language, allowing object-oriented programming and featuring Smalltalk-style messaging system. It was developed by Brad Cox and Tom Love [18] and is nowadays used in operating sys- tems Mac OS and iOS by Apple. Objective-C was developed as a strict superset of C language. This means that any code written in C 5. Integrated Development Environment 4 2. IOS should run without issues when compiled using Objective-C com- piler. This is a big advantage for developers, because they can use any library written for C and use it in their code. The source code files have similar structure to the one used in C. Every class has a header file with .h extension, and a matching im- plementation file with .m extension. Messaging Messaging is the feature of Objective-C that is inherited from Smalltalk. The main difference from regular C is that in Objective-C we are not calling methods, but sending messages. The difference lies in the interpretation of the code, since messages are being resolved during runtime. This provides more flexibility to the programmer, but can also introduce more errors during runtime.