A STUDY OF MODERN MOBILE TABLETS

By

Jordan Kahtava

A thesis submitted in partial fulfillment of the requirements for the degree

Bachelor of Computer Science

Algoma University

Gerry Davies, Thesis Advisor

April 14th, 2016 A Study of Modern Mobile Tablets - 1

Abstract

Mobile tablets have begun playing a larger role in mobile computing because of their portability.

To gather an understanding of what mobile computers can currently accomplish Microsoft and

Apple tablets were examined. In general this topic is very broad and hard to research because of the number of mobile devices and tablets. Examining this document should provide detailed insight into mobile tablets and their hardware, operating systems, and programming environment. Any developer can use the information to develop, publish, and setup the appropriate development environments for either Apple or Microsoft. The Incremental waterfall methodology was used to develop two applications that utilize the Accelerometer, Gyroscope, and Inclinometer/Attitude sensors. In addition extensive research was conducted and combined to outline how applications can be published and the rules associated with each application store.

The Apple application used Xcode and Objective-C while the Microsoft application used Visual

Studio 2012, C-Sharp, and XAML. It was determined that developing for Apple is significantly easier because of the extensive documentation and examples available. In addition Apple’s IDE

Xcode can be used to develop, design, test, and publish applications without the need for other programs. It is hard to find easily understandable documentation from Microsoft regarding a particular operating system. Visual Studio 2012 or later must be used to develop Microsoft Store applications. Visual Studios can be used to develop, design, and publish applications, however to test against a Surface tablet a developer must install certificates and side load the application. All of the research gathered can be used by any developer wishing to target iOS and Microsoft Store applications. In conclusion, all the information gathered can be used by a business or individual trying to determine the cost and complexity of developing for either Apple or Microsoft. A Study of Modern Mobile Tablets - 2

Acknowledgements

I would like to thank my thesis supervisor Gerry Davies for his patience and assistance with my thesis. I would also like to thank Dr. Miguel Garcia-Ruiz for being my second reader and the guidance on how to improve my thesis document.

A Study of Modern Mobile Tablets - 3

Table of Contents

Chapter One: Proposal ...... 8 1.1. Introduction ...... 8 1.2. Objectives ...... 8 1.3. Rationale ...... 9 1.4. Scope ...... 9 1.5. TimeTable ...... 11 Chapter Two: Mobile Devices ...... 13 2.1. Apple Devices ...... 13 2.1.1. IPad Series: ...... 13 2.1.2. IPad Air Series: ...... 18 2.1.3. IPad Mini Series: ...... 20 2.1.4. IPad Pro Series: ...... 23 2.2. Microsoft Devices ...... 25 2.2.1. Surface Series:...... 26 2.2.2. Surface Pro Series: ...... 30 2.2.3. Surface Book Series: ...... 35 Chapter Three: Programming Languages ...... 38 3.1. Objective C ...... 38 3.2. C-Sharp ...... 41 3.3. Comparison ...... 42 3.4. Development ...... 47 3.4.1. Apple ...... 47 3.4.2. Microsoft ...... 56 Chapter Four: Publishing Applications ...... 67 4.1. Apple Application Store...... 67 4.2. Microsoft Store ...... 72 4.3. Developer Licenses ...... 76 Chapter Five: Operating Systems ...... 78 5.1. IOS ...... 78 5.1.1. IOS 5 ...... 78 5.1.2. IOS 6 ...... 79 A Study of Modern Mobile Tablets - 4

5.1.3. IOS 7 ...... 80 5.1.4. IOS 8 ...... 81 5.1.5. IOS 9 ...... 82 5.2. Windows 8.1 RT ...... 83 5.3. Windows 10 ...... 83 Chapter Six: Materials and Methods ...... 85 6.1. Materials and Methods ...... 85 Chapter Seven: Results and Conclusion ...... 123 7.1. Results ...... 123 7.2. Conclusion ...... 127 Appendices ...... 132 Appendix A: Device Specifications ...... 132 TABLE I...... 133 TABLE II...... 134 TABLE III...... 135 TABLE IV...... 136 TABLE V...... 137 TABLE VI...... 138 TABLE VII...... 140 Appendix B: Software Statement of Scope ...... 141 B.1. Project Inception: ...... 141 B.2. Functional Requirements: ...... 142 B.3. Non-Functional Requirements ...... 146 Appendix C: Source Code ...... 149 C.1. Increment 1: Accelerometer, IOS ...... 151 C.2. Increment 2: Gyroscope, IOS ...... 156 C.3. Increment 3: Integration, IOS ...... 163 C.4. Increment 4: Accelerometer, Windows 8 ...... 174 C.5. Increment 5: Gyroscope, Windows 8 ...... 181 C.6. Increment 6: Integration, Windows 8 ...... 189 Glossary ...... 207 References ...... 208

A Study of Modern Mobile Tablets - 5

Table of Figures

Figure 1 ...... 13 Figure 2 ...... 15 Figure 3 ...... 15 Figure 4 ...... 17 Figure 5 ...... 19 Figure 6 ...... 22 Figure 7 ...... 24 Figure 8 ...... 26 Figure 9 ...... 28 Figure 10 ...... 28 Figure 11 ...... 29 Figure 12 ...... 32 Figure 13 ...... 32 Figure 14 ...... 33 Figure 15 ...... 36 Figure 16 ...... 40 Figure 17 ...... 43 Figure 18 ...... 43 Figure 19 ...... 44 Figure 20 ...... 44 Figure 21 ...... 45 Figure 22 ...... 46 Figure 23 ...... 46 Figure 24 ...... 47 Figure 25 ...... 48 Figure 26 ...... 49 Figure 27 ...... 50 Figure 28 ...... 51 Figure 29 ...... 52 Figure 30 ...... 53 Figure 31 ...... 55 Figure 32 ...... 56 Figure 33 ...... 57 Figure 34 ...... 58 Figure 35 ...... 58 Figure 36 ...... 60 Figure 37 ...... 60 Figure 38 ...... 62 Figure 39 ...... 63 Figure 40 ...... 64 A Study of Modern Mobile Tablets - 6

Figure 41 ...... 65 Figure 42 ...... 66 Figure 43 ...... 68 Figure 44 ...... 69 Figure 45 ...... 69 Figure 46 ...... 70 Figure 47 ...... 71 Figure 48 ...... 72 Figure 49 ...... 73 Figure 50 ...... 74 Figure 51 ...... 75 Figure 52 ...... 78 Figure 53 ...... 84 Figure 54 ...... 86 Figure 55 ...... 87 Figure 56 ...... 89 Figure 57 ...... 91 Figure 58 ...... 91 Figure 59 ...... 92 Figure 60 ...... 93 Figure 61 ...... 93 Figure 62 ...... 94 Figure 63 ...... 95 Figure 64 ...... 96 Figure 65 ...... 98 Figure 66 ...... 99 Figure 67 ...... 100 Figure 68 ...... 102 Figure 69 ...... 103 Figure 70 ...... 103 Figure 71 ...... 104 Figure 72 ...... 105 Figure 73 ...... 106 Figure 74 ...... 108 Figure 75 ...... 110 Figure 76 ...... 111 Figure 77 ...... 112 Figure 78 ...... 112 Figure 79 ...... 113 Figure 80 ...... 115 Figure 81 ...... 117 Figure 82 ...... 119 Figure 83 ...... 121 Figure 84 ...... 121 A Study of Modern Mobile Tablets - 7

Figure 85 ...... 122 Figure 86 ...... 122 Figure 87 ...... 128 Figure 88 ...... 129 Figure 89 ...... 143 Figure 90 ...... 144

A Study of Modern Mobile Tablets - 8

Chapter One: Proposal

1.1. Introduction

1.2. Objectives

1.3. Rationale

1.4. Scope

1.5. Timetable

1.1. Introduction

The introduction of the mobile phone in 1973 changed how the world communicated.

Since their inception, new and more innovative products have emerged such as tablets,

smart watches, and trackers. Mobile devices are now used by almost everyone.

This research will provide a better understanding on current mobile tablets, their

histories, hardware, operating systems, application development, and implementation.

The results gathered will be used to assess advantages and disadvantages of particular

mobile tablets providing useful information for developers.

1.2. Objectives

1) Review the history of Microsoft and Apple mobile devices.

2) Research the internal hardware and features of specific Apple and Microsoft devices.

3) Investigate commonalities and key differences between Objective C and C-Sharp. A Study of Modern Mobile Tablets - 9

4) Investigate the process required to develop and publish an application for Microsoft

and Apple.

5) Research differences between Apple and Microsoft operating systems.

6) Demonstrate application development techniques by creating a sample application.

1.3. Rationale

The basis for this research is to better understand mobile devices, their evolution and

innovation. Mobile devices are going to be playing an increased role in business

environments. For example, almost all courier services now use mobile devices to gather

client signatures. This detailed study will help individuals understand the different steps

necessary to develop and publish applications to both Windows and Apple systems. The

information can be used to determine the appropriate mobile hardware required for an

individual project. All the data collected will be useful for many years. Once the data

has become obsolete it can be used as a reference on how mobile devices evolved within

this period.

1.4. Scope

The study of mobile devices will be broken down into a few select systems and versions.

The main focus will be on mobile tablets and wearable technology. The details to be

examined include their histories, programming languages, applications stores, hardware,

and operating systems. A brief history of monumental changes in mobile devices will be A Study of Modern Mobile Tablets - 10

initiated displaying only substantial changes in the field. To examine the differences between C-Sharp and Objective-C an application will be developed with similar functionality for both Apple and Microsoft tablets. This application will measure the speed and accuracy of each systems features. The goal is to develop a program that uses the different features of each system. The programming languages will also be studied to provide a list of key differences, and similarities. Both Microsoft and Apple have their own application store. These stores will be researched providing an understanding of the processes required in developing and publishing applications. An in-depth analysis will outline how to acquire developer licenses, publish applications, and payment methods.

An overview will be created outlining each mobile devices, processor, memory, cost, ports, and any proprietary peripheral connectors. Lastly the operating systems will be probed to develop an understanding on how the system works.

A Study of Modern Mobile Tablets - 11

1.5. TimeTable

A Study of Modern Mobile Tablets - 12

A Study of Modern Mobile Tablets - 13

Chapter Two: Mobile Devices

2.1. Apple Devices

2.2. Microsoft Devices

2.1. Apple Devices

Apple incorporated has developed a number of mobile devices including a few different

generations of tablets. These tablets include the iPad 1 - 4, iPad Air 1- 2, iPad Mini 1 - 4,

and the iPad Pro. Each version of the iPad improves on a particular piece of hardware

most often the is modified to include a different GPU and CPU. Each

device was released approximately one year apart as can be seen in Figure 1.

Figure 1 A timeline of all the iPad release dates starting from 2010 - 2015.

(“Created by Author”)

2.1.1. IPad Series:

General Details:

The tablets that were examined include the original iPad, iPad 2, 3, and 4. The original

iPad or the first was very basic and can no longer be updated. Appendix A, Table I [1 -

26] contains all the hardware information for the iPad 1, 2, 3, and 4. The first generation A Study of Modern Mobile Tablets - 14

iPad can only upgrade to iOS 5.1.1 [9] which over time will cause a reduction in the number of compatible apps an image is shown in Figure 2 [27]. Figure 3 depicts iPad versions 2 through 4 [28]. Every iPad other then the first version can upgrade their

Operating System (OS) to the most current iOS 9.2 [10]. Each device has a 9.7 inch display the original iPad and version two have a resolution of 1024 by 768, while versions three and four received Retina displays which improved the resolution to 2048 by 1536 [1 - 4]. The Retina display may be the factor that resulted in an 18.8 watt increase in the battery from version two to three [25, 20]. According to Jones the human eye can perceive 287 pixels per inch, confirming that apples 326 pixels per inch display is better than the human eye [29]. The storage options available for most iPad versions include a minimum of 16 GB to a maximum of 128 GB of hard-drive space [1 - 4]. The maximum amount of storage varies with each version indicated in Table I. System memory for the iPad 1 is 256 MB of DRAM [19], the iPad 2 improves with 512 MB of

DDR2 [13], while the iPad 3 and 4 receive 1 GB of DDR2 [20 - 22]. The iPad 2, 3, and 4 all contain a front and back camera the front camera ranges from 0.3 to 1.2 Megapixels and the back camera is 0.7 to 5 megapixels depending on the iPad generation [1 - 4, 23,

24, 20]. Each device is capable of accessing Wi-Fi and Bluetooth, a digital compass exists that can pinpoint your location based on your Wi-Fi location [1-4]. Every iPad except the first includes an Accelerometer, Ambient Light Sensor, and a Gyroscope [2-

4]. The accelerometer is used to determine the force of gravity on the x, y, and z axis.

The ambient light sensor is used to adjust a displays backlight based on the amount of light in an area. A gyroscope gets the angular velocity of a device based on the x, y, and z axis. A Study of Modern Mobile Tablets - 15

Figure 2 Picture of the first generation iPad running IOS 5.

Figure 3 Picture of the 2nd, 3rd, and 4th running IOS 9.

A Study of Modern Mobile Tablets - 16

System on a Chip:

Each version of the iPad uses a System on a Chip (SOC) that is designed by Apple it includes a GPU and CPU in one package. A typical SOC is meant as a motherboard replacement it can contain processors, input output, and power management controllers

[30]. SOC’s are generally used in the mobile device market because of the reduced power consumption and size [30]. A good example of an SOC is the 3 as shown in

Figure 4[31] which has CPU, GPU, Video, Audio, and Image processing. A CPU uses the GPU to offload graphic intensive computations freeing up the CPU for other tasks

[32]. The main difference between a CPU and GPU is that a GPU is designed to work on task in parallel and it typically contains more cores then a CPU [32].The original iPad uses the SOC which uses an ARM Cortex A8 processor and PowerVR

SGX535 for graphics processing [9, 11, 12]. PowerVR is a brand of graphics processors created by Imagination Technology for use in mobile platforms. The iPad 2 SOC is called the it contains a dual core PowerVR SGX543MP2 chip and a Cortex

A9 processor [13, 14, 17]. When looking at the naming of the PowerVR chips the SGX indicates a fifth series GPU, while the suffix MP identifies the chip as a multi-processor

[33]. The iPad 3 and 4 SOC’s are named the and both contain a quad-core GPU and a CPU based on the ARMv7-A architecture [14 - 18]. The Apple

A5X uses an ARM Cortex A9 processor while the Apple A6X uses processor called

Swift specifically designed by Apple [14, 15, 16]. A Study of Modern Mobile Tablets - 17

Figure 4 An image of the Tegra 3 system on a chip displaying its architecture.

Observations:

The first iPad was very basic with no camera, 256 MB of ram and the Apple A4 SOC.

With the second generation iPad it received upgrades to its SOC, RAM, and received a

front and back camera. The iPad 2 was upgraded to the Apple A5 with 512 MB of ram.

Each version of the iPad on average received a new SOC and RAM. With the 3rd iPad the

new retina display was incorporated resulting in a significant battery power increase.

Although the battery got larger the average running time stayed the same at about ten

hours. After the first iPad at least one camera was upgraded between each generation.

The 4th generation iPad was upgraded to a custom made SOC called Swift which was

based on the same ARM architecture as previous SOC’s. It also became pretty standard

for each iPad to include an Accelerometer, Ambient Light Sensor, and Gyroscope. A Study of Modern Mobile Tablets - 18

2.1.2. IPad Air Series: General Details:

The iPad Air and Air 2 are both considered part of the original iPad series. The iPad Air comes after the iPad 4. The iPad Air and Air 2 have many of the same qualities which can be seen in Appendix A, Table II [34- 41]. Figure 5 shows what the iPad Air and iPad

Air 2 look like [28]. Both versions of the iPad Air have a 9.7 inch retina display and currently support iOS 9.2 just like the iPad 4 [10, 34, 35]. The storage available for both the iPad Air 1 and Air 2 ranges from 16 GB to 128 GB [34, 35]. Apple increased the

RAM available from 1GB of DDR2 in the iPad 4 to 1GB of DDR3 [22, 40], with a further improvement to the Air 2 which contains 2GB of DDR3 [22]. Both systems have a 1.2 MP front camera and a back camera ranging from 5 MPs to 8 MPs [34, 35]. Similar to the other versions Wi-Fi and Bluetooth are present with the addition of the MIMO protocol. MIMO stands for multiple in multiple out, it uses multiple antennas to receive and send data which can increase network throughput [42]. Both iPad Air versions include the Wi-Fi digital compass and the iPad Air 2 added the iBeacon Micro location feature. The IBeacon feature can be used to pinpoint a devices location using the

Bluetooth protocol [43]. Using the Bluetooth low energy band iBeacon devices can broadcast their location, devices coming within range can be notified of their location relative to the broadcasting device [44]. The general idea is to provide a way to market and notify users that they have come into range of an iBeacon device. An example given is having a food truck running iBeacon when devices come within a range a notification is produced indicating that a truck is nearby [44]. The iPad Air like the iPad 4 includes an accelerometer, ambient light sensor and gyroscope [34]. A barometer and touch ID sensor were added to the iPad Air 2 [35]. The iPad Air was one of the first iPad’s to A Study of Modern Mobile Tablets - 19

receive a coprocessor called the Apple M7, while the Air 2 uses the Apple M8

motion coprocessor. The motion coprocessor is designed to continuously measure data

received from the accelerometer, gyroscope, barometer, GPS, and compass. A

Magnetometer is used to detect magnetic fields. Barometers are usually used to collect

information about atmospheric pressure. Creating a separate processor increases the

power efficiency of the SOC by offloading sensor calibration tasks to the motion

coprocessor [45].

Figure 5 Picture of the iPad Air and iPad Air 2 running IOS 9.

System on a Chip:

The SOC used by the iPad Air is the , while the Air 2 uses the .

With the iPad 4 Apple started to move away from predesigned processors and started

creating their own designs. The iPad Air’s A7 SOC contains a CPU called Cyclone

which is based on an ARMv8-A architecture [16]. The integrated GPU is a PowerVR

G6430 which is from series 6 created by Imagination Technology [39, 46]. The iPad Air

2 SOC is made up of a processor called Typhoon, and a PowerVR GXA6850 [22, 38]. A Study of Modern Mobile Tablets - 20

Typhoon is another apple designed CPU based on ARMv8-A architecture, while it’s

GPU is a custom designed variant of the series 6XT [47].

Observations:

The iPad Air is technically still part of the iPad series of tablets. The 5th generation iPad follows the same path as previous models with an improved SOC and faster RAM. The iPad Air was the first device to introduce the motion coprocessor. Although the iPad Air still has the same retina display it was able to reduce its batter size by about 10 watt hours which is probably why it was slimmer and lighter. Neither cameras received an upgrade but the wireless technology MIMO was introduced. Next the iPad Air 2 was introduced which received an upgraded SOC, motion coprocessor, RAM, back camera, iBeacon, TouchID, and Barometer. Even with the added technology Apple was able to again reduce the battery size by 5 watt-hours compared to the iPad Air. Both iPad Air

SOC’s use ARM 8 architecture compared to the ARM 7 used in all previous models.

The iPad Airs had a custom designed processor called Cyclone and the iPad Air 2 was given Typhoon which was an enhanced Cyclone.

2.1.3. IPad Mini Series:

General Details:

The iPad Mini is a slightly smaller version of the standard iPad, the size was reduced to increase portability. The reduced size allows customers to carry the tablet easily because of its weight and display size. All of the hardware specification for the iPad Mini 1, 2, 3 and 4 are outlined in Appendix A, Table III [48 - 57]. Figure 6 [58] depicts every iPad A Study of Modern Mobile Tablets - 21

Mini running iOS 9. Every version of the iPad Mini has a 7.9 inch display the first generation is the only Mini without a retina display [48 - 51]. The first generation Mini has storage options from 16GB to 64GB while every other version offers up to 128GB

[48 - 51]. The amount of memory in the iPad Mini 1 is 512 MB of DDR2 RAM, just like the iPad 2 [53]. The reduction in size is probably the leading factor in the reduced memory considering that the iPad Mini was available the same year as the iPad 3 which received 1GB of RAM [20, 21]. The iPad Mini 2 and 3 both received 1GB of DDR3

RAM, while the Mini 4 gained another boost with 2GB of DDR3 [54 - 56]. The iPad

Minis all have a 1.2 MP front camera [48 - 51]. The iPad Mini 1, 2, and 3 all contain a 5

MP back camera with the Mini 4 getting an upgraded 8 MP camera [48 - 51]. Each iPad

Mini has Wi-Fi, and Bluetooth at a minimum, the iPad Mini 2 and 4 are also capable of using MIMO [48 - 51]. For geolocation services the each iPad Mini contains a Wi-Fi

Digital Compass, versions 3 and 4 have the addition of iBeacon just like the iPad Air 2.

The sensors available to the iPad Mini 1 and 2 include the accelerometer, ambient light sensor, and gyroscope [48 - 51]. The Mini 3 was upgraded to include Touch ID, while the Mini 4 received Touch ID and a Barometer. Touch ID is another form of password protection that uses a fingerprint to unlock Apple devices, or make purchases through the Apple [59]. Touch ID requires a user to already have a password set on their device. The user must follow some setup steps which involves holding their finger over the home button [59]. Devices with Touch ID have a home button made from a clear sapphire crystal that protects the sensor and acts as its lens [60]. A steel ring surrounding the button detects a user’s finger taking a high resolution image from a small section of the finger print [60]. A mathematical representation of a users finger A Study of Modern Mobile Tablets - 22

print is stored for comparison, to identify a valid finger [60]. A motion coprocessor was

introduced in the iPad Mini 2, 3, and 4. The iPad Mini version 2 and 3 were developed

with the Apple M7, while the iPad Mini 4 received the upgraded Apple M8.

Figure 6 Picture of the iPad mini 1, 2, 3, and 4 running IOS 9.

System on a Chip:

The iPad Mini 1 was created using the Apple A5 SOC, which is the same SOC used by

the iPad 2. The iPad Mini 2 and 3 use the same SOC as the iPad Air 1. Lastly the iPad

Mini 4 received its own custom designed SOC called the which is similar to

the Apple A8X used by the iPad Air 2. The A8 contains a custom processor named

Typhoon designed by Apple, with a PowerVR GX6450 which is a slightly less powerful

version of the GXA6850 [38]. Apple probably reduced the GPUs capabilities to save on

power consumption and maintain the ten hour battery life advertised.

Observations:

The first iPad Mini came out at about the same time as the iPad 4. Although the retina

displays was available it was never added to the iPad mini. The iPad mini was also built

using the Apple A5 SOC the same one used by the iPad 2. In comparison the iPad mini A Study of Modern Mobile Tablets - 23

is nearly identical to the iPad 2. The major difference between them is that the iPad mini received a smaller screen, smaller battery, and better cameras. The iPad Mini 2 was released at the same time as the iPad Air. One difference between the first and second generation iPad Mini is that it received the retina display. The iPad Mini 2 is identical to the iPad Air the only difference between the two is that the iPad Mini 2 has a smaller screen, smaller battery, and weighs less. It would appear that the iPad Mini 2 is just the iPad Air in a smaller container. Looking at the iPad Mini 3 is again nearly identical to the iPad Air and iPad Mini 3. The only differences between the iPad Mini 3 and Mini 2 are the addition of the iBeacon and Touch ID technologies. Otherwise everything else is the same as the iPad Mini 2. Finally with the introduction of the iPad Mini 4 some significant changes occur. The iPad Mini 4 gets an upgraded SOC called the Apple A8 which is less powerful then the iPad Air 2’s A8X chip. The iPad Mini 4 was given 2GB of RAM, upgraded back camera, iBeacon, Touch ID, and Barometer. All these features were added yet the battery size was not increased and the device actually got lighter.

2.1.4. IPad Pro Series:

General Details:

There is currently only one iPad Pro version in production its details are shown in

Appendix A, Table IV [61 - 65]. The iPad Pro was advertised to offer desktop like performance and have one of the fastest CPU’s compared to other tablets [66]. The iPad

Pro has the largest screen of any iPad with a retina display of 12.9 inches [61]. An image of the iPad pro compared to previous versions can be seen in Figure 7 [58]. There are two storage options 32GB or 128GB most likely due to Apple trying to push the iPad A Study of Modern Mobile Tablets - 24

Pro as a desktop replacement [61]. The new iPad Pro received 4GB of DDR4 RAM

compared to the iPad Air 2 and iPad Mini 4 that contain only 2GB of DDR3 [22,56].

The iPad Pro would appear to combine all the upgrades from previous iPad series into

one large package. The front camera is 1.2 MP and the back camera is 8 MP [61].

Support is available for the most common wireless types such as Wi-Fi, Bluetooth, and

MIMO. The geo-location services offered include the Wi-Fi digital compass, and

iBeacon. Lastly it includes all the sensors like accelerometer, compass, gyroscope, touch

ID, and barometer.

Figure 7 Image of the iPad Pro compared to the iPad Air, iPad, and iPad mini.

System on a Chip:

The SOC appears to be where the iPad Pro has made most of its improvements. The

SOC is called the it includes a custom built Twister CPU based on ARMv8-

A architecture [22,63]. The iPad Pro is the only iPad using the new Twister CPU. In

addition the GPU being used is a modified PowerVR series 7 design which was A Study of Modern Mobile Tablets - 25

developed specifically for the iPad Pro [64]. Lastly the A9X SOC integrated the M9

motion coprocessor onto the same chip instead of as a separate one.

Observations:

The iPad Pro may become its own line of devices like the iPad and iPad Mini. It is the

only device using an Apple A9X SOC; it contains 4GB of RAM which is twice as much

as the iPad Mini 4 and iPad Air 2. The iPad Pro has every technology that was

incorporated into every other iPad generation. The iPad Pro could be thought of as the

most complete iPad yet.

2.2. Microsoft Devices

Microsoft has developed a number of mobile devices including a few different

generations of tablets. These tablets include the Surface 1 - 3, Surface Pro 1- 4, and the

Surface Book. Each version of the Surface tablet improves on a particular piece of

hardware. The Surface, Surface 2, and Surface 3 all use a System on a Chip each with a

different GPU and CPU. Each device was released approximately one year apart

occasionally in pairs as can be seen in Figure 8.

A Study of Modern Mobile Tablets - 26

Figure 8 A timeline of all the Microsoft Surface release dates starting from 2012 - 2015.

("Created by the author")

2.2.1. Surface Series:

General Details:

The first series of Microsoft Surface tablets included the Surface RT, Surface 2, and

Surface 3. The complete hardware specifications can be found in Appendix A, Table V

[67 - 83]. Windows RT 8.1 is currently the highest supported operating system for the

Surface RT and Surface 2. Figure 9 [67, 68] shows pictures of the Surface RT and

Surface 2 they are both similar looking. Windows RT is not supported by the Surface 3

instead Windows 10 is the highest supported OS. The first surface tablet was built with a

10.6 inch display, with a lower resolution then the surface 2 and surface 3 [67 - 69]. The

Surface 2 received a resolution increase but kept the same 10.6 inch display. The Surface

3 on the other hand kept the same resolution but received an upgraded screen of 10.8

inches it can be seen in Figure 10 [69]. To increase the clarity on devices with lower

resolutions Microsoft developed ClearType. ClearType improves the clarity and

smoothness of digital text or type [84]. To accomplish this ClearType chooses pixel

around the edge and modifies the brightness value of sub-pixels to blend jagged edges A Study of Modern Mobile Tablets - 27

into smooth shapes [84]. An example of how ClearType works can be seen in Figure 11

[84]. Looking at Figure 11 the first step depicts how the letter looks using its typeface outline, the second portion is the letter rendered to the screen without ClearType, lastly the same letter is rendered using ClearType [84]. From the third image in Figure 11 it is easy to notice the blurry sub pixels caused by reducing their brightness value. ClearType technology was made to work on current displays specifically LCD monitors, but it can provide improvements on CRT monitors [84]. The Surface RT and Surface 2 can be purchased with 32GB or 64GB of internal storage, while the Surface 3 options are either

64GB or 128GB [78, 79, 69]. Compared to early iPad versions the Surface series starts with more memory from the start. The Surface RT and Surface 2 both come with 2GB of

DDR3 RAM, in comparison the Surface 3 gets either 2GB or 4GB based on the amount of internal storage chosen [78, 79]. Each device contains a front and back camera the front camera is 3.5MP for all versions [80 - 82]. The back camera is different for the

Surface 3 with 8MP compared to the Surface RT and Surface 2’s 5MP [81, 82]. The wireless technology supported by all devices includes Wi-Fi and Bluetooth [67 - 69].

The Surface 2 was the only device in this series to receive a digital compass. Each device has an ambient light sensor, accelerometer, gyroscope, and magnetometer. The

Surface 2 continues to be unique with the addition of a proximity sensor. A Study of Modern Mobile Tablets - 28

Figure 9 Picture of the Surface RT and Surface 2.

Figure 10 Picture of the Surface 3 showing available ports and kickstand. A Study of Modern Mobile Tablets - 29

Figure 11 How ClearType technology increases digital type clarity.

System on a Chip:

The original Surface RT was created to utilize the Tegra 3 SOC. The Tegra 3 is

designed around an ARM Cortex A9 processor based on the ARMv7-A architecture [14,

31]. Included within the Tegra 3 is a Geforce Ultra Low Power (ULP) GPU which is

based on the Tegra 2, but with the addition of four extra cores for a total of twelve [85,

86]. The Surface 2 following the same route integrated the NVIDIA Tegra 4 SOC. The

Tegra 4 utilizes four ARM Cortex-A15 processors based on the ARMv7 architecture [74

- 76]. The GPU is a further modified Geforce ULP chip with seventy-two cores which is

six times more than the Tegra 3[31, 75]. The last device in this series is the Surface 3

which reversed the direction from ARM based SOC’s to an Intel Atom x7-Z8700. Within

the Intel Atom SOC is a quad core Atom x7-Z8700 processor based on Intel’s Airmont A Study of Modern Mobile Tablets - 30

architecture [77,87]. The GPU is based on Intel’s generation eight HD graphics which is integrated and designed for low power systems [88].

Observations:

The original Surface tablet was released around the same time as the iPad 3. However it has a lower resolution then most iPad devices. The surface RT runs Windows RT which has received a lot of negative reviews because of its inability to run desktop applications.

The Surface RT is the base for all other versions to improve upon. The Surface 2 received a better resolution screen, and an updated SOC. It was also the first device to add a proximity sensor, and digital compass. However other then these minor improvements nothing else changed. The Surface 3 was the first device to move away from an ARM based SOC instead an Atom SOC was used. The change to an Intel based SOC was probably due to the negative reception of Windows RT. With the new Intel based system it was possible to install Windows 10. Other then the improved SOC only the back camera received an upgrade.

2.2.2. Surface Pro Series:

General Details:

Microsoft’s second series of tablets are known as the Surface Pro from 1 to 4. Details about each Surface Pro device and their hardware can be found in Appendix A, Table VI

[89 - 112]. Each device is capable of running Windows 10 [73]. Figure 12 [113] shows what the Surface Pro looks like while Figure 13 shows the Surface Pro 2 [114]. The

Surface Pro 1 and 2 both come with a 10.6 inch display. The Pro 3 was upgraded to 12 A Study of Modern Mobile Tablets - 31

inches, while version 4 received a 12.3 inch display [91, 92]. Images of the Surface Pro 3 and 4 can be seen in Figure 14 [115, 92].Each Surface Pro’s RAM is determined based on the hard drive size chosen [89 - 92]. The first generation of Surface Pro could only have

64 or 128 GB of storage with a corresponding 4GB of DDR3 RAM [89]. The second and third generation can be purchases with 64, 128, 256, or 512GB of storage [89, 100]. The available RAM is either 4GB or 8GB of DDR3 for a 128GB or smaller drive 4GB is assigned, while a size of 256 or greater gives 8GB [89, 100]. Options available for the

Surface Pro 4 include 128, 256, 512, and 1024GB of storage [92, 100]. The total RAM available is 4 GB, 8GB, or 16GB of DDR3. A storage capacity of 512 or 1024GB always receives 16GB of RAM, while a size of 256GB gives the purchaser the choice of 8GB or

16GB. If a hard drive of 128GB is chosen it is limited to only 4GB of RAM [92, 100].

The first two generations of Surface Pro were equipped with a 1.2MP camera on the front and back [89, 90, 100]. With the introduction of the Surface Pro 3 a 5.0MP front and back camera was added [109]. The last version received an upgraded back camera from

5MP to 8MP, while the front stayed at 5MP [92]. Mobile networking technologies like

Wi-Fi and Bluetooth are supported by every Surface Pro device. The last thing to look at is the sensors available each device includes an ambient light sensor, accelerometer, gyroscope, and magnetometer [89 - 92]. A Study of Modern Mobile Tablets - 32

Figure 12 Picture of the Surface Pro and some of its controls, and features.

Figure 13 Picture of the Surface Pro 2 from Microsoft. A Study of Modern Mobile Tablets - 33

Figure 14 Pictures of what the Surface Pro 3 and Surface Pro 4 look like.

CPU and GPU:

The Surface Pro series were the first tablets from Microsoft where an SOC was not used

instead the graphics are provided by the CPU. The Surface Pro has an Intel i5-3317U

CPU with a speed between 1.7GHz and 2.6GHz [96, 97]. The Intel i5-3317U is based on

Intel’s 3rd Generation architecture which includes an Intel HD Graphics 4000 GPU [96].

The Surface Pro 2 can have an Intel i5-4200U, or an Intel i5-4300U processor designed

using the 4th Generation Intel architecture. The Intel i5-4200U can run between 1.6GHz

and 2.6GHz, while the Intel i5-4300U has a frequency of 1.9GHz to 2.9GHz [96, 98,

102]. In addition the integrated GPU is an Intel HD Graphics 4400 chip [96]. Three

processors are available for the Surface Pro 3 and each has their own GPU. The Surface

Pro 3 can have one of three different CPUS based on Intel’s 4th Generation architecture.

The slowest CPU available is the Intel i3-4020Y which has a speed of 1.5GHz, and an

Intel HD Graphics 4200 GPU [96, 99, 106]. The step up is an Intel i5-4300U A Study of Modern Mobile Tablets - 34

processor using the Intel HD Graphics 4400 GPU, which is the same CPU available to the Surface Pro 2 [96, 102, 107]. The last option is an Intel i7-4650U CPU running between 1.7GHz and 3.3GHz paired with an Intel HD Graphics 5000 GPU [96, 104,

108]. The Surface Pro 4 also has three CPU options modeled after Intel’s 6th Generation including the m3, i5, and i7. The first option available is an Intel m3-6Y30 with a speed of 0.9GHz up to 2.2GHz, combined with an Intel HD Graphics 515 GPU [100, 101].

Next is an Intel i5-6300U processor starting at 2.4GHz and maxing out at 3.0GHz, paired with an integrated Intel HD Graphics 520 GPU [79, 100, 103]. The only other choice is an Intel i7-6650U CPU with a clock speed of 2.2GHz reaching up to 3.4GHz with an Intel Iris Graphics 540 GPU [100, 105]. The Surface Pro 4 is currently the only device that uses the Iris Graphics GPU series.

Observations:

Once the Surface devices moved away from the ARM based SOC it was possible to offer more processor varieties to users. With the introduction of the Surface Pro Microsoft completely removed the SOC. Instead they opted to use Intel processors with integrated graphics. The Surface Pro was upgraded to use an Intel Core i5 processor and received an increase in RAM. The Surface Pro 2 also uses an Intel Core i5 processor but two options are provided. In addition more storage and RAM options were provided to the user. The cameras in the Surface Pro series were downgraded when compared to the Surface line.

With the Surface Pro 3 even more choices were provided to user an i3, i5, or i7 processor could be chosen. Depending on the processor chosen the integrated graphics would change as well. This means that if a user wants to run graphic intensive applications the A Study of Modern Mobile Tablets - 35

higher end processor would be a good choice. Finally the Surface Pro received an upgraded front and back camera from 1.2 MP to 5.0 MP. In addition the Surface Pro 3 has a 12 inch screen compared to the Surface Pro 2’s 10.6 inch screen. Microsoft also appears to keep the battery size very consistent across all models. Lastly the Surface Pro

4 was given a 12.3 inch screen resulting in a larger resolution. A user can choose between an m3, i5, or i7 processor. The last improvement was an upgraded back camera from 5

MP to 8 MP.

2.2.3. Surface Book Series:

General Details:

The Surface Book is unique because it is both a and tablet. The tablet acts as the screen and can be removed while also providing touch capabilities. There is currently only one version of the Surface Book and its specifications are outlined in

Appendix A, Table VII [116 - 119]. A picture of the hybrid Surface Book can be seen in

Figure 15 [116].The highest currently supported operating system for the Surface Book is Windows 10 [73]. The tablet acts as the laptop screen and can be undocked from the base [95]. The tablet has a 13.5 inch screen with a resolution of 3000 x 2000 which is the largest resolution available for Microsoft’s tablets [95]. There is an increased amount of choice when it comes to storage and memory in the Book. The Surface Book can be purchased with 128, 256, 512, or 1024 GB of hard drive space [95]. Unlike other

Microsoft tablets the Book, can have either 8GB or 16GB of memory no matter what hard drive size is chosen [95]. There is a front camera with 5MP and a back camera with

8MP just like the Surface Pro 4 [95]. Just like every other Surface Series Bluetooth and A Study of Modern Mobile Tablets - 36

Wi-Fi are the available wireless capabilities. Included with the Surface Book are the

following sensors an ambient light sensor, accelerometer, gyroscope, and magnetometer

[95].

Figure 15 Pictures of what the Surface Book looks like the screen is a removable tablet.

CPU and GPU:

The Surface Book has two different CPU choices based on Intel’s 6th Generation

architecture they include the Intel Core i5-6300U or Intel Core i7-6600U [103, 117,118].

Both CPU’s contain the same integrated Intel HD Graphics 520 GPU [103, 117,118]. An

optional NVIDIA Geforce GPU with 1GB of GDDR5 RAM can be bought with the

Surface Book’s base [95, 117]. This allows the Surface Book to accomplish more

graphic intensive tasks then if it was to rely upon the CPU’s integrated graphics alone. If A Study of Modern Mobile Tablets - 37

the tablet is undocked from the laptop base it will switch to using Intel’s integrated graphics.

Observations:

The Surface Book is kind of like the iPad Pro it is a larger version of the Surface tablets.

The Surface Book is half laptop and half tablet. The Surface Book has the largest display size of 13.5 inches and a resolution that is better than any iPad available. For processors only two choices are given an i5 or i7 processor. Both processors have the same integrated graphics. To enable graphic intensive applications a custom GPU can be purchased that is used when the tablet is attached to the laptop base. Another feature is that the RAM available is not tied to the amount of storage purchased. Previous Surface products could only get more RAM if more storage was also purchased. The Surface

Book has most of the same features as the Surface Pro 4 including camera, sensors, and wireless technology. The Surface Book is very different because of its dual purpose it is both a tablet and laptop.

A Study of Modern Mobile Tablets - 38

Chapter Three: Programming Languages

3.1. Objective C

3.2. C-Sharp

3.3. Comparison

3.4. Development

3.1. Objective C

Brief History:

Apple uses a superset of ANSI C called Objective-C [120]. Objective-C is the main

language used for writing most Apple applications. Objective-C provides object-oriented

properties to the C programming language. The syntax, primitives, and control

statements are all the same. However Objective-C defines a new syntax for classes and

methods. Objective-C was originally developed by Brad Cox and Tom Love for the

company Stepstone in the early 1980s [121]. Next Computers started developing the

NeXTStep framework that Apples Cocoa is based on [121]. Apple then purchased Next

Software for four hundred million dollars in 1996 [122]. Cocoa is a collection of object-

oriented libraries, runtimes, and integrated development environment [120]. Cocoa has

two main frameworks for OSX and IOS. OSX uses the Foundation and AppKit libraries

while IOS uses Foundation and UIKit libraries [120]. When declaring arrays in

Objective-C a collection class is used such as NSArray, NSSet, or NSDictionary. This is

a significant difference when compared to the C language that Objective-C is based A Study of Modern Mobile Tablets - 39

upon, while it is possible to create arrays similar to ANSI C [123]. If a data type starts with the NS prefix it indicates that it was originally created by NeXTStep.

Garbage Collection:

Garbage collection is an important part of almost every programming language.

Objective-C uses a form of Automatic Reference Counting (ARC) which provides automatic memory management through the compiler [124]. The original garbage collection libraries were deprecated to be replaced with ARC [124]. In Objective-C variables are given qualifier names of either strong, weak, unsafe_unretained, or auto releasing [124]. By default when a variable is created and no property is set it is assigned the strong property [124]. Strong keeps an object alive as long as a strong pointer is pointing to it [124]. Weak is a reference that does not keep an object alive, when no strong pointer is pointing to the object it is set to nil [124]. Nil is objective-C’s versions of Null, just like Self is Objective-C’s version of This. Unsafe_unretained is like the weak property but the object is not set to Nil which could result in dangling pointers

[124]. Auto releasing is used to note arguments that are passed by reference and auto released when they are returned [124]. ARC works by examining variable and class lifetimes based on the qualifiers given ARC then adds memory management calls at compile time [124].

Object Oriented

Objective C although built on top of ANSI C is an object oriented language. One benefit of Objective-C is that existing C applications can be ported to run using Objective-C A Study of Modern Mobile Tablets - 40

frameworks [121]. Objective-C is considered very dynamic because it uses dynamic

typing, binding, and loading [120]. Objective-C’s dynamic typing determines an objects

class at runtime [120]. Dynamic binding is used to determine the methods that can be

invoked at runtime [120]. Lastly dynamic loading allows new modules to be added at

runtime [120]. An example of dynamic typing can be seen in Figure 16 the method

(IBAction)resetAccelerometer:(id)sender uses the generic object type called (id) [120].

“The id data type makes it possible to substitute any type of object at runtime.” [120].

Figure 16 The AccelerometerViewController class shows ARC properties weak and uses

(id) which is an example of dynamic typing.

Dynamic binding works by binding method invocations only when a message is

delivered to a method. During runtime a message dispatcher is used to create dynamic

binding [120]. When a message is sent to an object its Isa pointer locates the appropriate

class once the class is found the method is invoked [120]. The Isa pointer points to an A Study of Modern Mobile Tablets - 41

objects class which was compiled from its class definition [120]. Dynamic loading

allows a program to load code and assets as needed instead of loading everything at the

beginning [120].

3.2. C-Sharp

General Information

Microsoft created a language inspired by C called C-Sharp it however is not a derivative

of C. C-Sharp version 1.0 was originally released in 2002 the most current version is C#

6.0 released in 2015 [126]. C-Sharp supports unsafe code, or code that runs outside of

the common language runtime. It allows pointers to reference specific locations in

memory; however these pointers must be pinned to prevent the garbage collector from

altering their location. Thread synchronization constructs for C-Sharp include, lock,

monitor, mutex, and interlock. C-Sharp has a problem with priority inversion, in which a

lower priority thread blocks a higher priority thread possibly resulting in starvation.

Unlike Java which runs in a virtual machine C-Sharp can gain information about the

systems CPU and memory [127]. C-Sharp is able to call the Win32 API to obtain system

performance counters, CPU characteristics, memory usage at both the machine and

process level. When exceptions occur within a C-Sharp program an exception object is

created allowing developers to extend an error message based on an application. Type

safety is a key feature of C-Sharp, any program errors are caught at compile time while

also catching errors during runtime. Type safety ensures that objects are always

allocated and accessed in appropriate ways [127].

A Study of Modern Mobile Tablets - 42

Garbage Collection

C-Sharp uses the .Net garbage collector to manage the allocation and deallocation of

memory [128]. New objects are created and added to the heap as long as memory is

available. If no memory is available to garbage collector must free up some space. The

garbage collector provides the ability to write applications without worrying about

memory allocation and deallocation [128]. Garbage collection occurs when the system

has low physical memory, allocated objects on the heap passes a specific limit, or the

garbage collector is called by the program [129]. When the garbage collection is started

the collector reclaims memory associated with dead objects [129]. The garbage

collectors heap is actually two heaps the large and small heap. The large heap is for

objects with very large sizes such as arrays [129]. The garbage collection has three main

phases marking, relocating, and compacting. During the marking phase a list is created

of all the living objects or objects with a reference. The relocation phase updates the

references to any objects that need to be compacted. Lastly the compacting phase

reclaims dead object space and moves live objects to the top of the heap [129].

3.3. Comparison

In this section some example code will be outlined to compare objective-c and c-sharp.

Six applications were written to help demonstrate and research application development

for both platforms. The first program that will be examined is the AccelerometerTest

application. Figure 17 shows the C-Sharp code for the stop accelerometer method that is

executed when the stop button is pressed. Figure 18 shows the Objective-C code that is

run when its stop button is pressed. The C-Sharp code was written to include a boolean A Study of Modern Mobile Tablets - 43

condition to check if a button had already been pressed, because of how event handlers

are attached. If no boolean value was used then every time a user pressed the start or

stop button an event handler would be added or removed. For example if the user

pressed the start button three times then three TypedEventHandlers would be added to

ReadingChanged. The result of this is that the user would need to press the stop button

three times as well. This bug does not occur in objective-c making the

stopAccelerometer method extremely simple as can be seen in Figure 18.

private void StopAccelerometer(object sender, RoutedEventArgs e) { if (startPressed == true) { startPressed = false; accelerometer.ReadingChanged -= new TypedEventHandler(AccelerometerChanged); accelerometer.ReportInterval = 0; } } Figure 17 C# stop accelerometer method from accelerometerTest class

-(IBAction)stopAccelerometer:(id)sender { [self.motionManager stopAccelerometerUpdates]; } Figure 18 Objective-C stop accelerometer method from the accelerometerTest class.

The startAccelerometer method attaches a TypedEventHandler using the Accelerometer

which sends data to the AccelerometerChanged method as seen in Figure 19. The

accelerometer reading only changes when the device is actually being moved it does not

update while stationary. A check must also be done to determine if an accelerometer

sensor exists if not then it will be null. In C# the start and stop methods are almost

identical adding and subtracting event handlers. Objective C uses a CMMotionManager

class that has methods for accessing sensor data called updateToQueue. If no sensors are

available and CMMotionManager is called the system will crash. In both applications an

event handler is used to update the UI labels. Figure 20 shows the objective c code A Study of Modern Mobile Tablets - 44

needed to retrieve accelerometer data. Once data is retrieved by the queue the inner

block of code is executed which calls two methods setLabel and checkMaximum. In

Figure 19 the AccelerometerChanged method is called which is outlined in Figure 21.

The AccelerometerChanged also calls two methods to setLabels and checkMaximum

values.

private void StartAccelerometer(object sender, RoutedEventArgs e) { if (accelerometer != null && startPressed == false) { startPressed = true; accelerometer.ReportInterval = interval; accelerometer.ReadingChanged += new TypedEventHandler(AccelerometerChanged); } } Figure 19 The StartAccelerometer method which adds an event handler.

-(IBAction)startAccelerometer:(id)sender { //Create a queue of accelerometerData which can be retrieved [self.motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) { //pass the acceleration.x y and z values into the setLabel method. [self setLabel_X:accelerometerData.acceleration.x Label_Y:accelerometerData.acceleration.y Label_Z:accelerometerData.acceleration.z]; //pass the acceleration.x y and z values into the checkMaximum method to set the maximum amount of acceleration [self checkMaximumValue_CurrentX:accelerometerData.acceleration.x CurrentY:accelerometerData.acceleration.y CurrentZ:accelerometerData.acceleration.z]; //If an error occurs at any point while the accelerometer is trying to retrieve data write it out to the console. if (error) { NSLog(@"%@", error); } } ]; }

Figure 20 The StartAccelerometer method which updates accelerometer data using a

block.

Both languages update labels in a similar fashion making direct reference to the labels

that need to be modified. For example self.xLabel.text is the same as xLabel.Text in

addition both labels require that a formatted string be added. The syntax for the

formatted strings look different but they both show the same data. When the label is A Study of Modern Mobile Tablets - 45

displayed it includes two decimal places and a sign value such as positive or negative.

One big difference in implementing accelerometer updates was that the

AccelerometerChanged method needed to be asynchronous. Objective-C uses the queue

to retrieve data from the sensors independently while C-Sharp requires that a separate

thread be started to update the accelerometer values. If it is not done this way the user

interface will not run and respond smoothly. Figure 21 shows how to create an

asynchronous method, which must implement the await keyword and assign a

dispatcher.

async private void AccelerometerChanged(object sender, AccelerometerReadingChangedEventArgs e) { //unload the acceleration readings to another thread await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { //call update labels and update max with the acceleration values SetLabels(e.Reading.AccelerationX, e.Reading.AccelerationY, e.Reading.AccelerationZ); CheckMaximumValue(e.Reading.AccelerationX, e.Reading.AccelerationY, e.Reading.AccelerationZ); }); } Figure 21 AccelerometerChanged is used to update all the different labels.

The set label method’s in Figure 22 are very simple and needs little explanation. When a

call is made to the method the corresponding user interface labels are updated with the

double values.

-(void)setLabel_X:(double)x Label_Y:(double)y Label_Z:(double)z { //set the text displayed by the labels to the NSString object self.xLabel.text = [NSString stringWithFormat:@"Accelerometer X: %+0.2f",x]; self.yLabel.text = [NSString stringWithFormat:@"Accelerometer Y: %+0.2f",y]; self.zLabel.text = [NSString stringWithFormat:@"Accelerometer Z: %+0.2f",z]; }

private void SetLabels(double x, double y, double z) { xLabel.Text = String.Format("Accelerometer X: {0,5:+0.00;-0.00}", x); yLabel.Text = String.Format("Accelerometer Y: {0,5:+0.00;-0.00}", y); zLabel.Text = String.Format("Accelerometer Z: {0,5:+0.00;-0.00}", z); }

A Study of Modern Mobile Tablets - 46

Figure 22 The methods used to update labels the first is objective c and the second is

c-sharp.

The checkMaximumValues methods shown in Figure 23 are similar to the setLabels

method. One of the key differences is that the maximum value method must determine the

absolute value of a double. The absolute value is required because depending on the

direction of the accelerometer it can be negative or positive. Objective c uses the fabs()

method and C-Sharp uses Math.Abs() to retrieve the absolute value.

-(void)checkMaximumValue_CurrentX:(double)x CurrentY:(double)y CurrentZ:(double)z { if(fabs(currentX) <= fabs(x)) { currentX = x; self.xMaxLabel.text = [NSString stringWithFormat:@"Max: %+0.2f",x]; } if(fabs(currentY) <= fabs(y)) { currentY = y; self.yMaxLabel.text = [NSString stringWithFormat:@"Max: %+0.2f",y]; } if (fabs(currentZ) <= fabs(z)) { currentZ = z; self.zMaxLabel.text = [NSString stringWithFormat:@"Max: %+0.2f",z]; } } private void CheckMaximumValue(double x, double y, double z) { if(Math.Abs(currentX) <= Math.Abs(x)) { currentX = x; xMaxLabel.Text = String.Format("Max: {0,5:+0.00;-0.00}", x); } if (Math.Abs(currentY) <= Math.Abs(y)) { currentY = y; yMaxLabel.Text = String.Format("Max: {0,5:+0.00;-0.00}", y); } if (Math.Abs(currentZ) <= Math.Abs(z)) { currentZ = z; zMaxLabel.Text = String.Format("Max: {0,5:+0.00;-0.00}", z); } } Figure 23 The checkMaximumValue method that updates the max labels based on

the old current value and the new one being checked.

A Study of Modern Mobile Tablets - 47

The last thing to look at is the resetAccelerometer methods. The reset method sets the

current double values to 0.0 and then calls setLabel, and checkMaximumValues as seen

in Figure 24.

//Reset the accelerometer and max labels and reset the max values to zero -(IBAction)resetAccelerometer:(id)sender { //reset current maximum values currentX = 0.0; currentY = 0.0; currentZ = 0.0; //call setLabel so the all the Accelerometer X: , Accelerometer Y: , Accelerometer Z: labels are set to +0.0 [self setLabel_X: currentX Label_Y: currentY Label_Z: currentZ]; //call checkMaximumValue_CurrentX so the all the Max: labels are set to +0.0 [self checkMaximumValue_CurrentX: currentX CurrentY: currentY CurrentZ: currentZ]; }

private void ResetAccelerometer(object sender, RoutedEventArgs e) { //reset the current max values to 0 currentX = 0.0; currentY = 0.0; currentZ = 0.0; //update the max values CheckMaximumValue(currentX, currentY, currentZ); //update the accelerometer labels SetLabels(currentX, currentY, currentZ); }

Figure 24 ResetAccelerometer method is used to reset all the user interface labels

back to zero.

The layout for the gyroscopeTest application is also nearly identical however instead of

using the accelerometer class the gyroscope is used. The full source code is available in

Appendix C including the XAML code necessary to recreate the user interfaces.

3.4. Development

3.4.1. Apple

Developing applications for Apple requires that the developer has access to a

computer running OSX. Apple has developed its own integrated development A Study of Modern Mobile Tablets - 48

environment called Xcode. Xcode version 7.3 is the most recent stable release and

can be run on OSX 10.11 called El Capitan [130, 131]. Xcode 7.3 can be used to

produce applications for the following operating systems IOS 9.3, OSX 10.11.4,

WatchOS 2.2, and tvOS 9.2 [131]. The earliest Xcode version that can be

downloaded is 4 which can be installed on OSX 10.6.3 known as Snow Leopard

[132]. Xcode 4 can be used to implement IOS 3.2 and OSX 10.5. The Xcode editor

is broken into five different areas as seen in Figure 25 [133].

Figure 25 The Xcode IDE showing the different areas and controls.

A Study of Modern Mobile Tablets - 49

The navigator area is used to move between files that are displayed in the editor

area. If an objective c file is selected it can be directly edited within the editor area.

In addition if a storyboard is selected then a storyboard view will appear in the

editor area. Once the storyboard is loaded controls can be dragged onto the different

views or new views can be added. A blank storyboard file and some controls that

could be added to the view are displayed in Figure 26.

Figure 26 An example of a storyboard view and some controls that can be added.

(“Screenshot from author”)

To attach controls to source code the developer can open the assistance editor and drag

the control to the code as seen in Figure 27 [134]. The developer can also drag the control

to an already existing method as long as the return type is an IBAction. A Study of Modern Mobile Tablets - 50

Figure 27 An example of a control being attached to the code using the assistance

editor on the right and storyboard editor on the left.

The result of hooking the control to the code is an empty method that can be filled with

whatever the developer wishes. Images, effects, 3D models, and data should all be placed

in the Assets folder so they can be accessed in the storyboard editor. The Asset folder is

also used to create sets of icon that will act as the application image for each of the target

devices or operating systems. It is relatively simple to test and side load applications

using Xcode. A developer can test an application using the Xcode simulator which allows

a developer to simulate their project on a few supported devices. The Xcode 7 device

simulators are shown in Figure 28 they include iPad, iPhone, and Apple TV systems.

A Study of Modern Mobile Tablets - 51

Figure 28 An image of the simulators available in Xcode 7.3 devices shows the Mac

being used. (“Screenshot from author”)

To facilitate side loading an application on a device the developer requires a team be

assigned within the Xcode project page as seen in Figure 29. To side load an application

three things must be present. First a device must be connected to the Mac being used for

development. Secondly the developer must have an Account that is

validated and connected to the current project. Lastly the device must be provisioned for

development. In general these three steps are accomplished using Xcode [135]. When a

new project is created the general settings in the project page must be modified. The team

dropdown by default does not contain any users. The developer must sign into their

Apple ID account for it to be added to the team list. The developer then selects the

appropriate team and can attach a device such as the iPad. Once the iPad is attached a

message will appear asking if the computer is a trusted device. If the developer agrees

that it is a trusted device it will appear under devices as seen in Figure 28. When the

developer goes to test their application while the device is attached the program will be

pushed to the connected system. The application will then be built, installed, and started

on the device. While the device is connected any errors will be output to the debug

section as seen in Figure 25. The project page can also be used to set the desired target

system, application capabilities, resource tags, build settings, and info.plist. A Study of Modern Mobile Tablets - 52

Figure 29 The project settings page which allows the developer to set important

details like the developer account, operating system version, and target

devices. (“Screenshot from author”)

Most of the information in the general tab is setup when the developer creates the initial

project. The information is filled out based on a few different message dialogs presented

to the developer [136]. The general page can be modified to change the initial decisions

made at project creation. The capabilities tab is used to add different Apple technologies

to the device so they can be used in development. An example of some of the

technologies can be seen in Figure 30 [136]. The capabilities available for a project are

determined by the target operating system IOS, OSX, WatchOS, and tvOS applications

have different choices. A Study of Modern Mobile Tablets - 53

Figure 30 The capabilities tab in the project page showing different Apple

technologies that can be merged into an IOS application.

The capabilities offered are similar to interfaces, drivers, or plugins they provide an easy

way to integrate additional functionality. For example the tvOS operating system contains

a game controller capability which provides controls and actions that can be triggered by

a controller. When capabilities are added Xcode automatically imports the required

framework and adds it to the projects. The frameworks and dependencies are added to the

entitlements and info.plist [137]. The resource tag tab is used to provide on-demand

content for applications when requested. Resource tags allow a program to host files

online and download them when required instead of bundling them with the application

[136]. The benefits include smaller app sizes, lazy loading, remote storage of rarely used

items and in-app purchases [138]. Resource tags can be stored locally however if too A Study of Modern Mobile Tablets - 54

many tags exist on the device then the system will start removing tags with low priorities

[139]. Priorities can be set when a tag is created in-app purchases often have higher priorities then other content. Tags must have varying levels of priority if every tag has the same priority the system will remove one at random [139]. The build settings, phase, and rules tab are almost never modified directly by the developer. These settings are modified by Xcode when a developer selects a specific target platform [136]. The last section to examine is the info tab which directly corresponds with the info.plist file created with any default project. The info.plist is used by the application to indicate the icons, entry storyboard, device orientations, localization, and device capabilities as seen in Figure 31

[136]. Xcode is a very easy to learn integrated development environment with almost everything required built in. There is almost no reason that a developer would need to use another program to design or implement an application targeting IOS, OSX, WatchOS, or tvOS. Once a developer has learned how to use Xcode it would be very easy to implement an application for any of the operating systems.

A Study of Modern Mobile Tablets - 55

Figure 31 The info tab for a demo application created by Apple showing what is

contained in the info.plist file.

One small issue however is that to really utilize Xcode a developer must keep their

system updated. It is harder to create an application for example using Xcode 4, because

it does not support the most current operating systems. Xcode does have a slight learning

curve but is very intuitive. Storyboards are an excellent way to show how an application

flows and how views are connected. Side loading an application is much more convenient

when compared to alternatives like android and windows. The programmer must simply

setup their development team and attach a physical device. Once attached the developer A Study of Modern Mobile Tablets - 56

can select start and the application will be loaded and run on the device. If any errors are

encountered Xcode can offer solutions or attempt to fix them so testing can begin.

3.4.2. Microsoft

Developing applications for the Surface requires that the developer has access to a

computer running Windows 8. Microsoft uses their popular Visual Studio integrated

development environment. The most current version supported is Visual Studio

2015 which allows developers to create Windows 8.1, Windows 10, and Windows

Phone 8 applications [140]. To develop Windows Store apps, Universal apps, or

Windows Phone apps Visual Studio’s must be installed on a machine running

Windows 8 or higher. Visual Studio 2012 is the lowest version available that can be

used to create Windows Store and Windows Phone applications [141]. Visual

Studio 2012 is broken into six sections that are shown in Figure 32.

Figure 32 Visual Studio’s 2012 development environment.

(“Screenshot from author”) A Study of Modern Mobile Tablets - 57

The editor area changes based on the type of file being manipulated. Visual Studio

uses an Extensible Application Markup Language (XAML) which is pronounced

zammel [142]. XAML is a markup language developed by Microsoft to represent

the visual style of Windows applications [142]. When a developer opens a XAML

file the editor area changes to become the design editor which is depicted in Figure

33.

Figure 33 Visual Studio 2012 editing a XAML file on the left is a toolbox that can

be used to add controls into the design area. Underneath the design area is

the XAML code generated by adding controls. (“Screenshot from author”)

To access controls added into the designer each control must be given a name in the

properties area. Once a name is given it can be directly referenced in whatever

language was chosen such as C-Sharp, C++, or JavaScript. When writing code the A Study of Modern Mobile Tablets - 58

names of controls are added to the intellisense system. The properties area is also

used to specify action listener for interactable controls as seen in Figure 34. The

developer can choose to use the properties editor or write the XAML code by hand.

The properties that were set in Figure 34 include a name, and event handler the

corresponding XAML code is in Figure 35.

Figure 34 What the properties area looks like when a button is created using the designer.

The left picture represents the properties of the control while the right picture

represents the event handlers available. (“Screenshot from author”)