Completed news reader app for AWD 1112 Unit 03.
Fetches the latest NPR Tech News from this API endpoint:
https://feeds.npr.org/1019/feed.json
Source: NPR now supports JSON Feed!
Initial version of news reader.
- Layout
- Permissions
- IO classes: URL, HttpURLConnection, InputStream, BufferedReader, InputStreamReader, Exceptions
- try-with-resources statement
- Does not work due to making network requests on main thread.
Using AsyncTask to offload network request to a background thread.
- AsyncTask
- FetchResult
- FetchTask
- Processes and threads overview
- Better performance through threading
- Exceed the Android Speed Limit
Checking connectivity with ConnectivityManager.
- Reading network state
- ConnectivityManager
- isConnected()
- API Deprication: getActiveNetworkInfo() and NetworkInfo
- API Deprication: instantaneous state vs network events
Listening to network events with ConnectivityManager.NetworkCallback.
- Reading network state
- ConnectivityManager.NetworkCallback
- ConnectivityManager.registerDefaultNetworkCallback()
- Vector Icons
- Activity.runOnUiThread()
Using Thread primitives to replace the deprecated AsyncTask class.
- Thread
- Activity.runOnUiThread()
- Task cancellation
Using Retrofit to make HTTP requests and GSON to parse the response.
- Retrofit - Official Tutorial
- Retrofit - GitHub Repository
- GSON - User Guide
- GSON - GitHub Repository
- JSON Language Specification
Migrating project to follow modern arhcitecure patterns using ViewModel and LiveData.
Displaying the list of news stories using a RecyclerView.
Displaying the header image for the news stories using Picasso.