MobileICP3 - Nikii1118/Web-Programming- GitHub Wiki

Nikita Goyal

Class ID-10

TASK


Earthquake Info App:

Create a mobile application with the following requirements

The main activity should be a list of earthquakes with information as shown below:

  1. On clicking any item Earthquake, the user must be directed to the webpage of USGS which contains further information about the earthquake in the web browser.

  2. Follow all the three TODO instructions in the QueryUtils.javafile and two more TODO instructions in the EarthquakeActivity.javafile and AndroidManifest.xmlto complete the functionality

Given API: Earthquake API

CODE:


Android Manifest.xml

  • In this file, we are adding internet permissions.

AndroidManifest

Queryutils.java

  • Create the URL GEt Request.
  • Open the connection

Queryutils

  • Parsing the json string
  • Fetched the values of msg,time,place and url

Queryutils1

  • API URL to fetch the request from USGS

EarthquakeActivity

  • Create a new intent to view the earthquake API

EarthquakeActivity1

OUTPUT


Earthquake APP

1. Showing list of earthquakes

earthquake-1

2. Redirecting to USGS website

earthquake-2

3. USGS website for more information

earthquake-3