Commits

Luke Plant committed 355a8b5

Added README and LICENSE

Comments (0)

Files changed (2)

+Copyright (c) 2012 Luke Plant
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+This is a simple Android app for displaying the learnscripture.net site in a
+full screen WebView.
+
+It may be useful to other people to serve as a basis for similar apps, where you
+have a web app that will work well on an Android device, but you can benefit
+from a full screen experience, and from being available on Google Play.
+
+The code is provided under a very liberal license (MIT, see LICENSE), with no
+warranty, and no documentation apart from code comments and this README.
+
+The app provides the following refinements/features:
+
+* full screen - so you don't have an address bar getting in the way.
+
+* a progress bar that appears when a page starts to load, and disappears when
+  loading is done.
+
+* handling of back button:
+
+  * this will do the same as a normal back button in a web browser, until you
+    reach the 'home' page (which in this case is the 'dashboard'), at which
+    point the user will go back to the previous activity.
+
+  * when a "modal dialog" is active within the WebView, the back button will
+    dismiss it, rather than do a page back. This requires integration with
+    javascript in the web app, firstly to expose a javascript method that will
+    close the modal, so the Android app can do::
+
+      engine.loadUrl("javascript: learnscripture.hideModal();");
+
+    … and secondly to let the Android app know that a modal is active. In the
+    Android app, you have this method::
+
+      IJavascriptHandler.setModalIsVisible(boolean visible)
+
+    and this call to expose IJavascriptHandler to the web page::
+
+      engine.addJavascriptInterface(new IJavascriptHandler(this), "androidlearnscripture");
+
+    In the javascript, you have code like::
+
+      $('div.modal').bind('shown', function (ev) {
+          if (window.androidlearnscripture &&
+              window.androidlearnscripture.setModalIsVisible) {
+              window.androidlearnscripture.setModalIsVisible(true);
+          }
+      });
+
+    and similar code for when the modals disappear. (This is using jQuery and
+    the modal dialogs from Twitter's Bootstrap). The code checks for the
+    presence of the "androidlearnscripture" object since the site might not be
+    running withing the Android app, or might be running in a different version
+    of the app.
+
+* handling of links:
+
+  * Links internal to the LearnScripture.net site are loaded within the WebView
+
+  * External http links are loaded in a separate activity (to show the address
+    bar etc and to make use of any existing sessions the user may have on other
+    sites in their normal browser)
+
+  * mailto links handled correctly
+
+* A simple menu:
+
+  * Refresh button
+
+  * Home button
+
+  * Preferences button. This launches a modal within the WebView, and requires
+    integration with web site javascript code so that the button is only
+    available when the preferences modal dialog is available (the javascript
+    calls the setEnablePreferencesMenu method).
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.