Showing posts with label blackberry. Show all posts
Showing posts with label blackberry. Show all posts

Sunday, January 23, 2011

Tip: Calculate distance between two GPS endpoints on Blackberry

If you are in need of determining the distance between two geo coordinates on blackberry, use the following piece of code.

====
import javax.microedition.location.Coordinates;

private double difference( double currentLat, double currentLon, double startLat, double startLon )
{
Coordinates current = new Coordinates(currentLat, currentLon, 0);
Coordinates start = new Coordinates(startLat, startLon, 0);
float diffInMetres = current.distance(start);
return diffInMetres * 0.000621371192; //Convert into miles
}
====

Tuesday, June 29, 2010

Mobile Development Tips: Blackberry Application Development

Problem: ButtonField changelistener displays the standard menu (Show Keyboard, Switch Application, Close)

Solution: In the construction of the button field, use the CONSUME_CLICK style.
Eg: ButtonField mybutton = new ButtonField( "My", ButtonField.CONSUME_CLICK );

Tuesday, November 04, 2008

Blackberry: Calls go directly to VoiceMail

Profiles. Check the one that is active. Go to Phone. Ensure that "Do not disturb" is set to off.