C
C
Chvalov2015-08-30 12:55:13
Java
Chvalov, 2015-08-30 12:55:13

Where can I store the values ​​at the time of the robots of the application and work with them?

At startup, a command is executed that receives an array, something like this:
{1, 3, 22, 88, 64, 40, 2, 12, 55, 69}
I need to bring them into memory, and then compare them with those that will come further
, if the same array came, then everything is OK, but if it came with other data, an action is needed.
So, where can I store this data so that when I finish working with the application, they are destroyed.
Need temporary storage of data (arrays of int)
Or just get data from an array and write them to variables and then compare ???

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
Dimonchik, 2015-08-30
@dimonchik2013

all the guys from Mozilla to Skype use SQLite
developer.android.com/reference/android/database/s...

V
Vitaly Vitrenko, 2015-08-30
@Vestail

Serialization

A
Alexey Cheremisin, 2015-08-30
@leahch

Everything strongly depends on the application, it is possible in the application itself in a singleton, you can write to the database, you can use memcached, redis .... In general, the simplest is the singleton + syncronize ...

T
Tiberal, 2015-08-31
@Tiberal

You can store it in the fragment / activity in which this comparison occurs so as not to overload the application with all sorts of configs and databases for such a simple task. It is only important to ensure that this data does not disappear anywhere if, for some reason, the fragment / activity is recreated

R
Rustem Saitkulov, 2015-08-31
@atetc

It is best to agree with the backend developer to use the ETag mechanism ( https://ru.m.wikipedia.org/wiki/HTTP_ETag ) and not suffer from storage / comparison issues. If there were no changes on the backend, just return an empty response with a 304 code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question