问题
I want to upload files on a web server in my android app.Currently i am able to upload files around 5mb from the device but more than this gives a outofmemory exception and also makes app very unstable.
i am looking for a method using which we can upload the data in the app background plus of bigger size. Any tutorials/ code is highly appreciated.
thanks in advance.
回答1:
You probably want to check out this post from Fedor.
The main point is that you need to set on chunking.
e.g.
connection.setChunkedStreamingMode(chunkSize);
来源:https://stackoverflow.com/questions/3351742/upload-large-files-on-the-web-server-on-android