Archive

Archive for the ‘Android’ Category

Android App Release: SetNote – Note Taking Simplified

SetNote has been released on Google Play.

setnoteiconOperating system
Android 4.2+

Development environment
Xubuntu
Intel XDK
PhoneGap
Android SDK
jQuery & jQuery Mobile
PhoneGap Build

Testing device
OnePlus One

Status
Released

The application
Developed under the name SetNote, this application consists of a digital notebook, in which you can save information as notes and send them to other people via email. The native device email clients are utilized for this functionality, so you can choose your daily driver without any hassle.

SetNote was developed using PhoneGap and jQuery Mobile as hybrid single-page application, and it makes use of HTML5 local storage in order to store notes in device storage. SetNote doesn’t currently offer cloud backup. While developed mainly for phones, the app should also work well on tablets.

HTML5 local storage, which is extensively used by SetNote, has had issues with Android Lollipop 5.1 in regards to the stored content actually staying in storage. It’s probably not such a common issue, but it should considered when using Android 5.1 or newer.

Android app on Google Play

Background
I’m publishing SetNote under the GNU General Public License (version 3) as a part of my thesis, in which I examined the benefits of PhoneGap and the techniques enabled by it in terms of hybrid Android application development.

Source code & signed APK
You can find the signed APK and source code here (Google Drive).

Screenshots
Screenshot_2015-05-04-00-08-31Screenshot_2015-05-03-17-14-53Screenshot_2015-05-03-17-12-07

Screenshot_2015-05-03-17-11-47Screenshot_2015-05-03-17-11-31Screenshot_2015-05-03-17-10-25

Screenshot_2015-05-03-17-10-13Screenshot_2015-05-03-17-08-42Screenshot_2015-05-03-17-07-49

About
This document can be copied and edited according to the GNU General Public License (version 3 or newer). http://www.gnu.org/licenses/gpl.html

K-9 Mail Issue: Outlook.com Duplicate Sent Email – Solved

20/01/2014 3 comments

Operating System
Android 4.4.2 “KitKat”

Device
LG Nexus 5

Email Service
Outlook.com (Microsoft)

Email Client
K-9 Mail (Connected via IMAP)

Problem
The send email function in K-9 Mail was working flawlessly, until for some reason it started saving two copies of each sent email in my Outlook.com Sent folder, and then syncing them back to the phone.

Solution
After researching the issue, I concluded that it had to be a syncing problem of some kind, so I set about finding a fix. Google came up with nothing useful, so I eventually found the solution on my own.

In K-9 Mail, go to Settings -> Account Settings -> Folders. You will see a list of the synced folders in K-9 Mail, and their counterparts on the Outlook.com server. Drafts should be linked to Drafts, Spam to Junk, Trash to Deleted and Sent to Sent. All looks correct, right? Except that it isn’t.

Linking the local Sent folder to the Sent folder on the Outlook.com server seems cause duplicate sent email to be created. If you set the local Sent folder’s linked status to -NONE-, the issue is fixed. A copy of the sent email is still saved in the Sent folder on the server, but there are no duplicates. Syncing works as before.

This solution may be applicable to other email services besides Outlook.com, provided that they allow the use of IMAP.

About
Use these instructions at your own risk
This document can be copied and edited according to the GNU General Public License (version 3 or newer). http://www.gnu.org/licenses/gpl.html

Hot Air Balloon Game Released on Google Play

Hot Air Balloon Game has been released on Google Play.

Operating systems qrcode
Android 4.0+

Development tools
Eclipse
PhoneGap
Android SDK

Testing devices
LG Nexus 5
HTC One X

Status
Released

Hot Air Balloon Game – Description
Hot Air Balloon Game is played by keeping the hot air balloon level, not letting the altitude get too low or too high, and making sure that the balloon stays within the game zone during different wind speeds. Game over happens at too high or too low altitudes, or when the wind pushes you out of the game zone (to the far left or far right).

The player can control the altitude of the hot air balloon by tilting their phone backward, forward and sideways. Note: keep the screen pointing upward. Points are rewarded for the total time the you can keep the hot air balloon in the air. By flying higher you can gain double points. The wind speed increases over time, which makes it harder to keep the hot air balloon level. There is a vibrate alert when this happens – watch out for it!

Have fun playing, and feel free to rate the game and comment on Google Play or this blog!

Android app on Google Play

