Hola Neftali,
Lo que necesito es tomar datos de hora y fecha de la localizacion. Esta informacion debe tomarse del GPS y no del telefono.
Consegui un codigo donde aparentemente hace eso usando variables del tipo JObjetc y JLocation.
Código Delphi
[-]
procedure TForm1.Button1Click(Sender: TObject);
var
LocationManagerService: JObject;
location : JLocation;
begin
if not Assigned(FLocationManager) then
begin
LocationManagerService := SharedActivityContext.getSystemService(TJContext.JavaClass.LOCATION_SERVICE);
FLocationManager := TJLocationManager.Wrap((LocationManagerService as ILocalObject).GetObjectID);
if not Assigned(locationListener) then
locationListener := TLocationListener.Create(self);
FLocationManager.requestLocationUpdates(TJLocationManager.JavaClass.GPS_PROVIDER, 10000, 10, locationListener,
TJLooper.JavaClass.getMainLooper);
end;
location := FLocationManager.getLastKnownLocation(TJLocationManager.JavaClass.GPS_PROVIDER);
Memo1.Lines.Add(location.getTime.ToString);
end;
Código Delphi
[-]Androidapi.JNI.JavaTypes, Androidapi.JNI.Location, System.Sensors,
System.Sensors.Components, Androidapi.Helpers,
Androidapi.JNI.GraphicsContentViewText, Androidapi.JNIBridge,
System.Android.Sensors;
Creo que estas son las unidades a declarar. Intentare con ellas y luego comento como me fue.