I
I
ivanfenenko2014-04-08 16:29:02
Java
ivanfenenko, 2014-04-08 16:29:02

How to store float[][] in SQLite (Android)?

Need to save n float[200][200] arrays to android SQLite database.
One solution would be to have n * 40K records with indexes and values, but it's not trustworthy.
I also came across a hint about how to convert an array to a BLOB, but I still don't understand how to do it.
Is there any other way? Or explain how to make a blob out of float[][] .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gleb_kudr, 2014-04-09
@gleb_kudr

You need to convert your 2D float[][] to a long byte[]. This is done by serialization. I don’t remember how it is in Java, but 100% there are ready-made tools for this. You can write your own out of sporting interest.

A
Andrey Vershinin, 2014-04-09
@WolfdalE

Serialize.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question