Skip to content

Upload Service Testbed

Alex Gotev edited this page Oct 19, 2020 · 18 revisions

When signaling an upload issue, be sure the problem you're facing can be replicated with the upload service testbed, otherwise it may be a network error, your server error or a device specific error which is not related to the library.

If the error can be reproduced, describe the steps to reproduce and add the following to the issue:

  • Android version used in the emulator
  • LogCat output
  • Demo Server output

How to create the testbed

  1. Get Upload Service Demo Server. Run the demo server in a terminal window and keep it open.

  2. Get the example app from here or directly from sources:

    git clone https://github.com/gotev/android-upload-service.git
    

    Open Android Studio and open the project located in examples/app

  3. Run the demo app on an emulator. Set LogCat to display only output from package net.gotev.uploadservicedemo at debug level. Read below to use a physical device.

  4. Open your emulator's or device's browser and download a file from here: https://www.thinkbroadband.com/download It will be stored in the Downloads directory. There are files of different sizes useful for upload testing.

  5. get back to the demo app and:

    • tap on "New Multipart Upload"
    • copy the multipart URL from the server's terminal window (e.g. http://192.168.1.132:3000/upload/multipart) and paste into the appìs text field (long click on the field, release and then select Paste from the popup window). If copy/paste from your computer to your emulator is not working, check emulator clipboard sharing settings and reboot it. In the worst case, type in the address manually.
    • click on "Add file", type "file" and click on next
    • select the file you downloaded at step 4
    • tap on the checkmark in the upper right corner to start the upload
  6. wait for the upload to complete

Using your physical device

Instead of running the demo app in an emulator, you can also use your physical device. Be sure both your computer and the device are connected to the same WiFi network and that there's no client isolation configured on the access point. Most basic way of detecting this is to ping the device from your computer or to ping your computer from your device. If it's working, then your setup is ok.

Using your own app with the demo server

After you're sure everything works using the demo server and the demo app, you can also use your own app against the demo server to see if everything works like you expect and that all the datas are sent to the server. Just change the URLs in your uploads using those of the demo server. You may also modify demo server's responses to match your own real server response data format. It's pretty easy, the demo server consists of a single js file which you can edit and re-run on the go.

This is useful to ensure your app is working like expected and to debug issues happening on your own production server or app.