Developed for Android 4.0+
Android 4.4 KitKat Support
Hot Air Balloon Game was developed in collaboration between Janne Varis and Kim Stenberg.

ScreenShots
Screenshot_2013-12-19-05-44-25 Screenshot_2013-12-19-05-44-42

Screenshot_2013-12-19-05-44-29 Screenshot_2013-12-19-05-45-07

Screenshot_2013-12-19-05-52-09

Source code
The Hot Air Balloon Game source code is available here.

References
Accelerometer Javascript Test (http://www.albertosarullo.com/demos/accelerometer/)
Cordova API (http://cordova.apache.org/docs/en/2.9.0/)
Openclipart (http://openclipart.org/)
Nikkonen, Sebastian (http://sebastiannikkonen.wordpress.com/2013/09/22/mobiilituotekehitys-4-viikko/)
Karvinen, Tero: Lessons 2013-12-5, Mobiilituotekehitys [Mobile Application Development] (http://terokarvinen.com/2013/aikataulu-%E2%80%93-mobiilituotekehitys-bus4tn008-3-syksylla-2013)

About
This document can be copied and edited according to the GNU General Public License (version 3 or newer). http://www.gnu.org/licenses/gpl.html
Based on a course by Tero Karvinen, http://www.iki.fi/karvinen

Task 9 – Hot Air Balloon Game Beta Version

Operating systems
Xubuntu Linux 13.04, 32-bit
Android 4.4, 4.2.2

Tools
Eclipse
PhoneGap
Android SDK

Testing devices
LG Nexus 5
HTC One X

Status
Open Beta

Hot Air Balloon Game
This is the beta version of the Hot Air Balloon Game. It doesn’t have all the features yet, but is suitable for testing purposes. The high score and options menus aren’t yet implemented.

menu

game

index.html source:

<!DOCTYPE html>
<html>
	<head>
		<title>Hot Air Balloon Game</title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
		<link href="css/menu.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<div id="menu">
			<h2><a href="game.html"><img src="images/play.png" alt="Play" class="imged" /></a></h2>
			<h2><a href="options.html"><img src="images/options.png" alt="Options" class="imged" /></a></h2>
			<h2><a href="highscore.html"><img src="images/highscore.png" alt="High Score" class="imged" /></a></h2>
		</div>
	</body>
</html>

game.js source:

// WatchID Refers Current 'watchAcceleration'
$( document ).ready(function() {
	var watchID = null;

	// Position Variables 
	var x = document.documentElement.clientWidth / 2 - $("#balloon").width() / 2;
	var y = document.documentElement.clientHeight / 2 - $("#balloon").height() / 2;

	// Velocity 
	var vx = 0;
	var vy = 0;

	// Acceleration 
	var ax = 0;
	var ay = 0;

	// Balloon Speed
	var vMultiplier = 0.01;
	var time = 0;
	var turn = true;

	// Wait for device API libraries to load 
	document.addEventListener("deviceready", onDeviceReady, false);

	// Device APIs are available 
	function onDeviceReady() {
		startWatch();
	}

	// Start watching the acceleration 
	function startWatch() {
		// Acceleration: update every 0.020 seconds 
		var options = { frequency: 20 };
		watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);
	}

	// onSuccess: Play the game 
	function onSuccess(acceleration) {
		ax = acceleration.x;
		ay = acceleration.y;
		
		vy = vy + ay;
		vx = vx + ax;
		
		var balloon = document.getElementById("balloon");
		y = parseInt(y + vy * vMultiplier);
		x = parseInt(x - vx * vMultiplier);
		
			if (x < 0) {
			x = 0;
			vx = -(vx / 2);
			stopTimer();
		}
		
		if (y < 0) {
			y = 0;
			vy = -(vy / 2);
			stopTimer();
		}
		
		if (x > document.documentElement.clientWidth - 50) {
			x = document.documentElement.clientWidth - 50;
			vx = -(vx / 2);
			stopTimer();
		}
		
		if (y > document.documentElement.clientHeight - 50) {
			y = document.documentElement.clientHeight - 50;
			vy = -(vy / 2);
			stopTimer();
		}
		
		$("#balloon").css("top", y + "px");
		$("#balloon").css("left", x + "px");
	}
	
	// timer 
	var timer = setInterval(function() {
		time = time + 0.01;
		$("#timer").text(parseFloat(time).toFixed(2));
		setInterval();
	}, 10);
	
	function stopTimer() {
		if (turn) {
			clearInterval(timer);
			$("#timer").text("Air Time: " + parseFloat(time).toFixed(12) + " Seconds");
			turn = false;
		}
	}
	
	function onError() {
		alert('Failed to get the acceleration');
	}

});

game.css source:

@charset "utf-8";

html, body {
	background-image: url(../images/bg.gif);
	background-repeat: no-repeat;
	background-color: #81c8ed;
	width: auto;
	height: auto;
	top: 100px;
	left: 100px;
	}

#balloon {
	position: absolute;
	width: 58px;
	height: 70px;
	}
	
#timer {
	text-align: center;
	}

MainActivity.java source:

package com.example.balloongame;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import org.apache.cordova.*;

@SuppressWarnings("unused")
public class MainActivity extends DroidGap {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		super.loadUrl("file:///android_asset/www/index.html");
		super.setIntegerProperty("splashscreen", R.drawable.splash);
        super.loadUrl(Config.getStartUrl(), 5000);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}

References
Accelerometer Javascript Test (http://www.albertosarullo.com/demos/accelerometer/)
Cordova API (http://cordova.apache.org/docs/en/2.9.0/)
Openclipart (http://openclipart.org/)
Nikkonen, Sebastian (http://sebastiannikkonen.wordpress.com/2013/09/22/mobiilituotekehitys-4-viikko/)
Karvinen, Tero: Lessons 2013-11-14, Mobiilituotekehitys [Mobile Application Development] (http://terokarvinen.com/2013/aikataulu-%E2%80%93-mobiilituotekehitys-bus4tn008-3-syksylla-2013)

About
This document can be copied and edited according to the GNU General Public License (version 3 or newer). http://www.gnu.org/licenses/gpl.html
Based on a course by Tero Karvinen, http://www.iki.fi/karvinen

Task 8 – Hot Air Balloon Game Alpha Version

Operating systems
Xubuntu Linux 13.04, 32-bit
Android 4.4, 4.2.2

Tools
Eclipse
PhoneGap
Android SDK

Testing devices
LG Nexus 5
HTC One X

Status
Closed Alpha

Hot Air Balloon Game
This is the alpha version of the Hot Air Balloon Game. It doesn’t have nearly all the features yet, but is suitable for testing purposes. The main API (Accelerometer) works, but is still buggy. The version isn’t available for public testing, but it was demonstrated at the alpha showcasing during the Mobiilituotekehitys [Mobile Application Development] course by Tero Karvinen at Haaga-Helia University of Applied Sciences.

menu

game

References
Accelerometer Javascript Test (http://www.albertosarullo.com/demos/accelerometer/)
Cordova API (http://cordova.apache.org/docs/en/2.9.0/)
Openclipart (http://openclipart.org/)
Nikkonen, Sebastian (http://sebastiannikkonen.wordpress.com/2013/09/22/mobiilituotekehitys-4-viikko/)
Karvinen, Tero: Lessons 2013-11-14, Mobiilituotekehitys [Mobile Application Development] (http://terokarvinen.com/2013/aikataulu-%E2%80%93-mobiilituotekehitys-bus4tn008-3-syksylla-2013)

About
This document can be copied and edited according to the GNU General Public License (version 3 or newer). http://www.gnu.org/licenses/gpl.html
Based on a course by Tero Karvinen, http://www.iki.fi/karvinen

Task 7 – Android Game Planning

16/10/2013 2 comments

Operating systems
Xubuntu Linux 13.04, 32-bit
Android 4.1.2, 4.2.2

Tools
Eclipse
PhoneGap
Android SDK

Testing devices
Sony Xperia S (LT26i)
HTC One X

App planning – Hot air balloon game
The idea behind the game is to develop and release a game featuring hot air balloons. The game is played by keeping the hot air balloon level, not letting the altitude get too low or too high. Game over happens at too high or too low altitudes. Ten points are rewarded for each ten seconds the player can keep the hot air balloon in the air. The difficulty level increases over time, which makes it harder to keep the hot air balloon level. The changes can include faster wind changes and stronger winds.

The player can control the altitude of the hot air balloon by tilting their phone backward and forward according to the current wind speeds, specified by a flag at the top of the screen. Using real weather data to drive the game’s environmental factors is also being investigated. Tapping the hot air balloon with a finger causes it to drops the weights, or bags of sand, boosting the hot air balloon’s altitude more quickly for a short time.

The game’s target group consists of casual gamers. Due to the increasing difficulty level, the game may not be suitable for the youngest players. The app is developed in collaboration between Janne Varis and Kim Stenberg, and will be released on Google Play by the end of the course.

Cordova API use
The game will utilize three different Cordova APIs; accelerometer, notification and splashscreen. We’ve created examples of all three in Eclipse, as demonstrated in the previous tasks (1, 2, 3 & 4) using PhoneGap 2.9.0. See Cordova 2.9.0 API documentation here.

Development tools
The development will utilize Eclipse, Android SDK, PhoneGap, HTML5, CSS3, JavaScript and jQuery. The art assets will be created in Photoshop, or acquired through sites with the proper free licensing like openclipart.org. The Android smartphones used in the development will be Sony Xperia S (Android 4.1.2) and HTC One X (Android 4.2.2).

Mockups
Splashscreen:
splashscreen

Menu:
menu

Game:
game

High score:
high score

Use case
Target group user: Smith, John A.
John A. Smith searches for “hot air balloon” on the Google Play store. He browses the search results until he happens to come across “Hot Air Balloon, The Game”. John decides to install the game to try it out, because he has an hour to kill before his flight to Los Angeles.

He starts the game, noting the splash screen, which lists Janne Varis and Kim Stenberg as the developers. After the game has loaded, John arrives at the main menu, which contains the following: play, options and high score. John clicks play and begins the game. He notices the round button in the lower left corner, and taps on it with his finger; it opens a notification asking him if he wants to return to the main menu. John elects to continue the game.

By tilting his phone backward and forward, John notices he can control the altitude of the hot air balloon according to the current wind speeds, specified by a flag at the top of the screen. By tapping the hot air balloon with his finger, John drops the weights, or bags of sand, boosting the hot air balloon’s altitude more quickly for a short time.

After less than a minute of playing the game, the wind speeds get the better of John, and the hot air balloon plummets to the bottom of the screen, crashing down. Game over. John scores 50 points; 10 points for each full 10 seconds he managed to keep the hot air balloon level, not letting the altitude get too low.

John tries the game again, this time managing to play for 90 seconds before the hot air balloon hits the top of the screen, rising too high. Game over. John scores 90 points; 10 points for each full 10 seconds he managed to keep the hot air balloon level, not letting the altitude get too low or too high.

John tells his friend Adam about the game, noting that it was a nice way to pass the time at the airport, recommending that Adam try the game next time he has some time to kill.

Competition
We began charting our competition on Google Play by searching for “Hot Air Balloon”. In the beginning we had some trouble separating the games from all the live wallpapers, of which there are many, to say the least.

After some further research, we found a few hot air balloon games (see links below). For the most part they were different than our game idea, but there were some with similar gameplay, e.g. “Red Balloon”, where a hot air balloon glided through the air, moved up and down and dodged birds. The difficulty increased the further you got, increasing the birds’ flight speed.

The other games were mostly 3D, where you could fly around detailed landscapes, or fly upward dodging bombs from airplanes. One version included shooting pirates and surviving the counter-attacks. In summary, we couldn’t find a game that would have matched our idea exactly, but as expected before we began, we did find some with similarities in gameplay.

References
Hot Air Ballooning 3D (https://play.google.com/store/apps/details?id=com.timekiller.HotAirBallooning3D)

Floating Balloon (https://play.google.com/store/apps/details?id=com.timekiller.FloatingBaloon)

Red Balloon (https://play.google.com/store/apps/details?id=smokesnap.apps.redballoon)

Aerostat Reveillon 3D (https://play.google.com/store/apps/details?id=com.PixSlate3.AerostatReveillon)

Escape the Pirates Game (https://play.google.com/store/apps/details?id=com.marusz.airpiratesgame)

Cordova API (http://cordova.apache.org/docs/en/2.9.0/)
Openclipart (http://openclipart.org/)
Karvinen, Tero: Lessons 2013-10-10, Mobiilituotekehitys [Mobile Application Development] (http://terokarvinen.com/2013/aikataulu-%E2%80%93-mobiilituotekehitys-bus4tn008-3-syksylla-2013)

About
This document can be copied and edited according to the GNU General Public License (version 3 or newer). http://www.gnu.org/licenses/gpl.html
Based on a course by Tero Karvinen, http://www.iki.fi/karvinen