Image Gallery

Hello everyone
I would like to create a photo gallery in my android app. to reduce the size of the app I wish the pictures were downloaded from the Internet, but do not know which method to use.
I have to create a database?
I have to implement a server?
help me please

You could use a web server running either a database or hosting the images directly.
Alternative, if the images are already available in the internet, you could use a table with all image urls you want to include.

Database:
The advantage of using a database is that you’ve got more control over the images available and you can store additional information.

Direct storage:
Storing the images directly on the server is easier, as you can just use the WWW class.

User costs:
Be aware that in either case, the user needs internet connection, and in the case of mobile development, downloading images can cost the user lots of MB on his phone abonement.

Caching:
If you are okay with using lot’s of space AFTER the user installed the app, you could also download all images and store them on the disk.
Or, you could only store images which the user already viewed to prevent downloading the same image mutliple times.

Greetings
Chillersanim

@veleno94
I made this for my project, kind of what you need (ignore “book” variables, it`s specific for my project).

Flow:
Check if file exists (change the path to your path),
if exists, open the file (this way youd have to download it only the first time and not every time). if its not exist, download the file.

    using UnityEngine;
    using System.Collections;
    
        public class OnPressingPictureButton : MonoBehaviour {
        
        	public int currentPage;
        	public string [] imageURL;
        	public Book book;
        
        	public GameObject loading;
        
        
        // Update is called once per frame
        	void Update () {
        
        		currentPage = book.page;
        
        }
        
        
        void OnMouseDown ()
        {
        		loading.SetActive (true); //@@@ "Loading ON"
        
        
        		//Checking if the file exists in the users device
        		if (System.IO.File.Exists (Application.persistentDataPath + "/image"+currentPage.ToString()+".jpg")) 
        		{
        			//if yes, open it
        			loading.SetActive (false);
        			Application.OpenURL (Application.persistentDataPath + "/image"+currentPage.ToString()+".jpg");
        		} 
        
        
        		//if not, download it
        				else {
			StartCoroutine (TestDownload (imageURL [currentPage]));
			
		}
}
        
        	private IEnumerator TestDownload (string uRL)
        	{
        
        		WWW www = new WWW (uRL);
        		yield return www;
        
        		while (!www.isDone) {
        
        			Debug.Log (www.progress);
        			yield return null;
        		}
        
        
        		string savePath = Application.persistentDataPath + "/image"+currentPage.ToString()+".jpg";
        
        		byte[] bytes = www.bytes;
        
        		System.IO.File.WriteAllBytes (savePath, bytes);
        
        		loading.SetActive (false); //@@@ "Loading OFF"
        
        		Application.OpenURL (savePath);
        
        	}
        }