Developing an M-Learning Application for iOS

The mobile market development has a high impact on all domains including education. Smart mobile devices started to be affordable and the massive use on educational processes does not seem to be too far. Mobile learning applications are be targeted for all major mobile operating systems as native applications or Web-based. The objective of this paper is to present the implementation of the evaluation module for an m-learning application developed for iOS devices. The m-learning application is targeted to a higher education institution. The application uses Web services in order to obtain the content and to authenticate the users.


Introduction
Mobile learning represents a research topic for many academics and practitioners.Around the world there are several projects ongoing or finalized that aim the development of mobile learning applications for different mobile platforms or Web based applications optimized for mobile devices, like [1], [2], [3] and [4] Mobile learning applications could include modules for:  Content presentation (lessons); content include text, video, audio, graphics; it could as simple as displaying only text or loading PDF or other files or very complex, using multimedia components [5];  Short assessments (quizzes); these are available to students in order to test their knowledge; the user can take these tests whenever they want and they are not time-restricted;  Final assessments (tests); these tests are given at a specific date and time and they have a limited duration;  Trainer-student communication; this involves the use of well known components (e-mail or social networks) or by using a dedicated component based on a specific protocol. Content sharing (e-mail, social networks, cloud etc.); this will allow users to share the content or results with other registered users or anyone (if the application allows it);  Homework and assignments; the students could load a file or fill some data fields according to requirements.Each developer chooses to include one or more modules in their applications.The applications could be developed as standalone applications (all content is stored on the device), distributed applications (a native client and the server that provides learning contents) and Web-based applications (the client is a simple mobile Web browser [6]).It is important to design the application taking into account several quality characteristics based on the users requirements and behavior [8].For connected mobile learning applications the client communicates with the server using standardized protocols (like HTTP) or dedicated protocols.Also, the connected applications can synchronize the mobile device with the server.In this field, were developed several prototypes of mobile learning applications in a framework of a research project.In this respect, it was developed a SOAP-based Web service that provides methods for students' assessment.The most recent work includes the implementation of a mobile learning application for Android devices.The results were presented in [4].As for the previous project, the main purpose 1 DOI: 10.12948/issn14531305/17.4.2013.07 is to keep the user interface as simple as possible and to focus on the basic functionalities.Further versions need more focus on the graphical interface and the user interaction (like using gestures etc.).The use of Web services has the advantage that:  client applications could be of any type (mobile, desktop);  the client application could be developed using almost any existing language or technology;  the client application can be targeted on almost any existing platform or operating system; The Web service includes methods for students' assessment.Each student could login and select a test for one topic.The topic is related mobile applications development.Figure 1 depicts the interaction between the mobile device and the Web service, highlighting some of the Web service's methods.

Fig. 1. Assessment module interaction using Web services
The Web service could be easily extended to support other functionalities by implementing new methods.The paper presents the main results obtained during the implementation of a mobile learning application for iOS devices, using the same Web service.The application implements a multiple-choice test.The paper is organized as follows: The section entitled iOS Applications Development presents the main characteristics of the iOS operating system and the particularities of the iOS applications development.
Web Services Access deals with the main frameworks used to consume Web services from iOS applications.The Mobile Learning Application section presents the mobile learning application developed for iOS.The paper ends with conclusions and future work.

iOS Applications Development
iOS is the operating system developed by Apple for their mobile devices in 2007.The core operating system is similar to OS X that is based on Unix.The operating system supports processors with ARM architecture.Currently iOS is the second most popular platform after Android, counting over 12 percent in the third quarter of 2013 [8]. Figure 2 depicts the main layers of the iOS platform: Core OS, Core Services, Media and Cocoa Touch.The Core OS include the kernel (based on UNIX Mach kernel), drivers, libraries and system utilities.Core Services layer provides support for file management, threading, networking, memory management and other basic services.Media layer includes support for printing and graphics (OpenGL, QuickTime etc.).Cocoa Touch is a subset of Cocoa API for Mac OS X.It handles the user interaction and GUI.Cocoa Touch includes the UIKit framework, Foundation framework and other frameworks that provide access to system resources like contacts, GPS, camera etc. [9].On top are user and system/preinstalled applications.iOS native applications development involves the use of Xcode IDE and Objective C as the main programming language.Objective C is an extension of the C programming language that allows the use of classes and objects.Objective C classes are declared within an @interface block.Messages (methods) implementation is inside @implementation section.For class forward declaration @class keyword is used.As a practice, class declarations are stored in header files (.h) and class implementation in source files (.m).Instance variables are declared in @interface section, between the curly braces.Methods (also called messages) names include the parameters' labels separated by colons.Method calls are different from C/C++ or Java method calls.For example, the class Test declares the method: setRaspunsuriPentruIntrebare:cuVarianta in this way: @interface Test : NSObject //... -(void) setRaspunsPentruIntrebare: (int)idIntrebare cuVarianta : (int)varianta;

