Ch 7: Using Internet Resources Flashcards

1
Q

Using Internet Resources:

Important Concepts

A
  • Android Network APIs
  • Creating Network Connections
  • Performing Network operations on Background Threads
  • Using View Model and Live Data
  • Parsing Files
  • Download Manager
  • Best Practices: Energy Conservation
  • Internet Services
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Android Network APIs:

Kinds of tasks they allow you to accomplish

A
  • Connect to remote server endpoints
  • Make HTTP requests
  • Process server results and data feeds
    • Use parser to process data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Android Network APIs:

Two connection types available

A

Mobile Internet:

  • GPRS, EDGE, 3G, 4G, LTE Internet access

Wi-Fi:

Private and Public Wi-Fi access points

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Android Network Connections:

Basic Considerations when using Internet Resources

A
  • Some connections will have very low bandwidth
  • Wi-Fi connections may be unreliable:
    • User might pass out of range
  • Mobile connections can be costly to the user due to data charges
  • Transmitting data drains power from the battery
  • Quantity of data transmitted should be minimized
  • App should be robust enough to handle:
    • Network outages
    • Bandwidth/Latency limitations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Benefits of a Native Internet Applications

vs

Web Apps accessed with Browser

A
  • Less bandwidth required
    • Only update things that change
  • Offline Availability
  • Lower Latency
  • Better UX
    • Consistent with OS
  • Reduce battery drain
    • using bundled connections
  • Access to native features
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Android Network APIs

Connecting to an Internet Resource:

Important Classes

A
  • URL
  • URLConnection
  • HttpURLConnection
  • InputStream
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Android Network APIs

Two Major Packages for Networking

A

java. net
android. net

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Android Network APIs

Connecting to an Internet Resource:

Basic Steps (HTTP Connection)

A

Add an INTERNET uses-permission node to the application manifest

Create a URL instance:

URL url = new URL(myFeed);

Open a connection, cast to connection type:

HttpURLConnection conn = (HttpURLConnection)url.openConnection();

Check the response code of the connection:

httpConnection.getResponseCode();

Get an InputStream from connection:

InputStream in = conn.getInputStream();

When done, disconnect:

conn.disconnect();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly