Model-driven Development for a Treasure Hunt Android application

Similar documents
Building a Flexible Software Factory Using Partial Domain Specific Models

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Open Source Telemedicine Android Client Development Introduction

Fahim Uddin 1. Java SDK

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

All you need are models Anneke Kleppe, Klasse Objecten

How to Create an Android Application using Eclipse on Windows 7

Android Tutorial. Larry Walters OOSE Fall 2011

Introduction to Android

Android Programming. Høgskolen i Telemark Telemark University College. Cuong Nguyen,

An Android-based Instant Message Application

Android Environment SDK

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Android, Bluetooth and MIAC

Developing NFC Applications on the Android Platform. The Definitive Resource

Leveraging the Eclipse TPTP* Agent Infrastructure

How To Develop Android On Your Computer Or Tablet Or Phone

ITG Software Engineering

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Android Environment SDK

CommentTemplate: A Lightweight Code Generator for Java built with Eclipse Modeling Technology

Running a Program on an AVD

Introduction (Apps and the Android platform)

Getting Started with Android Programming (5 days) with Android 4.3 Jelly Bean

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

How To Develop An Android App On An Android Device

ANDROID INTRODUCTION TO ANDROID

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Jordan Jozwiak November 13, 2011

Introduction to Android. CSG250 Wireless Networks Fall, 2008

OpenCV on Android Platforms

Getting Started with Android Development

Introduction to Android Android Architecture Software Development Purpose of the project Location Based Service (LBS) Android. Location class Google

Embedded/Real-Time Software Development with PathMATE and IBM Rational Systems Developer

Practical Android Projects Lucas Jordan Pieter Greyling

Presenting Android Development in the CS Curriculum

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Mobile Application Development

Download and Installation Instructions. Android SDK and Android Development Tools (ADT) Microsoft Windows

Android Application Development. Daniel Switkin Senior Software Engineer, Google Inc.

AndroLIFT: A Tool for Android Application Life Cycles

Course 4 27 October Adrian Iftene adiftene@info.uaic.ro

Module Title: Software Development A: Mobile Application Development

Model-Driven Development - From Frontend to Code

Beginning Android Programming

Homeschool Programming, Inc.

Developing Android Applications Introduction to Software Engineering Fall Updated 7 October 2015

Android Programming and Security

Android Application Development Distance Learning Program Brochure

Challenges in Android Application Development: A Case Study

Jiří Šebek, Karel Richta. Department of Computer Science and Engineering Praha 2, Czech Republic

Sybase Unwired Platform 2.0

Android Development. Marc Mc Loughlin

Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет

Introduction to Android: Hello, Android! 26 Mar 2010 CMPT166 Dr. Sean Ho Trinity Western University

Pondering on the Key Functionality of Model Driven Development Tools: the Case of Mendix

Introduction to Android

VICCI. The Eclipse Modeling Framework (EMF) A Practical Introduction and Technology Overview. Dipl.-Inf. Christoph Seidl

GETTING STARTED WITH ANDROID DEVELOPMENT FOR EMBEDDED SYSTEMS

Praktikum Entwicklung Mediensysteme (für Master)

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Advantages. manage port forwarding, set breakpoints, and view thread and process information directly

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

1. Introduction to Android

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

Introduction to Android

Polyglot Multi-Paradigm. Modeling. MDA in the Real World. Stefan Tilkov

Mobile Client SDK for Android Developer's Guide

ID TECH UniMag Android SDK User Manual

Creating a 2D Game Engine for Android OS. Introduction

OpenEmbeDD basic demo

Smooks Dev Tools Reference Guide. Version: GA

An Eclipse Plug-In for Visualizing Java Code Dependencies on Relational Databases

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Android Developer Fundamental 1

Tutorial #1. Android Application Development Advanced Hello World App

DESIGN AND IMPLEMENTATION OF A FILE SHARING APPLICATION FOR ANDROID

Modeling Turnpike: a Model-Driven Framework for Domain-Specific Software Development *

Android Security Evaluation Framework

Android Application Development

ADT Plugin for Eclipse

Model Driven Interoperability through Semantic Annotations using SoaML and ODM

