Geographical position from Java mobile application?

Is there a way of programmatically determining a rough geographical position of a mobile phone using J2ME application, for example determining the current cell? This question especially applies to non-GPS enabled devices.

I am not looking for a set of geographical coordinates, but an ability for a user to define location specific software behaviours.

Solution for any hardware will be highly appreciated; however the more generic a solution is รขโ‚ฌโ€ the better. Many thanks!

Asked by: Catherine850 | Posted: 23-01-2022

Answer 1

If the device supports the JSR 179 location API, you can use this. Last time I looked into this hardly any devices supported it, but that was a few years back.

Answered by: Elise479 | Posted: 24-02-2022

Answer 2

this is my first post one stackoverflow.

You can get the cellID (The id of the phone pole that the mobile is connected to) on a lot of phones thru System.getProperty(String arg) Here i have an example that tries a few keys to see if a cellID can be found. I have tested this on a lot of SonyEricsson mobiles and it works fine, as long as it isn't a Symbian mobile like P1 and so on. If you search the net you probably could find a lot more keys to find cellID:s for motorola, samsung and so on.

  String[] cellIDTags = {"", "phone.cid", "Siemens.CID", "CellID"};
  for(int i = 0; i < cellIDTags.length; i++){
    cellID = System.getProperty(cellIDTags[i]);
    if(cellID != null && cellID != ""){
}catch(Exception e){
  cellID = "";

Answered by: Michelle457 | Posted: 24-02-2022

Answer 3

I don't believe there is a general J2ME API for determining location.

I do know that BlackBerry has a specific API for retrieving not only the rough 'cell' location, but also a GPS API as well.

I'm afraid, at the moment, the GPS solutions are proprietary by manufacturer.

Answered by: Adrian965 | Posted: 24-02-2022

Answer 4

I have browsed through many application download site , but didn't find any :: But i am sure some research on this could help you build your own application with J2ME API. As the code given by DAN gives the base station number. You can recognize the nearest station that the cell is able to correspond to . Actually a cell is able to capture at least 6 stations simultaneously , so as deamonkid explains multilateration can be used to approximate the position, provided you have a georeferenced map of your area or city. The application will calculate the distance and direction from the nearest tower and the map already has the coordinate of that base station . So you can calculate the spatial coordinate(estimated ) suresh. You may get the accuracy of 100 meters by this. This probably needs the signal strength measuring application which probably you may get to download. Now if you can generate code based on this please share. I am also into extensive research on this. Good luck suresh and all

Answered by: Marcus739 | Posted: 24-02-2022

Answer 5

IMO, no application will be able to do that by itself. It will need the help of a satellite or incase of a mobile phone, the cell towers, to traingulate the position where the cell phone is at currently, which again is accurate to around 30-50 meters. Locate phone

The calculation here will be done by the software in the Cell towers or the one in the satellite. Your application will only make a request and then recieve the data that is sent over in response.

Again, the apis that you will be using will be the ones that have been provided by the cell phone company or the sattellite service. These are almost never free. I'm not sure they sell it to oridinary users too. Only maybe the big companies like Blackberry or the like.

Answered by: Kevin179 | Posted: 24-02-2022

Similar questions

java - sqlite, index for geographical coordinates?

I have a SQLite database that contains geographical data. My table is defined like this: CREATE TABLE GEO_OBJECTS (ID VARCHAR(30) PRIMARY KEY NOT NULL, LATITUDE NUMERIC(6,3) NOT NULL, LONGITUDE NUMERIC(6,3) NOT NULL) Next my software (Java) is looking for GEO_OBJECTS using a simple SQL request like this: SELECT * FR...

java - Find an object within an geographical area

I want a java function where if we pass the lat,long of a object, whether that object lies inside a area. Again this Area is defined by lat,long for example I define a area with 3 lat/long positions.( a rectangle ) and if I pass a lat/long position it should return me whether its within the rectangle.

java - Recognize if string contains geographical references

How is it possible, in Java, to understand whether a String value (e.g., coming from user-generated content) contains a geographical reference? That is, names of cities addresses states My current solution is to submit to a Geolocation API (this one in particular) the string, so t...

java - Finding all values within a radius using geographical math

How can I find all values (in this case establishments) within a radius of (X) miles using Latitude/Longitude coordinates? The code: public class GeoGen { static final GeoPosition USER_POSITION = new GeoPosition(39.410868, -107.102182); public static void main(String[] args) { new Establishment("Fries Electronics", randomLocation(USER_POSITION, 40)).print(); new Establishme...

java - How can I correctly convert geographical coordinates to pixels on screen?

I'm trying to make a Java project that pinpoints the place on a image of a map, when given coordinates (taken from Google Maps). I've tried using the top-left corner of the image (place that has highest latitude, and the lowest longitude), as an some kind of an reference point, which would be (0,0) point on the map image, and than I've tried to calculate every place on the map based on that reference point. Howeve...

java - Calculate geographical distance from a line to a point

I have this code segment from a forum, and it's used to calculate the distance from a line to a point. The problem is that I don't know the measure unit in which the result is returned. Here is the code: private double distanceFromLineToPoint(Point A, Point B, Point C){ //A-B the line, C the point double lat1=A.latitude; double lon1=A.longitude; double lat2=B.latitude; double lon2=B.lon...

java - Generating possible paths between 2 Geographical points

I am currently doing a University assignment which requires me to be able to generate possible routes between 2 points on a map in a certain way. I'm having trouble with the route generation. I essentially start with 2 points A and B, I create an edge between these points and my algorithm takes the midpoint, generates a 2 new points slightly left and right of the midpoint and creates new edges. So 1 edge has 3 diff...

java - How to place objects in ARCore that point in a given geographical direction

I am currently working on an ARCore app and want to place objects (eg. Arrows) in the AR scene that start at the current location of the user and point to geographical north. My idea was to place objects on the X-axis, rotate them around the Y-axis and at last translate the objects to have their origin in the position of the user. I planned to at first get the device orientation in relation to north (which I am abl...

geolocation - How to Check if Coordinates belongs to an geographical area in JAVA

I have coordinates , lets say coordinates point A { -73.93289103, 40.12354012}. And i have a geographical area which consists of 4 coordinates {-73.99863434, 40.7422142} {-73.99131012, 40.73348236} {-73.96737671, 40.76044846} {-73.87309265, 40.77401733} Now i want to check if my coordinate point A is inside this geographical area. And i want a generic formula for it. How coul...

Still can't find your answer? Check out these amazing Java communities for help...

Java Reddit Community | Java Help Reddit Community | Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)