Earlier in the course I described some strategies for working with images over the web using low-level classes from the Android SDK. But as with simple HTTP requests, you can greatly simplify your code by using a third-party library. For image management, many Android developers use Picasso, another library from Square.
- [Instructor] Earlier in the course,…I described some strategies for working…with images over the web using low level classes…from the Android SDK,…but as with simple HTTP requests,…you can greatly simplify your code for images…by using a third party library.…For image management, many Android developers use Picasso,…another project from Square.…In addition to automating downloaded images…and displaying them with imageView widgets,…Picasso also handles transformations,…including re-sizing and cropping images on the fly.…
It also caches images automatically…using both memory and persistent storage;…eliminating the need to create your own caching solutions.…I'm now working in a version of my project…that's using the lazy loading strategy I showed previously.…In the adapter for my RecyclerView,…I'm downloading each image only when I need it,…and I'm storing the image in memory.…I'm not using the version…that has my persistent storage caching solution.…Because this is the first time I've loaded this app,…as I scroll down, you'll see the images load slowly,…
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