@end
The minus sign (-) in front of a method shows that is an instance methods.The plus sign (+) in front of a methods is used for class methods (static methods).The method is called using square brackets like in this example: Methods cannot be overloaded and parameter labels differentiate them.All class-type objects have to be allocated dynamically.Object creation involves the use of two methods: alloc (for memory allocation and default instance member initialization) and init (for specific member initialization, even for superclass members).
In order to access data members, property could be added to classes.Properties are declared with @property keyword and, in order to internally generate setters and getters, @synthesize keyword is used in implementation block with the association between the property and the corresponding data member.Cocoa classes are derived from NSObject class.iOS applications are based on Model-View-Controller design pattern [10], [11], Figure 3.The scenes are connected by segues.Figure 4 depicts the scenes designed in Xcode for the mobile learning application.

Fig. 4. Mobile learning application scenes within the storyboard file
In order to test and iOS application on a real device the developers has to register to Apple to iOS Developer Program [12].A regular registration requires an annual fee.The mobile learning application was developed using Xcode 5 with iOS 7 SDK on OS X Mavericks.The application was tested using the iOS Simulator for an iPhone Retina (4-inch).The current version does not make use of sensors or camera and, for this stage, the simulator is sufficient.

Web Services Access
Web services could be implemented using SOAP and WSDL protocols or using REST architectural style.REST services requires the use of URLs and, if HTTP is used, HTTP commands (GET, POST, DELETE etc.).For the current application, the Web service is based on SOAP and WSDL and it is implemented using .NET technologies.The Web service includes methods for obtaining the number of tests, for obtaining the number of questions for a test and for obtaining a specific question based on its number and the test number etc.The Web service is provided with login possibilities for its users. developers own implementation of libraries, classes or methods for Web service communication using standard networking classes like NSURLRequest and NSURLConnection;  third-party tools for proxy generation using Web services URL, based on WSDL, like wsdl2objc [13] and SudzC [14].The proposed solution uses a SOAP based Web service and for current implementation the wsdl2objc was used.Based on the Web service address, using WSDL, the tool generated all client files required to access the Web service.The name of the Web service is Service1 and the tool will generate several files:  some files required for network access and result processing  two files associated to the Web service: a header file (Service1.h)and an implementation file (Service1.m).Table 1 presents several classes generated by the wsdl2objc tool from the Web service and theirs role.As it can be seen, for each method of the Web service are generated two classes: one for method call and one for method's result.The method provided in Listing 1 is called with the user id parameter:

nrTeste = [AccessSW getNumarTeste: uid];
AccessSW is the class that implements the methods for Web service access.The Web service calls are made asynchronous in order to allow a continuous interaction with the user interface, even for time-consuming transactions.
Compared with the same implementation for Android platform, that uses kSOAP, wsdl2objc tool generates all the required classes to use the Web service.This includes the classes for complex results like questions and their possible answers.The prototype of the application for Android required the implementation of these complex classes in order to process the responses correctly.

The Mobile Learning Application
The application connects to a Web service in order to obtain the questions and the variants of responses.The request and responses are made using plain XML content.The application start screen is presented in Figure 5.The available tests are displayed like a list in a table control (from UITableView class) and the user can choose any test from the list.The associated controller is derived from UITableViewController and implements the UITableViewDataSource (for data source) and UITableViewDelegate (for handle user interaction) protocols that are required when working with tables.UITableViewDataSource protocol requires implementation of at least two methods called when it needs to display table's data.The methods provide information about the number of section, the number of rows within a section, header and footer titles etc. UITableViewDelegate controls the way the cells are displayed (cell height, custom header and footer) and the user actions (click in cell, cell content editing etc.).The tests presented in Figure 5 are available for one topic (mobile applications development), but future versions of the application will be extended for more topics.

