This class implements functionality for the main activity in Android Lookup. Start here. More...
Public Member Functions | |
boolean | onCreateOptionsMenu (Menu menu) |
Inflate the menu; this adds items to the action bar if it is present. More... | |
boolean | onOptionsItemSelected (MenuItem item) |
Handles menu item selection. Only menu item here is the "action_about" for the info activity. More... | |
void | clearHostNameMessage (View view) |
Clear the fields. This should be the registered response to the "clear" button for the Hostname button. Learned how to clear a field from http://stackoverflow.com/questions/8758635/how-to-clear-the-edittext-when-onclick-on-button. More... | |
void | lookupMessage (View view) |
Looks up the url or the IP address. This should be the registered response to the "lookup" button. Note: The actual lookup is done on a separate thread. More... | |
void | whoisMessage (View view) |
Gets the whois information for the host. This should be the registered response to the "whois" button. Note: The actual lookup is done on a separate thread. More... | |
void | displayToast (String message) |
Displays a popup "Toast" message to the user. Displaying toasts from http://developer.android.com/guide/topics/ui/notifiers/toasts.html. More... | |
void | displayMessageDialog (String message, String title) |
Displays a message dialog to the user. Displaying message dialogs from http://www.mkyong.com/android/android-alert-dialog-example/. More... | |
Static Public Attributes | |
static final String | IP_ADDRESSES = "com.jburto2.androidlookup.IP_ADDRESSES" |
Stores the ip_addresses returned from LookupAddressTask. More... | |
static final String | CNAME = "com.jburto2.androidlookup.CNAME" |
Stores the CNAME returned from LookupCNAMETask. More... | |
static final String | LOOKUP_NAME = "com.jburto2.androidlookup.LOOKUP_NAME" |
Stores the hostname that the user enters on the main screen. More... | |
static final String | PING_RESULTS = "com.jburto2.androidlookup.PING_RESULTS" |
Stores "Yes" or "No" result from LookupPingTask. More... | |
static final String | WHOIS_INFO = "com.jburto2.androidlookup.WHOIS_INFO" |
Stores the whois request returned from WHOIS_INFO. More... | |
Protected Member Functions | |
void | onCreate (Bundle savedInstanceState) |
Method called when activity is created. Sets the content view to activity_main. More... | |
String | runLookupTask (LookupTask lookupTask, String lookupString) |
This function runs the various LookupTasks on a separate thread. Android does not allow network calls to be made on the main thread, thus the need to create an AsyncTask to do the work. More from http://stackoverflow.com/questions/6343166/android-os-networkonmainthreadexception. More... | |
This class implements functionality for the main activity in Android Lookup. Start here.
Definition at line 27 of file MainActivity.java.
void com.jburto2.androidlookup.MainActivity.clearHostNameMessage | ( | View | view | ) |
Clear the fields. This should be the registered response to the "clear" button for the Hostname button. Learned how to clear a field from http://stackoverflow.com/questions/8758635/how-to-clear-the-edittext-when-onclick-on-button.
view |
Definition at line 114 of file MainActivity.java.
public void com.jburto2.androidlookup.MainActivity.displayMessageDialog | ( | String | message, |
String | title | ||
) |
Displays a message dialog to the user. Displaying message dialogs from http://www.mkyong.com/android/android-alert-dialog-example/.
message | Message to display |
title | Title of dialog |
Definition at line 311 of file MainActivity.java.
Referenced by com.jburto2.androidlookup.MainActivity.lookupMessage(), com.jburto2.androidlookup.MainActivity.runLookupTask(), and com.jburto2.androidlookup.MainActivity.whoisMessage().
public void com.jburto2.androidlookup.MainActivity.displayToast | ( | String | message | ) |
Displays a popup "Toast" message to the user. Displaying toasts from http://developer.android.com/guide/topics/ui/notifiers/toasts.html.
message | Message to display |
Definition at line 293 of file MainActivity.java.
public void com.jburto2.androidlookup.MainActivity.lookupMessage | ( | View | view | ) |
Looks up the url or the IP address. This should be the registered response to the "lookup" button. Note: The actual lookup is done on a separate thread.
view |
About progress bars: http://stackoverflow.com/questions/11099012/android-spin-refresh-button-while-reloading
Definition at line 128 of file MainActivity.java.
References com.jburto2.androidlookup.MainActivity.CNAME, com.jburto2.androidlookup.MainActivity.displayMessageDialog(), com.jburto2.androidlookup.MainActivity.IP_ADDRESSES, com.jburto2.androidlookup.MainActivity.LOOKUP_NAME, com.jburto2.androidlookup.MainActivity.PING_RESULTS, and com.jburto2.androidlookup.MainActivity.runLookupTask().
|
protected |
Method called when activity is created. Sets the content view to activity_main.
savedInstanceState |
Definition at line 65 of file MainActivity.java.
public boolean com.jburto2.androidlookup.MainActivity.onCreateOptionsMenu | ( | Menu | menu | ) |
Inflate the menu; this adds items to the action bar if it is present.
menu | Meny to be created. |
Definition at line 80 of file MainActivity.java.
public boolean com.jburto2.androidlookup.MainActivity.onOptionsItemSelected | ( | MenuItem | item | ) |
Handles menu item selection. Only menu item here is the "action_about" for the info activity.
item | MenuItem that was selected |
Menu from http://developer.android.com/guide/topics/ui/menus.html#options-menu
Definition at line 94 of file MainActivity.java.
|
protected |
This function runs the various LookupTasks on a separate thread. Android does not allow network calls to be made on the main thread, thus the need to create an AsyncTask to do the work. More from http://stackoverflow.com/questions/6343166/android-os-networkonmainthreadexception.
lookupTask | LookupTask that is being called |
lookupString | String that is the hostname/ipaddress to be looked up. |
Definition at line 259 of file MainActivity.java.
References com.jburto2.androidlookup.MainActivity.displayMessageDialog().
Referenced by com.jburto2.androidlookup.MainActivity.lookupMessage(), and com.jburto2.androidlookup.MainActivity.whoisMessage().
public void com.jburto2.androidlookup.MainActivity.whoisMessage | ( | View | view | ) |
Gets the whois information for the host. This should be the registered response to the "whois" button. Note: The actual lookup is done on a separate thread.
view |
About progress bars: http://stackoverflow.com/questions/11099012/android-spin-refresh-button-while-reloading
Definition at line 200 of file MainActivity.java.
References com.jburto2.androidlookup.MainActivity.displayMessageDialog(), com.jburto2.androidlookup.MainActivity.runLookupTask(), and com.jburto2.androidlookup.MainActivity.WHOIS_INFO.
|
static |
Stores the CNAME returned from LookupCNAMETask.
Definition at line 38 of file MainActivity.java.
Referenced by com.jburto2.androidlookup.MainActivity.lookupMessage(), and com.jburto2.androidlookup.DisplayLookupActivity.onCreate().
|
static |
Stores the ip_addresses returned from LookupAddressTask.
Definition at line 33 of file MainActivity.java.
Referenced by com.jburto2.androidlookup.MainActivity.lookupMessage(), and com.jburto2.androidlookup.DisplayLookupActivity.onCreate().
|
static |
Stores the hostname that the user enters on the main screen.
Definition at line 43 of file MainActivity.java.
Referenced by com.jburto2.androidlookup.MainActivity.lookupMessage(), and com.jburto2.androidlookup.DisplayLookupActivity.onCreate().
|
static |
Stores "Yes" or "No" result from LookupPingTask.
Definition at line 48 of file MainActivity.java.
Referenced by com.jburto2.androidlookup.MainActivity.lookupMessage(), and com.jburto2.androidlookup.DisplayLookupActivity.onCreate().
|
static |
Stores the whois request returned from WHOIS_INFO.
Definition at line 53 of file MainActivity.java.
Referenced by com.jburto2.androidlookup.DisplayWhoisActivity.onCreate(), and com.jburto2.androidlookup.MainActivity.whoisMessage().