📳
IT351G - Web Development - Programming of Mobile A
  • Course introduction
  • Links
    • Course plan
    • TimeEdit
    • Discord
    • YouTube
  • Guides
    • LenaSYS
    • Assignments (sv. duggor)
    • Buffer time (sv. respittid)
    • Add git hash to APK file name
  • Tools & Services
    • Git
      • Logical view
    • Github
      • Create a Github account
      • Fork a Github project
      • ...
    • Android Studio
      • Intellij
      • Gradle
      • Maven
      • Android SDK
    • Assignment: Tools & Services
  • WebView
    • WebView
      • WebView bindings
    • Assignment: WebView
  • User Interface: Widgets
    • Views
    • Layouts
    • RecyclerView
    • Assignment: Widgets
  • User Interface: Screens
    • Activities
      • Intents
    • Fragments
    • Object-orientation
    • Assignment: Screens
  • Networking
    • JSON data
    • HTTP networking
    • Assignment: Networking
  • Project
    • Project introduction
    • Assignment: Project repository
  • Persistence
    • Shared preferences
    • SQLite
    • Assignment: Persistence
  • External libraries
    • External libraries
    • Assignment: External libraries
Powered by GitBook
On this page

Was this helpful?

  1. Networking

HTTP networking

PreviousJSON dataNextAssignment: Networking

Last updated 5 years ago

Was this helpful?

HTTP networking is surprisingly complex. The first step is to allow the app to read the network state and to connect to the internet by adding the permissions in the application manifest AndroidManifest.xml.

<manifest xmlns:android="...">
    
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application ...

Second there is a choice of which HTTP client to use. In this course the only client that will be discussed is the HttpsURLConnection client which is provided by the Android plattform.

One of the factors that make HTTP networking is that it takes between data is requested and it being received. Due to this, networking has to be performed separate from the part of the app that manages the user interface. The network operation and the UI is executed in different threads.

...

Further reading:

Use HTTPSUrlConnection to fetch data