[SOLVED] Android getting history location from ubidots (ubidots gps tracker )

Hi ( I’m new here ) I installed ubidots gps tracker application on my phone …I have the values of my geopoints in a variable , I want to to get and read the values of Latitude and longitude in my app
I don"t know how to do that …please help

Hello,

Sure, you can refer to the post Getting data from Ubidots using Android Studio, it has a question somewhat related to yours.

hi thank u for your response

I saw how to get values with battery level example …but in my case it"s diferent I want to get data saved in Context (lat and lng )

Oh! I just saw the library and it seems there’s not an easy way to obtain the context from a Value.

I’ll do a PR today at afternoon (UTC -5) adding that capability.

Thanks so much for the report, I’m sure they will push the update fast to Maven Central so you can use it as soon as possible.

I’ve made the Pull Request for adding this feature. In the meantime (while they approve it and is uploaded to Maven Central), I’ll show you how to use it.

I suppose that you already know how to get a Value using this library, so you may already have something like:

Value value = variable.getValues()[0];

Now, to get the context, you just have to call the getContext() method:

Map<String, Object> contextValue = value.getContext();

Et voila!
Hope this help you.

Awsome … …Thank you so much for your help :slight_smile: