This game is released under the GPL 3 license. It is free software and I encourage you to take what you find good in it and put it to use.
You are not required to do so by the license, but I as the originator would appreciate an email of what you found useful, and for what purpose.
Where are the interesting parts
Stalker contains three concepts that goes beyound basic Android programming.
- Geodesy calculations
- Persistent background processes
- Server - Client communication
This is the part of maths that deal with measurements and representations of the earth. As such they are very important in a GPS based game.
They are done on two places, both serverside and clientside. The server side calculations is used to minimize the ammount of data that needs to be sent over the network.
Client side they are in the class GameInteraction.java which contains a java implementation of the haversine formula to calculate distances between two GPS locations.
An emplementation of the haversine formula in SQL can be found in the small server .
Persitent background processes
The application updates the users location to the server with an interval once per minute when in standby mode. While the game gets in to stalking/stalked mode the location is updated every two seconds.
Server - client communication
Much of the game data is sent to and from the server. One architectural idea was that once the game was on between two players it should use a p2p connection. That has not been implemented yet. All of the communication to and from the server is handeled by the class GameServer.java The libray used is Apaches http for Android
All of the messages sent is expected to be valid JSON. A closer definition of the format is in the wiki.