Android Open Source - AndroidLookup Lookup Task






From Project

Back to project page AndroidLookup.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidLookup listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * //  w w w. j av a  2 s  . c om
 */
package com.jburto2.androidlookup;


import android.os.AsyncTask;


/**
 * @author James Burton
 * 
 * @class LookupTask 
 * @brief This class is an AsyncTask that looks up something. The lookup functionality classes inherit from this.
 * Adapted from http://stackoverflow.com/questions/6343166/android-os-networkonmainthreadexception
 * 
 */
public abstract class LookupTask extends AsyncTask<String, Void, String> 
{
  /**
   * @var Exception exception
   * @brief This holds any exception generated from the lookup call.
   */
  
  protected Exception  exception;
  
  
  /**
   * @fn protected String doInBackground(String... urls)
   * 
   * @brief This function makes the function call in the background.
   * 
   *  
   * 
   * @param urls Array of strings that are arguments to the function. 
   * @return String With the answer to the function call
   * @return null If the call failed. 
   * @exception Exception generated from InetAddress call is stored in the instance variable exception.
   * 
   */
  
    protected String doInBackground(String... urls) 
    {
      return null;
    }
    
    /**
     * @fn protected void onPostExecute(String str)
     * 
     * @brief Method to be done after the task has executed.
     * @param str Some string 
     */

    protected void onPostExecute(String str) 
    {
        // TODO: check this.exception 
        // TODO: do something with the feed
    }
    
    /**
     * @fn public Exception getException()
     * @return exception
     */
    public Exception getException()
    {
      return exception;
    }
    
    /**
     * @fn public String getExceptionMsg()
     * @return String of the exception message.
     */
    public String getExceptionMsg()
    {
      return exception.getMessage();
      
    }

    


}




Java Source Code List

com.jburto2.androidlookup.DisplayInfoActivity.java
com.jburto2.androidlookup.DisplayLookupActivity.java
com.jburto2.androidlookup.DisplayWhoisActivity.java
com.jburto2.androidlookup.LookupAddressTask.java
com.jburto2.androidlookup.LookupCNAMETask.java
com.jburto2.androidlookup.LookupPingTask.java
com.jburto2.androidlookup.LookupTask.java
com.jburto2.androidlookup.LookupWhoisTask.java
com.jburto2.androidlookup.MainActivity.java
com.jburto2.androidlookup.TableLayoutUtils.java