Cloud-Based Java Compiler For Smart Devices

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

A Cloud-based Java Compiler for Smart Devices

Tanko Y. Mohammed Mohammed Hamada


Department of Computer Science Department of Computer Science and Software Engineering
African University of Science and Technology University of Aizu
Abuja, Nigeria. Aizu, Japan.
[email protected] [email protected]

Abstract: The Java programming language is widely used in and the text to be translated is called source text (or sometimes
industry and business. Therefore, academic institutions source code) [5].
worldwide include Java learning as a basic part of their Cloud computing refers to flexible self-service, network-
Computer Science and Engineering curricula. At the same time, accessible computing resource pools that can be allocated to
smart devices have become popular among university learners.
meet demand. Services are flexible because the resources and
This research tries to take advantage of this fact to promote Java
learning. The main problem is that we cannot compile Java processing power available to each can be adjusted on the fly
programs on smart devices due to the technical limitations of to meet changes in need or based on configuration settings in
such devices. This research aims to leverage cloud computing, the an administrative interface, without the need for direct IT
availability, prevalence and affordability of smart devices and the personnel involvement [6].
ever-growing market of Android devices to provide users with Having identified the important role learning technology
text editors to create and modify Java programs and save them to plays in education in the 21st century coupled with the relative
a server. Users can also compile and execute created programs. A affordability and affordability of internet enabled smart
web-based version of the application is also provided for users devices, it has become imperative to develop a Smart
who do not use Android devices that can be accessed via a
Multimedia Learning System for Java programming language
browser on a PC or Smart device. The system uses an existing
online compiler. The developed cloud-based compiler can be which comprises of Lecture Slides module, Reading Topics
integrated into a smart multimedia learning system for learning module, Flash Cards module, Video Lectures module, and an
the Java programming language. Integrated Development Environment module for learning,
Keywords – Learning Technologies, Mobile Learning, Cloud compiling and running Java programs on learners smart
Computing, Cloud Compiler, Java programming, Multimedia devices.
System This research focuses on the development of a cloud based
compiler (IDE) for Smart devices to compile and run Java
I. INTRODUCTION programs on learners‟ smart devices which would be
Technology plays a very important role in 21 st century incorporated into the Smart Multimedia Learning System for
education. Technology has revolutionized the way we think, Java programming language along with other components in
work, and play. Technology, when integrated into the the future.
curriculum, revolutionizes the learning process. The II. SYSTEM DESCRIPTION
availability, prevalence and affordability of Mobile phones,
The system developed will have a built in editor where a
tablets and other connected devices have been on the increase
user can edit his created java programs. A cloud-based server
over the last two decades. With this, wireless technology can
is to be developed and deployed as Software-as-a-Service
dramatically improve learning and bring digital content to
(SaaS) to host the compiler that compiles and executes user
students. Mobile learning encompasses the usage of portable
codes. For this research, an existing online compiler (Sphere
computing devices (such as iPads, laptops, tablet Personal
Engine [7]) will be used. The system will be developed for the
Computers, Personal Digital Assistants, and smart phones)
android operating system, with a web-based user interface that
with wireless networks to enable mobility, mobile learning,
can be accessed via a browser on a PC or any device not
allowing teaching and learning to extend to spaces beyond the
running on the android operating system.
traditional classroom [4].
Computer programs are formulated in a programming A. Compiler
language and specify classes of computing processes. Compilers are used to compile programs and convert them
Computers, however, interpret sequences of particular from written program to executable binaries. In other words, a
instructions, but not program texts. Therefore, the program compiler is a program that reads a program written in one
text must be translated into a suitable instruction sequence language and translates it into another language. The compiler
before it can be processed by a computer. This translation can creates executable files which can then be „run‟ in order to
be automated, which implies that it can be formulated as a execute the program and its instructions. Every compiler
program itself. The translation program is called a compiler, primarily consists of three parts namely;

978-1-5090-0778-3/16/$31.00 ©2016 IEEE


