0

I would like to create DataBase which rows will be: String model, String date production and list of Bitmaps converted to Strings. But I have no idea how can I create this list. Is there any possibility, for example, to create ArrayList in DataBase? or maybe there is another way to solve this problem.
I am beginner, so I ask for understanding and thank You for any tips

3
  • Sounds like you have a design problem. You would probably be better off by making a new table and have elements in that table relate to elements in this first table. Commented Jul 15, 2014 at 11:46
  • Do you mean, create Database contains String model, String date_production and some reference to DataBase composed of these Strings? Commented Jul 15, 2014 at 12:12
  • 1
    I don't really understand what you are asking, but what I mean is that you have two tables in your database. One for items that would be in the list of bitmaps you are talking about, and one that has the parent model with. The table with the bitmaps should have an ID column linking it to the elements in the models table. If you don't know what database tables or columns are, google it. Commented Jul 15, 2014 at 20:50

1 Answer 1

1

You have to create one string with some separator like |. If you want write one list of color.

white|blue|green|..

And write this in the database as string. Later to get all your colors you need to do this :

String strInDB = "white|blue|green";
String[] colors = strInDB.split(''|'');
ArrayList<String> myList = new ArrayList<String>(Arrays.asList(colors));
Sign up to request clarification or add additional context in comments.

5 Comments

I thought about something like that, but won't it be too long, if i write a couple of converted to String Bitmaps? and whether these Strings will not contain special characters?
I am sorry for not clearly specify. As Bitmap I mean Bitmap of images
Yeah, but they not exist a array type in all the SGBD. So, you need to create as many column than you have bitmap. Or use this trick ;)
Ok, thank you for your response. I am not good enough in this issue, so could you advise me, programmatically is it good option, if I would like to cut some String from this?
With bitmap I don't know. Try it and seen the final String size in memory :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.