O'Reilly logo

Mastering Android Application Development by Antonio Pachón Ruiz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing and consuming content from Parse

Parse is a very powerful tool that allows us to not only consume content very easily but also to store content in the cloud database from our device, which is a tedious task to do using the traditional method.

For example, if we wanted to upload an image to a custom server from our device, we would have to create a POST request and send a form with the right encoding, while attaching the picture as a FileBody object in MultiPartEntity and importing the Apache HTTP libraries:

HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("URL TO SERVER"); MultipartEntity mpEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); File file = new File(filePath); mpEntity.addPart("imgField", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required