Is there some type of variable or object in Java (Android) to save GPS positions, that is, each point is made up of latitude and the other longitude?
For example, to be able to save the location of Madrid :
Latitude: 40.416775
Longitude: -3.703790
and that allows you to add multiple locations, like a list.
A simple example of use and how to add is added based on @Fabricio's answer :
You can add it like this (selecting the revision/version you want):
You can check for more information here: https://developers.google.com/android/guides/setup
About the second part of your question you can create an
array
orlist
or whatever you need from the objectLatLng
.Simple example based on
pointY[]
, andpointX[]
(The dots are random numbers):The Object you mention is found in the Google Maps library for Android and is
LatLng
, if you are not using this library you can create a class that is composed of a Latitude(double
) and a Longitude(double
).Here is the link to the class documentation .