This is an Android WebView application for Android version 1.6 or greater.
This application attempts to load a URL using a userID and server_name.
## Deliverables
=========
BEHAVIOR:
1. Start application
2. Check the persistent storage, such as "Shared Preferences", to determine if a userkey and server_name are stored (and have reasonable values).
2.1 If yes, then perform a loadUrl("http://<server_name>/folder/<userkey>"). The userkey and server_name are retrieved from the persistent storage referred to in step 2.
2.1.1 If this fails then go to 2.2
2.2 If no, then attempt to authenticate (which starts with a loadURL("[login to view URL])).
2.2.1 When PHP form is presented login into with a username/password. We have already written this form. Since we cannot perform a login from WebView and catch response at the same time this existing PHP script, which is needed for login, accepts username/password and returns the JSON object.
2.2.2 If the username/password match, the PHP code passes a JSON object to the Android using the syntax:
echo json_encode($result);
...where a string similar to the following is echoed:
{"userkey":"bbbbaf1ea0f505a249c988c71963","server_name":[[login to view URL]][1]}
If the username/password fail go to 2.2
2.2.3 Use Android persistent storage, such as "Shared Preferences", to store the userkey and server_name as retrieved from the echoed userkey and server_name.
2.2.4 Perform a loadUrl("http://<server_name>/folder/<userkey>").
Example:
loadUrl([[login to view URL]][2]);
==================
NOTES:
1. I have the PHP code that performs steps 2.2.1 and 2.2.2. PHP code is NOT part of the delivery.
==================
ALWAYS:
1. check network connectivity before calling a URL
2. check availability of domain name (e.g., can I ping it?) before performing a loadURL
3. show a webview progress bar when loading
4. show "connected" in title bar when connected
5. show "not connected" in the title bar when not connected
6. show "connecting…" in the title bar when attempting to connect
7. include a "LOGOUT" menu button that allows the user to clear the userkey and server_name persistent storage
=========