Answer the question
In order to leave comments, you need to log in
How to display random text+image on WP8.1?
We need to make an application for WP8.1 (c# + xaml), at the start of which there will be a random image and text to it on the main screen.
There will be about 30 images with descriptions in total.
How to store all this goodness? Texts in string-resources, and pictures as files? Or in db?
And if in a DB, how to deduce?
Poke your nose in which direction to google.
Answer the question
In order to leave comments, you need to log in
Storing images in a database is not a good practice .
If localization is planned, then the text in the resources, pictures are also as resources. If not planned, then you can store images with resources and have a json file with objects like { text: 'some text', image: 'image path' } on disk (it will be possible to edit on the fly).
I repeat the answer above
, it is better to store tables in the database in which there will be id, name, description and path to the file, and after that you can make a selection
and
say something random?)
do var rnd = new random ();
this is obtained by id
and create a sql query query opening, etc.
for example "SELECT Name,Options,Path FROM myTable WHERE id = " + rnd.Next(table size); and all profit :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question