The Front end: This checks the semantics and syntax of the touchscreen mobile devices such as smartphones and tablets.
higher level code (written by the user). Other functions like The android OS is open-source and was introduced in
type checking and error reporting are also performed by the September 2008 by Google and Open Handset Alliance
frontend. (OHA).
The Middle end: This performs the optimization through The layers of Android Operating System consists of,
removal or useless code, relocation of computation depending Application Framework, ART (Android Run Time), Libraries,
on the context. DVM (Dalvik Virtual Machine), and Linux Kernel as the base.
The Back end: This is the part where the translation of the Google provides Android SDK for developers for developing
language actually takes place. applications for Android easily. It is the most widely used
mobile operating system with more than 80% of the world‟s
mobile operating system being Android. The Android
operating system provides users and developers with a
complete suite of software for mobile devices such as an
Operating system, middleware and key mobile applications
[3]. The most recent Android version is Android 6.0, also
known as Android Marshmallow.

Fig. 1. Compiler Architecture

B. Services provide by Cloud Computing


Based upon the services offered, clouds are classified in the
following ways:
Infrastructure as a service (IaaS) involves offering hardware
related services using the principles of cloud computing.
These could include some kind of storage services (database
or disk storage) or virtual servers.

Platform as a Service (PaaS) involves offering a


development platform on the cloud. Platforms provided by
Fig. 3. Layers of the Android OS
different vendors are typically not compatible.

Software as a service (SaaS) includes a complete software III. SPHERE ENGINE


offering on the cloud. Users can access a software application
Sphere engine is an Online Compiler that offers a clean
hosted by the cloud vendor on pay-per-use basis. This is a
and efficient way to compile and run source code of a
well-established sector.
programming language within an application. Sphere Engine
executes codes on remote servers with the aid of a simple
easy-to-use API. It has support for over sixty programming
languages and libraries [7]. Sphere Engine Compilers API
allows you to:
1. Upload a source code;
2. Run the program with input data on server side in
more than 60 programming languages;
3. And finally download results of the execution
(output, standard error, compilation information,
execution time, memory usage, etc.).
Fig. 2. Cloud services The Sphere Engine compiler Application Programming
Interface (API) uses Representational State Transfer (REST)
architecture.
C. Android Operating system
The android is operating system (OS) is a layered operating The sphere engine online compiler was used as the cloud-
system based on Linux kernel primarily designed for based server for compiling java programs for the system.
IV. FUNCTIONALITIES OF THE SYSTEM
The system developed allows a registered user with an
internet enabled device logged in to do following:
1. CREATE FOLDERS AND FILES: A user can
create as many folders and files as he so desires. The
system automatically renames a file folder if a file or
folder with the same name already exists in the same
directory. The created files and folders are stored on
the server for future use by the user.
2. MODIFY FOLDERS AND FILES: A user can
modify files and folders accordingly. The system
allows a user to rename a folder and file while
maintaining the uniqueness of the names of the files
and folders in any directory. A user can also delete
any folder or file as he so desires.
3. LOAD FILES INTO EDITOR: This feature allows
the user to open files in the editor to enable him to
edit the content and also to run or compile.
4. EDIT AND SAVE FILE CONTENT: A user can
open one or more files in the editor. He can edit the
contents of files and save and changes made.
5. COMPILE: This option allows the user to compile a
program (file) currently open in the editor. The
resulting compilation information is returned to the
user.
6. RUN/EXECUTE: This is a function which when
used returns the output of a program (if any)
currently open in the editor. If the program contains
Fig. 4. Architecture of the System
error(s), they are displayed to the user.

VI. LEVEL 1 DATAFLOW DIAGRAM


V. SYSTEM ARCHITECTURE
The system operates server/client architecture. The client
requests for services from the server which forwards the
request to the cloud sphere engine API. The response is
returned to the server which interprets it and sends the
appropriate result back to the client. The figure below
describes the architecture of the system.

Fig. 5. Dataflow diagram of the system


