So far, I’ve only downloaded text-based content in JSON format. Now I'd like to retrieve photos from the web and display those as well. My goal is to show how to do this work with classes from the Android SDK, but it's worth mentioning that I'll show a much easier way to do this later with a third-party library named Picasso.
- [Instructor] So far, I've only downloaded…text-based content to my application.…Now, I'd like to retrieve photos from the web…and display those as well.…I'll show you where the photos are on the website.…In this version of my project, in the MainActivity class,…I've added a definition of an AsyncTaskLoader…that I'll be using later on in this demo.…It's down at the bottom of the activity,…and it's named ImageDownLoader.…And within that class, I've defined a constant…named PHOTOS_BASE_URL.…I'll select and copy that URL,…then I'll go to my browser and paste and go,…and there's all the images that I'm going to be using.…
There's an image of an apple pie,…one of artichokes, and so on.…And each of these images is referenced…in the web services, so, for example,…if I got to the XML version of the web service,…I'll see that the apple pie has an item name of Apple Pie,…and an image of apple_pie.jpg.…I'm going to use the item name to reference the graphic,…and download it when I need it to display.…I'll come back to the project.…
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