Fig. 5. Initial application screen
The table has one section and the number of rows is taken from the number of tests available for the current topic in database.These values are returned by the two methods of data sources protocol used for these controls: numberOfSectionsInTableView and numberOfRowsInSection.The method cellForRowAtIndexPath, provided by the same protocol, will initialize the label of each row with test name.The current implementation contains four tests identified by corresponding numbers and the label are initialized accordingly.The list is initialized on viewDidLoad message.In order to assure that all data coming from the server will be available before the list is displayed, Web service methods calls are made using blocks as can be seen from the code excerpt in Listing 2. This will send the reloadData message to the table so the user will see all required items within the list.The link between the cells and the next screen is created in Interface Builder and the transition is made without writing any line of code.After the user selects a test, the next screen will display the first question from selected test.The navigation between the screens is implemented in a standard way using the UINavigationController.This is the containing controller for the TesteViewController.The questions screen is presented in Figure 6.The possible answers are displayed in a control derived from UITableView class.The selected answer is highlighted by setting the cell's property accessoryType to UITableViewCellAccessoryCheckMark.
A check mark is shown on the selected answer, as it can be seen from Figure 6.The toolbar buttons controls the navigation between the questions.There are three buttons:  Precedenta -goes to the previous question from the current test;  Urmatoarea -goes to the next question;  Gata -ends the test and display the given answers.The navigation between questions could be implemented using gestures like swipe.This could from left to right (for the previous question) and from right to left (for the next question).To return to the test list a back button is provided by the standard navigation controller.The number of current question and the total number of questions are displayed on the view's title.The selected answers are stored in a dedicated array in order to be checked against the correct ones.The answer could be sent to server at the end of the test or after each response of the candidate.The first option will send only the final responses to the server.There is only one request to the server related to candidate's answer.
The last option has the advantage of keeping the responses updated, but has to deals with user changes and requires frequent network access.The responses are stored in a persistent data structure in order to assure that data will be recoverable in case that application crashes or other unexpected situation occurs.all the answers will be displayed on the screen, Figure 7. Possible future actions will be to allow the users to save the answers and to send the answers by e-mail or to share them using social networks.This requires additional buttons that can be added on a redesigned toolbar and/or on navigation toolbar in a standardized way.

Fig. 7. The selected responses screen
The application does not provide user with the correct answers, this feature is available only for quizzes.The user will find the final mark and will get only a statistic about his or her answers (number of correct answers, number of unanswered questions, number of incorrect answers, percentage of answers per each topic/subtopic etc.).

Conclusion and Future Work
Compared with de development of the similar application for Android devices, the first conclusion is that also there is no direct support for Web services client and third party tools have to be used.Next application developments will focus in design improvement.Also, the application will be integrated with the components that provide educational content to the students.Also, the implemented Web services will be extended to support JSON and/or XML responses that are very popular and can be easily processed.Another important objective is to optimize the amount of data sent between the client and server.All questions and possible answers can be transferred in one transaction, this having impact on duration but resulting in a smaller overhead.Also, data can be compressed by the server and decompressed on the device.This will increase the duration on some method calls.
An online development course that teaches you how to build iPhone applications using Objective-C.A learn by doing course.Created by.Mark Petherbridge.Â At the end of each section I would also like to develop an online quiz were the learner can type code directly into the browser and is able to recap and thus better retain the information taught in the course.Why am I building this?Three years ago I started iOS-Blog ( http://bit.ly/1hnkkRz ) with the hope of helping the iPhone application development community.At the time I was bewildered by Objective-C, desperately wanting to learn but finding it hard to find informative, concise and valid information to learn from.

Fig. 3 .
Fig. 3. Model-View-Controller design patternThe model refers to data and data management.Here is the business logic of the applications.For the mobile learning application a representative class of the model is Test class.It manages the current test, knows the current question and controls the navigation between the questions of the current test.The view deals with the user interface and user interaction.The mobile learning For iOS there are several approaches to consume Web services:  third-party, open source implementations for consuming Web services like RESTKit and Spaghetti or advanced networking frameworks like AFNetworking;

Fig. 6 .
Fig. 6.Example of a questionAfter the candidate chooses to finish the test,