There is already a mobile application, the main purpose of which is to inform people about new pictures distributed in thematic catalogs. The size of the total number of pictures can be large (from 20 to 100 Gb). Catalogs with pictures will be on a remote server and automatically updated on user gadgets.

Task: it is necessary to find a way of these directories with pictures in a mobile application, while it is necessary to take into account the correct display and optimization of work so that the application does not hang when opening a large number of images. Note:

The catalog with pictures will be uploaded to the server by the owner (not the programmer, but an ordinary user) * apk-file (application). Pictures with directories should be displayed in the application on gadgets automatically from the server. The implementation on C # and display of pictures by the GridView method is desirable.

Closed due to the fact that the essence of the question is not clear to the participants: aleksandr barakin , Athari , Grundy , Pavel Mayorov , D-side 19 Apr '16 at 13:49 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Do you want to put 100G pictures on a user's mobile phone? o_O - VladD
  • and the minimum approximate volume, which advise? And not on the phone itself to hang a large amount, but on the server, and the phone will already cache only what the user of the phone wants. And as a matter of fact implementation of display from the server what can you advise? - user208111
  • I can advise cache repression. You can store pictures, and when the total size P is reached, delete the one you have not addressed for the longest time. Question: what is equal to P? Here I would advise taking as a function of min ([free space] * 0.1, 1Gb). And store the photo here - cacheDir ( developer.android.com/intl/ru/reference/android/content/… ), in the folder for the cache. - Manushin Igor

1 answer 1

Here you can advise to do about the same way they do social. network:

  1. For each user, the server will be able to come up with an update feed itself (I will describe options below)
  2. The client receives a list of id-shnikov pictures, and the id must contain the path (or paths) storage.
  3. When you open a client, a request to the server occurs in the form of "give me 100 latest news, starting with the first one", the client receives a list of id shnik.
  4. The client shows the Grid with a bunch of pictures, each of which has the text "download" (or you can use text instead of a picture, it does not matter)
  5. The client launches all the pictures in order of news (that is, the newest ones before) in M ​​streams (in order to get 10% of downloaded pictures instead of having 10% of the load on each picture). M should be selected by tests, it all depends on the size of the data and speeds. All downloads are in the background thread, after the end it is sent to the UI in the appropriate field.
  6. From the user's point of view, the pictures gradually begin to appear, one by one.

How to make a server: 1. If you have a database, and all identifiers are stored there (but not pictures), then you have to simply select ... order by priority, where priority can be calculated, for example, as "novelty" + "tags, which the user likes + proximity to the user. 2. If all users receive the same list of updates, then you can simply store txt / xml / json on the server and sometimes update it. It should be recorded these same id in chronological order. And the server simply gives the necessary lines.

How to create an id: 1. Let us have N content servers. Each picture is stored on M of them and has its own guid (brute force protection). 2. Then id is our guid and server list. That is, to upload a picture, the client should refer to the url of the form https: // {server} / images / {guid} .jpg 3. Ideally, if the server did not respond, then you should try another one. And of course, also ideally, to make requests to different servers in order to balance the load.

How to upload images: 1. Create a separate application / web page. 2. The user selects pictures, presses download. 3. For each picture: the user goes to the database, is determined with a list of servers, copies to each image via a network ball, writes a transaction to the database.

This is the simplest implementation, which, of course, can be expanded. Here, the client keeps everything in memory, the server doesn’t really care about authorizations, etc. However, as I understand it, this is what you need.

About more detailed implementation: what exactly are you interested in? How to make pictures with squares? Or how to request them from the server?

  • Many thanks for the response !!! But there are still questions. - user208111