To demonstrate using web services in Android apps, I'll be making requests to a web service for the same fictional company. The web service is available publicly, so you can see exactly how such requests behave in the real world.
- [Teacher] During this course,…I'll be using a sample web service…that's available on the public web…and I've also packaged the source code files…for the web service so you can install…it yourself if you like.…On the web, it's located at this URL…at 560057.youcanlearnit.net/services.…Under this directory, there's an Images subdirectory,…and here you'll find all of the images…that are displayed in my sample app.…I'll be using these copies of the images…when I'm working with the web service…rather than versions that are packaged…with the application locally.…
The other directories contain PHP files.…There's a phpinfo.php file,…and that'll tell you which version…of PHP is being used on this particular server.…Next there is a Database directory.…Under here you'll find an SQL file,…and this defines the structure…of the database that I'm using in the web service.…I have a table named Data Items…which has a number of columns,…and then a series of insert statements…that adds the data to the database.…Next there is a Connection file.…
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