上传Android手机上的Web服务器上的大文件 [英] Upload large files on the web server on android

查看:140
本文介绍了上传Android手机上的Web服务器上的大文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Andr​​oid上传的Web服务器上的文件app.Currently我能够从设备,但比这更给了一个内存溢出异常上传5MB左右的文件,也使得应用程序很不稳定。

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.

我找的使用,我们可以在应用程序的背景加上大尺寸的上传数据的方法。任何教程/ code是高度AP preciated。

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.

先谢谢了。

推荐答案

您可能想看看<一个href=\"http://stackoverflow.com/questions/2599305/android-outofmemoryerror-while-uploading-video-how-best-to-chunk/3206047#3206047\">this从发布费奥多尔

主要的一点是,你需要在分块设置。

The main point is that you need to set on chunking.

例如

 connection.setChunkedStreamingMode(chunkSize); 

这篇关于上传Android手机上的Web服务器上的大文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