Once you've created code in an Android app to package up HTTP parameters, and then send those parameters with a GET request, it takes just a little bit more code to send the same data with a POST request.
- [Instructor] Once you've created code in an Android app…to package up HTTP parameters,…and then you send those parameters with the GET request,…it takes just a little bit more code…to send the same data with the POST request.…In HTTP, a POST and a GET request are different.…In a GET request, the parameters are appended to the URL…but in a POST request,…they're placed into the body of the request…and so you need a slightly different programming structure.…I'm working in a version of my project…that picks up where the previous project left off.…
I still have my requestPackage class…where the default method is GET.…I'm now going to go to the main activity class…and change that to a method of POST…with the requestPackage.setMethod…and I'll set it to POST…and everything else in the main activity…will remain the same.…Now if I run the application at this point…and I request the data, I'll get everything…even though I said I wanted to send in a parameter,…I've changed the method and I don't have…any way in my code yet to handle POST parameters.…
IInstructor David Gassner starts with an overview discussion about available networking strategies, and then dives into how to declare networking permissions, make network requests, handle responses, parse data returned from a web service, and pass user credentials to services that support HTTP basic authentication. He also provides an overview of popular higher-level networking libraries, including OkHttp and Picasso, and offers recommendations for improving performance in network-connected apps. David also covers using static feeds, using dynamic PHP pages hosted on a public server web service, and integrating apps with network data storage.
- Integrating mobile apps
- Communicating with Android
- Preventing app freezes with background threads
- Preparing an app for network communication
- Declaring permissions
- Checking network connectivity
- Retrieving data over the web
- Using traditional APIs
- Using third-party libraries