PhoneGap accelerometer ball

By | 21/11/2012

I am writing this post as part of a course called Mobiilituotekehitys (Mobile development) held by Tero Karvinen

I am using Eclipse to develop PhoneGap applications on a 64-bit Xubuntu 12.10 installed on a HP EliteBook 2560p Laptop.

Program Name

SamusAcceleratingBall

Description

The ball rolls to either left or right according to where you tilt the phone.

Status

Doesn’t work / alpha / beta / release

Tested on Samsung Galaxy Gio S5660 & Sony Ericsson Xperia Active

Screenshots

APK-file

http://myy.haaga-helia.fi/~a1103361/MD/nov21/SamusAcceleratingBall.apk

Source code

http://myy.haaga-helia.fi/~a1103361/MD/nov21/SamusAcceleratingBall.tar.gz

Technical information

The program checks if the phone is tilted a certain amount either clockwice or counter-clockwise and changes the balls position accordingly by looping the ball’s x’-location and adding or reducing 5. Depending which way the phone is tilted.

Notes

I used Accelerometer API and processing-1.4.1.min.js -library to do this assignment.

Leave a Reply

Your email address will not be published. Required fields are marked *