JMulTi/JStatCom - A Data Analysis Toolkit for End-users and Developers

Android Application Repackaging

Android Setup Phase 2

DEVELOPING MOBILE APPLICATIONS USING ANDROID

Here to take you beyond Mobile Application development using Android Course details

Transcription:

Model-driven Development for a Treasure Hunt Android application Muram Faiz Ul Subramani Uma Shankar Marinescu Raluca Eduard Paul Enoiu Mälardalen University, Västerås, Sweden {faizulmuram, shanumas, ralukutza, eduard.enoiu}@gmail.com November 27, 2011 Abstract The Android operating system has grown in the last few years and is becoming one of the most popular system for mobile devices. The amount of applications rises exponentially. By becoming more complex, the mobile applications development needs to be improved by using Model-driven development techniques. This report shows the advantages of Model-driven development for Android applications and specifically for the case of a Treasure Hunt application. An Eclipse plug-in was implemented to support the developer in creating a simple Android application. 1

Contents 1 Introduction 3 2 Development Description 3 2.1 Design Method.......................... 4 2.2 Implementation.......................... 4 3 Results 7 4 Conclusions 9 2

1 Introduction A treasure hunt game is played by one or more players who try to solve different clues in order to find hidden articles, locations or places. Solving each clue takes the players to the next stage of the game, where they will get a new piece of the puzzle to solve. This continues until the player gets to the end clue that leads to the treasure. Treasure hunts come with different sets of rules. Some treasure hunts are a race to find the final clue and solve it. For others, each clue is worth points and sometimes offers the choice of completing one of two tasks. This game can be a fictional activity, but also a real life activity, played indoor or outdoor. We have implemented a simple version of the game, played on an Androidbased mobile phone [5]. During the treasure hunt the user will get multiple answers questions from different topics. Moving to the next stage of the game requires that the user answers correctly the current question. In case the user gives a wrong answer to a question, a hint will be provided. In our application the hints can contain textual, pictures, or audio features. The user performance in the game is implemented in form of a timer. Based on the project requirements, in our project, we preliminary defined one language which is dedicated to the game description and one language to describe the mobile phone properties. Using these two models a corresponding treasure hunt game application based on Android OS was generated [2]. The project has been developed in Eclipse IDE. This project started on the 5th of October 2011. Four students worked on the project, and each student had specific tasks to work on. We had regular meetings to talk about the progress of the project and to ensure that the individual tasks could be integrated in the project. The rest of the report will deal with all aspect of developing this kind of application. In Section 2 we describe the overall development process. In Section 3 we present our results in emulation environment, before concluding the report in Section 4. 2 Development Description There are a number of technological and organizational details in building and Android application using Model-driven Development (MDD) [4]. We defined our design details from the requirements definition as presented in the project proposal. 3

2.1 Design Method Our initial plan was to define one language which was dedicated to the game description and one language to describe Android mobile phone properties. Using the game model and the phone model a corresponding treasure hunt application based on Android OS could be generated. However, we have identified that the meta-model can be simplified in order to provide an efficient base for further development. The platform for the Treasure Hunt game is a plug-in for the Eclipse IDE [3]. The architecture behind Eclipse provides a modular and easily customizable support for model-driven development of applications. During the design phase we have used the Android Development Tools (ADT) [1]. This factor made the development of the plug-ins as easy as possible. Basis for developing Treasure Hunt plug-ins is the Eclipse Modelling Framework (EMF), which contains the ecore meta model. We decided to design the plug-ins starting from the game model and diagram. Acceleo is a technology included in the Eclipse Modelling Tools. We decided to generate source code from the specific domain model with the aid of a template. In the plug-in theses technologies are used to generate a part of the Android application and build the structure for the transformation of the created ecore domain model into the Android based code. Therefore, we have divided the MDD Treasure Hunt application in three: Treasure Hunt Meta- Model, Transformation and generation plug-in, and Android application logic and UI. 2.2 Implementation The result of this project is an Eclipse plug-in for Treasure Hunt- based Android applications. With this plug-in, the developer can generate the content by designing an ecore model based on the Game Model Ecore model. In Figure 1 the Game Model is depicted. The model has one root element named gamemodel. Every game created has a name and a variable number of stages. Every stage contains a questions, a correct answer, one or more possible answers. Also, we have defined some hints relating to the current stage. This hints can be of three types: text, audio, and image. Meta-model should be registered before launching Acceleo transformation. Source code used for registration of Ecore model (GameModel.ecore) is depicted in Figure 2. The ecore model is part of the plugin that generates the Android Treasure Hunt application. This was done by implementing a template that transforms the game model, as depicted in Figure 3. The Acceleo transformation is used 4

