Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you doing this work on the main thread? I recommend using an <a href="http://developer.android.com/reference/android/os/AsyncTask.html" rel="nofollow">AsyncTask</a> with a <a href="http://developer.android.com/reference/android/app/ProgressDialog.html" rel="nofollow">ProgressDialog</a> so that the work is done in the background while your UI waits for the response. Using runnables for uploading is not a good idea. Any background thread that is built into android should have performance gains. Especially because the user will see an indeterminate progress dialog which is more pleasing than an app that is being held up for no known apparent reason.</p> <p>Alternatively if you are using an Amazon S3 server to store your uploads, you might want to use a third party library like <a href="https://github.com/jgilfelt/android-simpl3r" rel="nofollow">Simpl3r</a>.</p> <p>If an AsyncTask or Simpl3r aren't your cup of tea. An <a href="http://developer.android.com/reference/android/app/IntentService.html" rel="nofollow">Intent Service</a> is a great option for background uploads, as the uploading process is completely decoupled from your activity. When finished uploading you can update local storage data for when the user returns to that activity.</p> <p>1) There is no reason why you should need to change anything about an image to upload it. Especially if it is small.</p> <p>2) I recommend no callbacks. Use local storage, such as a database where you can then update the information locally once the upload has finished. When returning to the activity/fragment you began the upload, you can load this local data using an AsyncTask/AsyncTaskLoader/CursorLoader etc. Many options exist for changing live data in your app.</p> <p>3) Many patterns exist, some of my favorites I have listed here.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload