Ubidots Community

Getting latest value of a variable of ubidots in android

what does the variable.getValues() return?
i mean in which order latest to first val of the var or first to latest of the variable.
Now i want to get the latest change in the variable ?
i want to store only 0/1 in a var what type should i choose ??

@juanda95 could tell you how to do that.

Best regards,

Hi @ayshwarya,

getValues() returns an array containing the Values from the latest value to the first value. If you want to get the last value you have on your Variable you just have to access the first position of the array:

Value lastValue = variable.getValues()[0]

You can choose a “Default” type Variable for only storing 0/1.

If you need more help, just ping me here using @ and my username(i.e.@juanda95) :smiley:

Hope you enjoy Ubidots!