Figure 1: Game Ecore Model Figure 2: Registration of GameModel.ecore to generate the strings.xml file that contains all the treasure hunt information. The generation plugin was designed as an action button for every game model created. Figure 3: Acceleo MTL Transformation The transformation rules for M2T are shown in Figure 3. [module generatexml( /com.mdh.se.treasurehunt/model/gamemodel.ecore )] indicates ecore meta-model URI. Template structure starts with [template public generatestrings(game : Game)] and ends with [/template]; where generatestrings is a template name. Transformation rules are enclosed inside 5

template tags. The name of target file is specified in opening file tag [file (( strings.xml ), false, UTF-8 )]. For retrieving contents of each stage, for loop is used. Information concerning each stage attribute is retrieved by using stage (dot) attributename. Each stage either contains image hint, audio hint or text hint. For retrieving corresponding hint, if-elseif block is used which identifies that whether attributename is not null and not an empty string. Upon verification, corresponding information is printed. Figure 4: Acceleo MTL Transformation As depicted in Figure 4, we define every Treasure Hunt stage as a string resource. The game name is depicted as a string resource and the stages are an array of strings that can be referenced from the application. In our implementation a stage is a simple resource that is referenced using the value stages. As such we can combine stage resources with other simple resources in one XML file, under the resource element. The Treasure Hunt application has, as depicted in Figure 5, a generic hierarchy that is improved with some specific information influenced by the model-driven approach. As a result, we differentiate between the application UI and interaction provider and the application resources. For simplification we use one activity for providing a screen with which users can interact in order to find the treasure. The activity is given as a window in which to draw its user interface. Having generated the stages resources we can maintain them independently. As depicted in Figure 6, the stages are referenced easily during run-time by parsing every stage and using the question, answers, and hints information. 6

Figure 5: Text transformation result Figure 6: Android Project Structure 3 Results To debug and test our MDD application we have used the Android SDK for Eclipse IDE. Because of the absence of a physical device, we have used an 7

Figure 7: Stage Parser Android emulator instance and Android Debug Bridge for managing the state of the emulator. Additionally, we have used LogCat for checking different running threads on the emulator. In the current version of the application the user is able to manage the generation of the game model for a simple string resource structure. We have kept the MDD application complexity to a minimum because we are dealing with a device environment with limited resources. Therefore, we provide an efficient transformation and generation in order to offer the developer a simple way of building this kind of applications. The project has met all of its main requirements and it should be noted that the development followed the standard practices in MDD and Android application development. Therefore, will not prevent any further expansion. 8

4 Conclusions The goal of the project was to create a treasure hunt tool that generate from a domain model the content for Android applications. The goal was achieved by improving and efficiently developing an Android application based on a specific meta model. The part of the source code that is transformed only builds a part of the complete application source code. The other parts are generated automatically. Future modifications could add functionalities like support for GPS localization and better scoring results. References [1] Ed Burnette. Hello, Android: Introducing Google s Mobile Development Platform. Pragmatic Bookshelf, 2nd edition, 2009. [2] Google. Android development documentation : The developer s guide http://developer.android.com/guide/, October 2011. [3] Steve Holzner. Eclipse: A Java Developer s Guide. O Reilly & Associates, Inc., Sebastopol, CA, USA, 2004. [4] Anneke G. Kleppe, Jos Warmer, and Wim Bast. MDA Explained: The Model Driven Architecture: Practice and Promise. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2003. [5] Victor Matos and Rebecca Grasser. Building applications for the android os mobile platform: a primer and course materials. J. Comput. Small Coll., 26:23 29, October 2010. 9