Mobile game/soft development
Krzysztof Podlaski, University of Lodz, Poland
Abstract The material covers mobile development in Apache Cordova Frame- work. It allows students to create their mobile game/applications using HTML5, Javascript, and CSS. The basic ways of accessing capabilities of mobile devices like GPS, accelerometer, etc., are also covered. As some- times developer needs to access data using AJAX queries, the JQuery library is also introduced. The course should be taken after ’Games De- velopment in JavaScript’. Therefore, it shows how the code from the previous course can be run on a mobile device using the Cordova frame- work. The original version of this material can be found on project web page: http://geniusgamedev.eu/teaching.php. Type: E-learning module, online-training, MOOC Domain: Software development Requirements: Basic knowledge in JavaScript programming, Target group: Computer Science students
License The material is distributed under Creative Commons Attribution license.
Disclaimer The European Commission’s support for the production of this publica- tion does not constitute an endorsement of the contents, which reflect the views only of the authors, and the Commission cannot be held responsible for any use which may be made of the information contained therein.
1
GENIUS – Innovative Interdisciplinary Contextual Education Using Games Development Project N°: 2017-1-PL01-KA203-038669
Chapter 1
Introduction to jQuery
Before we start with mobile application development let us rst introduce a very well known and useful library jQuery. Here we will cover some basics of jQuery library and how to use it for simple internet queries. The jQuery library basically can be used to do following operations: Manipulation of HTML/DOM elements in a web application. • Manipulation of CSS properties/elements in a web application. • Create/add Listeners to HTML events. • Create simple eects and animations in a web application. • Invoke and receive AJAX queries. • 1.1 Include jQuery into a project
The jQuery can be included int our project in two simple ways: as external resource, • as internal resource, • The dierence is only on loading time and requirements of available internet connectivity.
It is better to add
11
12 $(document).ready(
13 function(){
14 $("button").click(function(){
15 $(this).hide();
16 });
17 }
18 );
19
20