Question

In an application that uses Google Maps, what is the main usage of the class Geocoder?...

In an application that uses Google Maps, what is the main usage of the class Geocoder?

What is the main benefit of using AsyncTask to execute IO operations?

The following piece of code is an excerpt from a class extends AsyncTask. When and on what thread does onPostExecute execute?

 private class GetExam extends AsyncTask<String, Integer, String> {
        @Override
        protected void onPostExecute(String value) {
        }

Briefly explain the role and data type of param.

  WebView myWebView =  findViewById(R.id.webview);
   myWebView.setWebViewClient(new WebViewClient());
   myWebView.loadUrl(param);
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. What is the main usage of the class Geocoder:

Allows for the conversion between an address and geographical coordinates.

2. What is the main benefit of using AsyncTask to execute IO operations:

Asynctask allows us to perform long lasting tasks/background operations on IO and show the result on the UI thread without affecting the main thread. Not blocking main UI thread is the main benefit

3. On what thread does onPostExecute execute

PostExecute executes on UI Thread

  1. onPreExecute() : invoked on the UI thread before the task is executed.
  2. doInBackground(Params...) : invoked on the background thread immediately after onPreExecute() finishes executing.
  3. onProgressUpdate(Progress...): invoked on the UI thread after a call to publishProgress(Progress...).The timing of the execution is undefined.
  4. onPostExecute(Result) : invoked on the UI thread after the background computation finishes. The result of the background computation is passed to this step as a parameter.

4. role and data type of param:

dataType: String

Role: It is path of url, relative path to the resource we would like to load in the WebView.

It can be either asset path as :

"file:///android_asset/index.html"

or url of remote site as - "https://www.google.com"

Add a comment
Know the answer?
Add Answer to:
In an application that uses Google Maps, what is the main usage of the class Geocoder?...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • class x { x () {} private void one () {} } public class Y extends...

    class x { x () {} private void one () {} } public class Y extends x { Y() {} private void two () { one(); } public static void main (String[] args) { new Y().two(); } } What changes will make this code compile? a. Adding the public modifier to the declaration of class x b. Adding the protected modifier to the x() constructor c. Changing the private modifier on the declaration of the one() method to protected d....

  • The method m() of class B overrides the m() method of class A, true or false?...

    The method m() of class B overrides the m() method of class A, true or false? class A int i; public void maint i) { this.is } } class B extends A{ public void m(Strings) { 1 Select one: True False For the following code, which statement is correct? public class Test { public static void main(String[] args) { Object al = new AC: Object a2 = new Object(); System.out.println(al); System.out.println(a): } } class A intx @Override public String toString()...

  • Consider the following codes: public class TestThread extends Thread {     public static void main(String[] args)...

    Consider the following codes: public class TestThread extends Thread {     public static void main(String[] args) {         TestThread thread = new TestThread();     }     @Override     public void run() {         printMyName();     }     private void printMyName() {         System.out.println("Thread is running");     } } Test Stem / Question Choices 1: What method should you invoke to start the thread TestThread? A: start() B: run() C: No. Thread will run automatically when executed. D: TestThread is not...

  • What is output? public abstract class People { protected string name; protected int age; public abstract...

    What is output? public abstract class People { protected string name; protected int age; public abstract void PrintInfo(); public void PrintInformation() { System.out.println("In Base Class People"); public class Teacher extends People { private int experience; public void PrintInfo() { System.out.println("In Child Class Teacher"); public class Principal extends Teacher { public void PrintInformation() { System.out.println("In Child Class Principal"); public static void main(String args[]) { Principal tim; tim = new Principal(); tim.PrintInfo(); In Base Class People Error: Compiler error In Child Class...

  • Error: Main method not found in class ServiceProvider, please define the main method as: public static...

    Error: Main method not found in class ServiceProvider, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application This is the error im getting while executing the following code Can you modify the error import java.net.*; import java.io.*; public class ServiceProvider extends Thread { //initialize socket and input stream private Socket socket = null; private ServerSocket server = null; private DataInputStream in = null; private DataOutputStream out = null; private int...

  • For Questions 1-3: consider the following code: public class A { private int number; protected String...

    For Questions 1-3: consider the following code: public class A { private int number; protected String name; public double price; public A() { System.out.println(“A() called”); } private void foo1() { System.out.println(“A version of foo1() called”); } protected int foo2() { Sysem.out.println(“A version of foo2() called); return number; } public String foo3() { System.out.println(“A version of foo3() called”); Return “Hi”; } }//end class A public class B extends A { private char service; public B() {    super();    System.out.println(“B() called”);...

  • For Questions 1-3: consider the following code: public class A { private int number; protected String...

    For Questions 1-3: consider the following code: public class A { private int number; protected String name; public double price; public A() { System.out.println(“A() called”); } private void foo1() { System.out.println(“A version of foo1() called”); } protected int foo2() { Sysem.out.println(“A version of foo2() called); return number; } public String foo3() { System.out.println(“A version of foo3() called”); Return “Hi”; } }//end class A public class B extends A { private char service; public B() {   super();   System.out.println(“B() called”); } public...

  • ***Please keep given code intact*** Write a JavaFX application that displays a label and a Button...

    ***Please keep given code intact*** Write a JavaFX application that displays a label and a Button to a frame in the FXBookQuote2 program. When the user clicks the button, display the title of the book that contains the opening sentence or two from your favorite book in the label. FXBookQuote2.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the...

  • Task 3: Main Program Create a main program class that: Creates three or more Nurse instances...

    Task 3: Main Program Create a main program class that: Creates three or more Nurse instances assigned to different shifts. Creates three or more Doctor instances. Creates three or more Patient instances with pre-determined names and manually assigned physicians chosen from the pool of Doctor instances previously created. Generates another 20 Patient instances using randomly generated names and randomly assigns them physicians chosen from the pool of Doctor instances previously created. Prints the toString() values for all employees. Prints the...

  • COVERT TO PSEUDOCODE /****************************Vacation.java*****************************/ public abstract class Vacation {    /*    * private data field...

    COVERT TO PSEUDOCODE /****************************Vacation.java*****************************/ public abstract class Vacation {    /*    * private data field    */    private double cost;    private double budget;    private String destination;    /**    *    * @param cost    * @param budget    * @param destination    */    public Vacation(double cost, double budget, String destination) {        super();        this.cost = cost;        this.budget = budget;        this.destination = destination;    }    //getter and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT