Syncing Mobile Applications with Cloud Storage Services

Cloud data storage is an option available almost on any mobile platform. Nowadays, there are multiple solutions for syncing data in mobile applications. The aim of the paper is to analyze mobile application developers’ possibilities for syncing content using major free cloud storage providers. The paper describes the cloud computing in mobile context and highlights cloud providers APIs. Experimental results are analyzed in order to identify the best cloud storage solution for syncing mobile applications, depending on the operating system on which they are implemented.


Introduction
We are living in the era of agile and always-available data storage [1], where it is very important to have instant and permanently access to the data, personal and private, with which we are operating at work or at home.The development of mobile technologies and the spectacular growth of mobile devices users created this opportunity to quickly read our emails, to view our documents from shared folders, to access all the data saved in the cloud directly from the personal smart-phone or tablet.The mobile devices that we are taking with us every day represents mobile clients for our cloud storage subscriptions that we have to main providers, such as Dropbox, SkyDrive, Google Drive, Box, and so on.It is very important to have the same or a similar user experience on each mobile device, independently by the operating system.The choice of a certain cloud storage provider (CSP) depends on the facilities provided, the user experience and the storage amount space that he offers.Some mobile operators provides also cloud storage solutions, such as Orange Cloud, which allow to store your digital content, secure in the cloud, available anytime and anywhere [8]. Figure 1 presents the storage and backup settings for iCloud solution, which is integrated in every iOS operating system.Apple provides by default a 5 GB free storage plan for every iOS user.

Cloud Computing in Mobile Context
Because many hardware and software manufacturers have invested a lot in cloud computing solutions, the evolution of public and private cloud has increased in terms of users, security, infrastructure and data storage, [14].In few years we will assist at the moment when a user will go at work or at home with the same tablet that will be docked in a keyboard and will access all the data from the cloud.The desktop computers will disappear slowly and will be replaced with simple monitors or mobile tablets that will use the desktop virtualization technology.When data storage in the cloud will be cheaper, companies will replace all the hardware equipment with these simple monitors in order to use platform as a service (PaaS), software as a service (SaaS), storage as a service (STaaS), security as a service (SECaaS), data as a service (DaaS), database as a service (DBaaS) or test environment as a service (TEaaS) [2]. Figure 2 below presents the cloud computing architecture integrating all related cloud solutions.

Fig. 2. Cloud services
In [1] is presented a set of challenging storage issues for researchers and engineers.
One of these problems is how the storage infrastructure is ensured to be scalable, efficient, and reliable, without any access disruptions, even for upgrades and maintenance periods.It is very important to have all our data available on the personal smart-phone, but it is crucial to ensure their security and their integrity.Imagine the situation when a user lost the smart-phone or someone stole it.If that device was connected to all the shared folders available in the cloud, the user can say goodbye to his privacy and maybe to his career.Taking these hypotheses into consideration, it is obviously that we must ensure high data security and integrity to all data that can be accessed from different devices connected in the cloud.DOI: 10.12948/issn14531305/17.2.2013.08 Hardware and software producers for mobile devices have implemented intelligent solutions to solve these issues, such as:  the "Find my phone" facility, which allows to localize a lost or stolen smartphone on the map;  the password to access the smart-phone when unlocking the screen;  the backup facilities of personal data in the cloud; if we consider Apple, they have the iCloud solution, if we speak about Android devices, Google allows to store all the personal data, and also the Windows Phone devices allows to back up the data in Microsoft cloud solutions (SkyDrive).Figure 3 presents the "Find My Phone" tool accessed from Windows Phone user webpage.

Fig. 3. The "Find My Phone" tool accessed from Windows Phone
In both cases, iOS and Windows Phone, a user can locate his device on the map and can send different commands to lock it or to erase all the data stored on it.An important disadvantage of mobile devices is related to their portability that can represent a vulnerability when the user loses the mobile device.It is very important to ensure data security on each mobile solution that can represent an entry point for the entire data storage account of a user that save his data to the cloud.Figure 5 presents the user interface of Google Drive mobile application installed on an iPhone device.The user can acces his files and documents by categories and also he can save them offline to reduce data traffic and access them even when he does not have an internet data connection.

Fig. 4. Google Drive interface on iOS
The cloud serves not only for data storage, but also for testing an application on multiple devices.There are many services that enable developers to test their desktop or mobile applications on multiple real devices through a web interface [4].

Comparative Analysis of Cloud Storage
Beginning with the 1997 Dropbox start-up, [19], new storage cloud services [16] have been made available for both business and public users.These services are offered by independent providers for whom this is the main business or by large companies that are adding this new service to their portfolio, like Apple, Amazon, Microsoft and others.As a business model, cloud storage has proved a growing success [15], Figure  A comparative analysis of cloud storage services must take into consideration a set of measurable criteria [21].For this research we considered that in terms of syncing efficiency, the next criteria are considered important for the comparison:  availability as the number of different mobile platforms that have a native or independent client sued to access the storage.The iCloud is an IOS native application and it allows only Apple mobile clients to access the cloud. content type diversity as the number of file types allowed to be stored in the cloud.For example the Amazon Cloud Drive mobile client allows only the upload of photos or music files. ease of use in terms of provided functionalities; these allows users to manage their content by syncing multiple local folders, collaborating with other users, tracking and recovering file versions;  security functions used by users to password protect files, encrypt files, private and public share of files;  [21] done on cloud media usage has highlighted a significant link between media providers that offer also integrated cloud storage, Figure 6.
Fig. 6.Market share of cloud storage providers for media content.Source [22] In this case the media provider integrates in the primary service a secondary cloud storage service and thus having for this segment a greater market share.Taking into account criteria defined for this research, the same cloud storage provider, Apple with its iCloud, doesn't qualify as it doesn't provide a cross platform public API.From a business perspective, Nasuni [17] has conducted a cloud storage survey based on:  functionality;  price;  performance based on a high level of writes, reads and deletes operations for files that varies in size from 1 KB to 1GB, on data availability and also scalability.The survey has testes the service provided by five CSPs: Amazon S3, Microsoft Azure Blob Storage, Google Cloud Storage, HP Cloud Object Storage, and Rackspace Cloud Files.Fig. 7. Gartner public CSP's rating based on six criteria.Source [12] A market research done by Gartner, [12], has taken into account CSPs that:  offer APIs for data access and protocols that include Internet APIs, such as REST;  offer transparent on-demand accessibility and scalability;  offer definable data security, reliability and availability as part of an SLA;  offer pay-as-you-go pricing for capacity and data transfer at a granular level;  have an established market presence.They rated ten public CSPs, figure 7, by measuring measured six critical criteria:  accessibility as the ease of accessing the service and its performance;  manageability;  pricing;  availability and fault tolerance;  security;  value-added services.on four different use cases:  primary storage;  backup;  archive;  content distribution.

Case Study: Cloud Storage APIs Usage in Android Applications
The purpose of this case study is to implement a native application that uses the API provided by several cloud services.The mobile application targeted the Android platform because of its important coverage.APIs were used from the following cloud services: Dropbox, Google Drive and Box.The application focuses on the following basic services:  authentication and authorization;  file upload;  file download.File versioning and revisions are discussed in context.The file content is taken from an input box, stored in a file, and then uploaded.When downloading files, the remote file content is stored in a local file and then it is stored in a widget.This is a simple usage scenario for such type of dynamically storing data in a cloud.Each cloud provider requires developers to have an account on their Web site.All native classes, for all tested cloud services, use REST API.The authorization is based on OAuth 1.0 standard or OAuth 2.0 framework.For Android, the APIs include activities for simple tasks like authorization and authentication, folder and file selection etc.

Dropbox API
In order to use the API, the developer is required to register an application that will receive a unique key.The key is used for all API access.There are three types of APIs that can be used in applications [9] The dropboxApi member will be used to access all the provided methods for file management.AndroidAuthenticationSession class is used to store records on currently logged user and provides methods for authentication using a dedicated Android activity or a web page.DOI: 10.12948/issn14531305/17.2.2013.08 The method startAuthentication() will begin the authentication and authorization process by providing screens for sign in and for application authorization.The user interface depends on the existence of the Dropbox client.The Dropbox client application for Android is not required to be installed on the mobile device.
If the client application is not installed on the device, the user will be redirected to a Web page were the user can authenticate using the email address and the password.Figure 8 (left) presents the Sign in page and the acceptance page for the application to access the account (right).

Fig. 8. Dropbox's client authentication window in a Web page
If on the mobile device is installed the Dropbox client, the authentication and acceptance are controlled using native Android activities.In this example, the client was previously authenticated by the Dropbox client application so the sign in activity is not displayed.The application authorization activity is displayed as in Figure 9.The results of user interaction are controlled by authenticationSuccessful() method, that returns true or false, depending on several actions, such as user's selection, correct inputs, network availability, etc.The tokens resulted after authorization are stored by calling finishAuthentication() method.The above methods are available from the AndroidAuthenticationSession class and will be called within onResume() or onActivityResults() callbacks from current Activity class.After the user authorizes the application to access the Dropbox account, all the file operation options can be used by it.The application uses classes that extend AsyncTask for file handling operations.This is required because these operations are made over a network and these requests have to be implemented in a separate thread [7].The parameters required by the background task are encoded in the params variable.
Listing 2 presents the operations used to store a file on the cloud.
In this example, the putFile() method takes as non-null parameters the remote file name, the input stream associated to the local file and the content length (in bytes).The remote file is updated to the newest version.The method getFile() receives the remote file name and the output stream associated to the local file were the remote file content will be written.

Google Drive API
Google Drive SDK allows application integration in browser, access to files, folder and other features of Google Drive from user applications [11].
In order to access these services the developer has to enable the APIs on the Google APIs Console, Figure 10.Drive API and Drive SDK services has to be turned on.
In order to use the API for Google Drive, the Android project requires the installation and use of Drive API and Google Play services.The access to Files collection is made using files() method.Files collection includes methods to copy, delete, get and insert files.The File class (used in Listing 5 and 6) is defined in com.google.api.services.drive.modelpackage and includes file information (metadata) like name (title), creation date, MIME type etc. Listing 5 represents the sequence used to upload a file using Google Drive.The file metadata are initialized using com.google.api.services.drive.model.File class, and the file content is initialized using java.io.File class.After the initialization, the file is added to Files collection using execute() method, which is applied on an Insert object created by insert() method of the Files class.If the resulting File is not null, the operation was successfully.

Table 1
below presents a comparative analysis of cloud storage solutions on different operating systems.

Table 1 ,
the Dropbox solution is not implemented as a native application on Windows Phone platform.Third-party developers created a Dropbox client application that can run on Windows Phone operating system.Analysis of specific target users groups can describe other usage patterns.A Strategy Analytics Report