I wanted to get my current location coordinates and pass it to a String. I've tried to use googleMap.getMyLocation(); but the method is deprecated and it's not really what I need because I need literally the Latitude and Longitude coordinates in a string.
Can anyone help a young programmer :)
See this part of Android's documentation https://developer.android.com/guide/topics/location/strategies.html
Related
I'm displaying the results of a clustering operation on a XYLineChart using JFreeChart. For now the plot I get is this one:
I need to change the x axis in order to get this display:
So basically I first need to get rid of the tick and numbers (this I already searched and found a way to manage how to do it). The problem for me is to add my own custom String values on the x axis AND to have these positionned at specific position. I already have an arraylist with the Strings and another one with the position values, no need to calculate them, i just want to know how to use them with the plot.
Thank you in advance and, as usual, please tell me if my explanation needs to be clarified.
in order to change the content of the display, you need to change your query to have the output you like to see.
to change the position you may need to use something like:
categoryPlot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_90);
you need to show some of your code so that you can get the proper advice
I'm making a new private android app to take a picture, get your current location in WGS84, and at last send it all in an e-mail to your self.
I have send the mail with the content from the textfields, but I have made a button to get the your current location, but didn't know how to get your location and in same way also convert it to WGS84. I need to get it in this coordinatesystem, because it is used in a special sparetime activity, which uses this coordinatesystem.
Just forget the picture, the coordinate is more important.
Thanks in advance
Greetings Aksel
I'm not 100% sure if I got your question right. But you want to convert the location you get into WGS84 coordinatesm right? I'll guess you get your position via the Android LocationManager using something like: LocationManager.getLastPosition(). What you get is a Location . This location can be formated in different ways.
The questions is what exactly do you want? WGS84 is a reference system and does not say anything about the way coordinates are represented. A common representation are sphereical coordinates (also called Lat/Lon coordinates): Spherical Coordinates.
Another representation would be Cartesian coordinates. Maybe thats what you are looking for. To get cartesian coordinates you should use a 3rd party library.
I am developing a software, some kind of GPS. It has two sides. Admin(PC) and Clients(Android).
Android version use Osmdroid maps, and what I want to do is grab the Mappoint that I created in Android, insert it to the database and than read it from other devices.
The problem is that if the actual Latitude and Longitude of point that I create is for example 42.222222 and 23.55555, after doing this:
IProjection project = view.getProjection();
final GeoPoint geo = (GeoPoint)project.fromPixels((int)e.getX(),(int)e.getY());
*e is a motion event
the actual value that is stored in latitude and longitude of that GeoPoint is 42222222 or 2355555. The coma just disappears from that values, so it is useless to usage in PC version. I don't know how the OSMdroid is working with this values, but is there any way to convert it to its standard format like -42.584254 ?
I´ve just found a solution ,it must be just divided by 1E6 :)
I want to build an empty map that I can customize as I like. Now, I know how the whole system works with the tiles and lon/lat coords, but I still dont understand how to contect between my tile's pixels and the lon/lat. I want to have an empty map that shows only my country and that I can edit things the way I like (I work with Android - dont know if it matters).
Write a class which derives from the Overlay class and override the onTap() method. Then you can add your overlay to the your MapView. A GeoPoint object, which represents the position of you tap, is passed to the onTap() method when you tab somewhere on the map.
You also can use onTouchEvent(). Given the screen coordinates of the touch, you can use a Projection (from getProjection() on MapView) to convert that to latitude and longitude.
Here is a sample project.
I have a navigation program, and if there are 4 waypoints, I would like to highlight on the details list which part you are currently on, and also I could show the distance to the next waypoint and the total distance.
So, you may have:
Go right on Main Street, 1.3 miles
Go left on Broadway, .5 miles
Go left on Concord Blvd, 2 miles
But, how do I determine when a phone starts on a different waypoint.
Using the LocationManager you can set several ways for updates on a particular program. Use LocationManager.addProximityAlert() to be alerted if you're in a particular distance to a waypoint. Additionally you can use Location classes to get distance for example waypoint.distanceTo(currentLocation);.
The solution I am going with is to use a passive provider, so that if the navigator is being used then my application will still know where the user is.
Then, just keep track of where they were previously and where they are now, and look at the difference in how far they are from the waypoint, and once they get to a certain distance then let them know and change to the new waypoint.
The addProximityAlert made it difficult to know which waypoint to change to and it didn't work as well as I was hoping, and since I need to know where the user is to update their marker, there was no reason not to just add some calculations at the same time.