Creating Directory in Runtime

Hi guys,

I need creating one directory in the device for saving and retrieve images in runtime.

The problem:

1-create the directory on the device and saving the images in runtime
2-retrieve the images create in the directory

Any idea how to do this?

Searching in the wiki and not find nothing about the subject.

How are the images created?

The images already exist in a directory on the website, the app will download these images that will be saved to the device in the directory created at runtime.

I need to create the directory on the device in runtime and download these images from the directory on the website to the directory created on the device, and display in a ListView

Are these images downloaded with the app, or could they change at any time?

Yes, the images will be downloaded by the app, and they are fixed in a directory on the website provider, the location of the images is fixed, it will not change.

App Flow
1-User registers the image on the website, which is recorded in a web directory.
2-App connects to website
3-Checks if there are images in the user’s directory
4-If they exist, create in the app the directory in the device with the same name of the directory of the website
5-Download the images to the directory created on the device
6-Display these images in a ListView

Another option would be:
1-User saves the images in MySql on the website
2-App connects to the webservice and saves the images locally in SQLite on the device.
3-App reads from SQLite and shows the images in the ListView

Is it possible to use the second option?
If yes, how to get the MySql images and write to SQLite, and display them in the ListView?

The desired result in the App is this:

As you can see in the image above, my App shows these images from the local directory created on the desktop for development testing. The required result is shown in the image above.

You lost me in the first sentence. I asked “Are these image downloaded with the app?” and you answered “the images will be downloaded by the app.” These are possibly different things.

The question is whether the app has a fixed set of images which is installed at the same time as the app, of does each user have a different set of images which can change over time?

Yes, each user has their set of images and they are not installed with the app, these images can be changed by the user, added, updated and excluded by the app.

I like your second option, where you store the images in the database. If you store them in Base64 format, they are bigger, but easier to move around.

You can display a Base64 image just like you would a normal image.

1 Like

Ok. What did you mean by Base64? What kind of field should I create in the table in SQLite?

Types of fields:

Image, Photo, Graphic, Picture, Blob

Which one to use?

Here is Wikipedia on Base64:

It’s nothing more than the image converted to a string of printable characters. Treat it as a string.

Yes man, that’s what I’m talking about.
Simple questions and great answers to simple solutions.
I will be publishing soon all the solutions we had, let’s make AppStudio the best tool for development.
Whether for beginners or experts!
I am very satisfied with AppStudio, but we can improve and we will improve its functionality through the exchange of information.

My App is working.

Thank you George.