The dataflow diagram shows the how users access the EditArea is a free javascript editor for source code. (That is
system from either the android application or from the web- no way a WYSIWYG editor). This editor is designed to edit
based UI. The interaction from with cloud compiler and the source code files in a textarea. The main goal is to allow text
database for storage are shown. formatting, search and replace and real-time syntax highlight
(for not too heavy text). This editor is free and freely
VII. SYSTEM REQUIREMENTS distributable. Some features of the EditArea include easy to
integrate with only one script include and one function call,
A. Functional Requirements
Tabulation support (allow to write well formatted source
Development of the android and web application code), Customizable real-time syntax highlighting, Word-wrap
The system requires an android device or a web browser support, Search and replace (with regular expression), Auto-
on a PC and non-android devices, a web server to host the indenting new lines, Line numeration, Multilanguage support
server side program that interfaces between the user device and many others [9].
and the cloud server and finally a cloud server for does the The EditArea was used as the text editor for the system.
main processing. The user writes and edits the java programs The system is made up of the following components.
on his device and send to the server. The server forwards the LOGIN AREA: A user wishing to use the system logs into it
request to the cloud server which does the processing and using his login credentials via this area.
returns the response to the web server which interprets the REGISTRATION AREA: A user is required to first register
result and sends to the user for display on his device. before he can access services rendered by this system. This
Development of the server registration process can be done via this component.
COMPILE AREA: This is the actual area where a user
The server is created for interfacing between the user and
creates, edits, compiles and executes his codes.
the cloud server. The server requests the cloud server to
execute user‟s codes and interprets the returned response and A. Android Implementation
sends the result to the user. The server also handles storage of The android interface was developed using Android SDK
user‟s codes, compilation and execution information. tools provided by Google (the developers of android). A
B. Other Requirements minimum SDK version of 16 (for android operating system
Jellybeans) was set. As at the time of implementation, the
User interface requirements
latest version of the android operating system available was
Two user interfaces were developed. One for the android
lollipop with SDK version 23, hence the target SDK version
devices developed using the android SDK with minimum API
was set to 23.
level 16 and the other was developed for the web users
accessing the system via a browser with HTML, CSS and
JQUERY.
Communication requirement
A user is required to have access to the internet via Wi-Fi
networks, LAN networks or any other network to use the
system.
Database requirement
The database system used is MySQL. PHP‟s strong
integration with MySQL makes it very much desirable for this
system. It is very impressive how easily the two can work
together.
VIII.IMPLEMENTATION
A directory like structure was used to display the user
folders and files in his root directory. The system also
comprises of an in-built editor with functionalities such as
save, load, find, and replace, go-to-line, and some others.
The jsTree is a free, open source plugin written in jquery
distributed under the MIT license. It is easily extensible,
customizable, configurable, and easy to theme with support
for HTML and JSON data sources as well as AJAX loading. .
Some of the notable features of jsTree include Drag and drop
support, Keyboard navigation, Inline edit, create and delete,
tri-state checkboxes, Fuzzy searching and Customizable node Fig. 6. Components of the Android Interface
types [8].
The jsTree was used to display the user folders and files in
a user‟s root directory on the server.
Drawer: The drawer region allows users to open or close the Compile and Run region: This area has two buttons; compile
region containing the folders and files. This feature is very for compiling a program and run for executing it.
useful to users with small screen devices as it allows them
have more space for the editor to occupy.
User/folders/files settings: This region contains a set of menu
items for managing personal user details, file creation and
modification, help and a link to logout.
jsTree region: Users folders and files created and managed by
the jsTree plugin are situated here.

Fig. 9. Input, compilation details and output region

Stdin region: This is a text area for users to supply inputs for
programs that require such inputs.
Compilation info region: Compilation information for a
program i.e. successfully compiled, error during compilation
and details of errors are displayed here.
Stdout region: The output of successfully compiled programs
Fig. 7. Editor area of the android interface is displayed here.

B. Web-based UI
The web browser interface was designed using HTML,
CSS and JQUERY. The jsTree and EditArea plugin were
integrated with other HTML elements to produce the interface
for the system. A responsive HTML theme was used to make
the system good and easy to use regardless of the device (non-
android devices) used to access the system.

Fig. 10. Components of the system for the Web-based UI


Fig. 8. Compile and Exceute region of the Android interface

Edit Area: This is the region containing the EditArea editor


with which users edit and save their programs.
and returning an image of the GUI program
embedded into javascript. We started this process but
could not complete it before the end of the research.
This should be considered for implementation in the
future or better still other methods to allow users
execute GUI programs from their smart devices could
be explored.
 Implement a Smart Multimedia Learning System
for Java programming language: The “Cloud-
Fig. 11. Input, compilation details and output region
based Java Compiler for Smart Devices” developed is
one component of a proposed Smart Multimedia
Learning System for Java programming language.
The other components of this Smart Learning System
IX. TESTING
could be developed and integrated with the already
The server side that mediates between the client (user developed Cloud-based Java Compiler for Smart
device or web browser) and the Cloud-based java server Devices.
(Sphere Engine) was developed using the server side language  Extend to include other programming languages:
Hypertext Preprocessor (PHP). It was deployed to an The implemented system was strictly for the Java
UBUNTU server and tested with no known issues. programming language alone. In future works
The android application is more desirable and easier to use compilers for other programming languages such as
on devices with very wide screens. Nevertheless, it also works C, C++, Python, e.t.c. could be developed and
fine on devices with smaller screen. The Android application integrated into this system.
was tested an Android mobile device with a 5.10 – inches
screen display and a 1080 pixels resolution, 2GB of RAM and XII. CONCLUSIONS
16GB of internal memory with android version of 5.0 In conclusion, the system developed affords a user the
(lollipop) with no know bugs. The web system was also opportunity to write and execute Java programs on his device
accessed on the mobile device via Chrome 50+ and Firefox where he is once he has internet connectivity on the device.
46+ browsers for android. The android application was This makes it possible for a programmer to easily move
designed for devices of all screen sizes and resolution with around with a programming kit on the go. The developed
minimum OS version 4.0 (Jelly Bean). The application is “Cloud-based Java Compiler for Smart Devices” can now be
expected to work fine on these devices. integrated into a Smart Multimedia Learning System for Java
The web based system was accessed and tested on the programming language to allow users who are learners
windows 10 environment using with Chrome 14+, Firefox program on the go with their smart devices.
3.5+, Opera 12+, Safari 4+, IE8+ with no bugs detected. The
system is expected to work fine on other operating systems XIII.REFERENCES
with the same browsers. [1] Aamir, N.A., Siddharth, P., Arundhati, N., Aditya, P., Venkatesh, B.
2011. “Online C/C++ Compiler Using Cloud Computing”, IEEE
Spectrum. DOI 978-1-61284-774-0/11/$26.00
X. LIMITATIONS OF THE SYSTEM [2] Vijay, R.S., Guruprasad, S.I., Dilip, K.J. (2014). “Cloud Compiler Based
on Android”. International Journal of Science and Research (IJSR), 3(9),
Some limitations of our system are: 2342-2346.
 Limited number of compile time: We had to use [3] Sonali, S.P., Vinod, B.I. (2015). “Cloud based C - Programming
and existing server (sphere engine) which offers us Android Application Framework”. International Journal of Computer
only a limited number of compilation times. Applications (IJCA), 115(12), 20-23.
 No Execution for GUI programs: Our compiler is [4] Mobile Learning. Retrieved from http://
library.educause.edu/topics/teaching-and-learning/mobile-learning
cannot execute Graphical User Interface (GUI)
[5] Niklaus, W., (2005). Compiler Construction. Addison-Wesley, pp.6-10.
programs on mobile devices.
[6] Kirk, H., Susan, L.C., Telmo, S. (2013). Cloud Essentials. John Wiley &
Sons, Inc., Indianapolis, Indiana, pp.1-47.
XI. FUTURE WORKS
[7] API Documentation. [Online]. Availaible: http://sphere-
A following are suggested for consideration in future engine.com/services/compilers/docs
works. [8] What is jsTree? [Online]. Available: http://www.jstree.com.
 Implementation of a cloud based server to host the [9] Edit Area. [Online]. Available: http://www.cdolivet.com/editarea/
java compiler: A cloud based server should be
developed in the future. As it is, we used an existing
Java compiler which restricted us to their
functionalities.
 Handle GUI programs: During the planning stage,
we intended to allow users execute GUI programs

You might also like