Description
What does Windows Location Provider use to determine geographic location?
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
The Windows Location Provider uses data from Wi-Fi access points to calculate latitude and longitude AND determine geographic location.
Completion Status:
100%
Review
Review
Anonymous
Great content here. Definitely a returning customer.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
Saudi Electronic University Three Biggest Threats from Hackers Discussion
Identify three of the biggest risks that corporations must confront from intruders/hackers. Provide three recommendations ...
Saudi Electronic University Three Biggest Threats from Hackers Discussion
Identify three of the biggest risks that corporations must confront from intruders/hackers. Provide three recommendations about how employees can guard against these attacks.
Security Policy Creation
Read the following ScenarioYou are appointed as an information technology (IT) security manager in the XYZ health care org ...
Security Policy Creation
Read the following ScenarioYou are appointed as an information technology (IT) security manager in the XYZ health care organization. This large, publically traded health care organization has 25 sites across the region with 2,000 staff members and thousands of patients. Sean, your manager, has asked you to analyze the current state of the corporation and then identify an appropriate IT security policy framework. He wants to know how you would approach this task. How you would analyze your organization and how you would select an appropriate security policy framework?
8 pages
Travlr Getaways.edited
Defined the system focusing on API endpoints and the Fill in all bracketed information on page one (the cover page), the D ...
Travlr Getaways.edited
Defined the system focusing on API endpoints and the Fill in all bracketed information on page one (the cover page), the Document Revision History ...
4 pages
User Access Policies
All the policies are meant to enable the provision of information systems with better security levels attainable via confi ...
User Access Policies
All the policies are meant to enable the provision of information systems with better security levels attainable via configuration control by ensuring ...
make sure you do the extra credit
SUMMARY
You will be calling a weather web service that provides current weather info for a given city and comparing ...
make sure you do the extra credit
SUMMARY
You will be calling a weather web service that provides current weather info for a given city and comparing the weather between two cities the user provides.
This lab will involve the following new features:
Consuming a REST web service.
Utilizing Google’s Gson library to convert json to java objects.
DETAILS
Create a normal java application project like we’ve done before.
Download the gson jar file provided with this lab. You need to add the jar file to your project like we've done in the past (see previous postings on how to do this).
First create the java classes that the gson library will fill with incoming json data.
These java classes will model the json that is returned from the weather web service.
Here is what the returned json looks like:
{ "coord":{"lon":-116.96,"lat":32.79}, "weather":[ {"id":800,"main":"Clear","description":"clear sky","icon":"02d"} ], "base":"stations", "main":{ "temp":71.6, "pressure":1019, "humidity":14, "temp_min":68, "temp_max":75.2 }, "visibility":16093, "wind":{"speed":2.95,"deg":234}, "clouds":{"all":5}, "dt":1479581760, "sys":{ "type":1, "id":476, "message":0.1939, "country":"US", "sunrise":1479565376, "sunset":1479602637 }, "id":5345529, "name":"El Cajon", "cod":200 }
All we care about is getting the value “name” and values from “main” like “temp” “temp_min” and “temp_max”.
So we will 2 create java classes to mirror this relationship:
IMPORTANT: Remember that you can add a package from the File > New menu. All these files go in “com.grossmont.ws”. When you create a new class, just right click on the package folder you want to add the class to.NOTE: You’ll notice that the instance variable names below match the json fields passed back. That matching is necessary for gson to be able to map the json to your fields.
Weather_main.java
This is just the “main” object portion of the json that holds the below fields.
Package: com.grossmont.ws
Create five public instance variables:
All are float type -- temp, pressure, humidity, temp_min, temp_max
You’ll notice that in the above json sample, there is a mapping of main and inside main are these five variable names.
Weather.java
This is the root object that holds the top most fields in the returned json.
Package: com.grossmont.ws
Create two public instance variables:
main – this is Weather_main type that you built above.
name – this is String type.
WeatherServiceManager.java (this class was provided to you with this lab doc).
You need to put this file in the src/com/grossmont/ws folder in your project.
You will fill in code where you see the ######## markings:
Simply follow the guidelines in the java file.
You are essentially wiring in the classes you just created to methods that retrieve data from them.
EXTRA CREDIT option (5 points)
Use these classes in a web site in Tomcat, and use JSP pages to get user input for just one city and show the three values for that city (current temp, high, low).
Look back to lab 9 as a guide on how to put your class package folders into a …/WEB-INF/classes folder and how to instantiate and use your class in a JSP page.
Reminder – since we’re using the gson jar file, you’ll need to put this in a …/WEB-INF/lib folder.
You should have two JSP pages:
one to get a city from the user in a form which submits those values to the second page.
A second page to process the submitted user city.
It needs to import and instantiate your WebServiceManager class.
It needs to get the incoming parameter of city.
It needs to take out any spaces (see main method in WebServiceManager class).
It needs to display current temp and high & low.
TURNING IN LAB:
Turn in the above 3 files into your lab 11 assignment spot in Canvas.
If you did the extra credit, also turn in your two jsp pages.
IMPORTANT: DO NOT ZIP your folders/files please.
Similar Content
CSE 310 ASU Vertices Questions
CSE310 Spring 2021
First Name:
Homework 04 Answer Sheet
Submit on Gradescope
Last Name:
Q1: Read the instructions for...
Critical Thinking- 10
Encryption of Data at RestLearning Objective: Discuss the encryption process of data at rest.Assignment RequirementsWrite ...
NCP3 TASK 1: IT Operations Plan
Task 1: IT Operations Plan
IT Operations Plan
Course:
Student Name:
WGU ID:
Date:
PAGE 1
Task 1: IT Operations Plan
A...
Campbellsville University Business Process Redesigning Paper
If you have you been involved with a company doing a redesign of business processes, discuss what went right during the re...
ISSC422 Central Texas College Security Administration Discussion
Hello,I need two responses of at least 150 words each for the below students discussions for this week. Also in the bold b...
Security Topic Of the Week (STOW) Leadership
The Security Topic Of the Week (STOW) assignment is designed to allow each student to lead
a discussion on a cybersecurit...
Summary 1
In every strategic planning procedure, SWOT analysis is a very crucial element. Ideally, SWOT analysis comprises an all-in...
Virtual Reality And Its Impact On Modern World
Technological advancements have transformed how people and businesses operate. Technology, in itself, is very dynamic and ...
Management Information Systems
The authors for this article are Matthias Braun, Patrik Hummel, Susanne Beck, and Peter The article was received on Septem...
Related Tags
Book Guides
How to Win Friends and Influence People
by Dale Carnegie
The Outsiders
by S.E. Hinton
Girl Stop Apologizing
by Rachel Hollis
The Kite Runner
by Khaled Hosseini
The Woman in the Window
by A. J. Finn
Normal People
by Sally Rooney
Cry the Beloved Country
by Alan Paton
A Separate Peace
by John Knowles
Bridge to Terabithia
by Katherine Paterson
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
Saudi Electronic University Three Biggest Threats from Hackers Discussion
Identify three of the biggest risks that corporations must confront from intruders/hackers. Provide three recommendations ...
Saudi Electronic University Three Biggest Threats from Hackers Discussion
Identify three of the biggest risks that corporations must confront from intruders/hackers. Provide three recommendations about how employees can guard against these attacks.
Security Policy Creation
Read the following ScenarioYou are appointed as an information technology (IT) security manager in the XYZ health care org ...
Security Policy Creation
Read the following ScenarioYou are appointed as an information technology (IT) security manager in the XYZ health care organization. This large, publically traded health care organization has 25 sites across the region with 2,000 staff members and thousands of patients. Sean, your manager, has asked you to analyze the current state of the corporation and then identify an appropriate IT security policy framework. He wants to know how you would approach this task. How you would analyze your organization and how you would select an appropriate security policy framework?
8 pages
Travlr Getaways.edited
Defined the system focusing on API endpoints and the Fill in all bracketed information on page one (the cover page), the D ...
Travlr Getaways.edited
Defined the system focusing on API endpoints and the Fill in all bracketed information on page one (the cover page), the Document Revision History ...
4 pages
User Access Policies
All the policies are meant to enable the provision of information systems with better security levels attainable via confi ...
User Access Policies
All the policies are meant to enable the provision of information systems with better security levels attainable via configuration control by ensuring ...
make sure you do the extra credit
SUMMARY
You will be calling a weather web service that provides current weather info for a given city and comparing ...
make sure you do the extra credit
SUMMARY
You will be calling a weather web service that provides current weather info for a given city and comparing the weather between two cities the user provides.
This lab will involve the following new features:
Consuming a REST web service.
Utilizing Google’s Gson library to convert json to java objects.
DETAILS
Create a normal java application project like we’ve done before.
Download the gson jar file provided with this lab. You need to add the jar file to your project like we've done in the past (see previous postings on how to do this).
First create the java classes that the gson library will fill with incoming json data.
These java classes will model the json that is returned from the weather web service.
Here is what the returned json looks like:
{ "coord":{"lon":-116.96,"lat":32.79}, "weather":[ {"id":800,"main":"Clear","description":"clear sky","icon":"02d"} ], "base":"stations", "main":{ "temp":71.6, "pressure":1019, "humidity":14, "temp_min":68, "temp_max":75.2 }, "visibility":16093, "wind":{"speed":2.95,"deg":234}, "clouds":{"all":5}, "dt":1479581760, "sys":{ "type":1, "id":476, "message":0.1939, "country":"US", "sunrise":1479565376, "sunset":1479602637 }, "id":5345529, "name":"El Cajon", "cod":200 }
All we care about is getting the value “name” and values from “main” like “temp” “temp_min” and “temp_max”.
So we will 2 create java classes to mirror this relationship:
IMPORTANT: Remember that you can add a package from the File > New menu. All these files go in “com.grossmont.ws”. When you create a new class, just right click on the package folder you want to add the class to.NOTE: You’ll notice that the instance variable names below match the json fields passed back. That matching is necessary for gson to be able to map the json to your fields.
Weather_main.java
This is just the “main” object portion of the json that holds the below fields.
Package: com.grossmont.ws
Create five public instance variables:
All are float type -- temp, pressure, humidity, temp_min, temp_max
You’ll notice that in the above json sample, there is a mapping of main and inside main are these five variable names.
Weather.java
This is the root object that holds the top most fields in the returned json.
Package: com.grossmont.ws
Create two public instance variables:
main – this is Weather_main type that you built above.
name – this is String type.
WeatherServiceManager.java (this class was provided to you with this lab doc).
You need to put this file in the src/com/grossmont/ws folder in your project.
You will fill in code where you see the ######## markings:
Simply follow the guidelines in the java file.
You are essentially wiring in the classes you just created to methods that retrieve data from them.
EXTRA CREDIT option (5 points)
Use these classes in a web site in Tomcat, and use JSP pages to get user input for just one city and show the three values for that city (current temp, high, low).
Look back to lab 9 as a guide on how to put your class package folders into a …/WEB-INF/classes folder and how to instantiate and use your class in a JSP page.
Reminder – since we’re using the gson jar file, you’ll need to put this in a …/WEB-INF/lib folder.
You should have two JSP pages:
one to get a city from the user in a form which submits those values to the second page.
A second page to process the submitted user city.
It needs to import and instantiate your WebServiceManager class.
It needs to get the incoming parameter of city.
It needs to take out any spaces (see main method in WebServiceManager class).
It needs to display current temp and high & low.
TURNING IN LAB:
Turn in the above 3 files into your lab 11 assignment spot in Canvas.
If you did the extra credit, also turn in your two jsp pages.
IMPORTANT: DO NOT ZIP your folders/files please.
Earn money selling
your Study Documents