Open source ‘WebViewApp v1.12′ for Android released!

August 28, 2011 at 13:48

WebViewApp

I have only recently become curious about developing for Android phones. As a web developer the most important thing for me was to provide a way to bridge the gap between web applications and native applications.

Free and open source WebViewApp application is a simple base setup for developing Android applications that communicate with web services. WebViewApp is released as open source and developers can use this base application to build their own fully functional web applications in Android.

This application is as bare bones as possible and includes commented code and some examples.

Following features are included:

  • Cookie management (application stores cookies)
  • Cache management (application stores cache based on web service cache lifetime and maintains it when user is not using the app)
  • Javascript interface (Web service can execute commands in Java and vice versa, such as for scripting hardware keys or executing alerts from web service, displayed in Android.)
  • Contained URL’s (Web service only opens its own URL’s in app, every other URL is launched in browser.)
  • Online Checks (App checks if user is online, if not then shows an offline page with an option to continue and reload where user left off once internet is back)
  • Sending custom user agent string to web service for testing if web service is used through Android app. Also includes a (possibly) unique device ID and application version for update checks.
  • Can load local HTML pages that uses local resources
  • Can be installed on SD card.
  • Can save settings and preferences
  • Can set background services and timed services
  • Can start a service at boot time
  • Can make HTTP connections to online API’s
  • Can use private and public file system, read and write files
  • Can use SQLite database

This application shows that it is possible to create very extensive Android applications while relying mostly on HTML and JavaScript user interface, which makes it much easier to port to other systems or create a counterpart to browser version of a website.

Please note that there is no ‘guide’ on how to change the base application into your own new application, but source package does include a short overview of all the necessary modifications. Basic knowledge of Android and web development is recommended.

The bare-bones application can be downloaded from Android Market with its name ‘WebViewApp’ or from Android Market.

Source code can be downloaded from here. This includes source code for both the Android app as well as the web service.

VERSION HISTORY:

v1.12 Database and file system examples, HTTP request examples
v1.11 Starting service at boot time
v1.10 Background services and timed services
v1.09 Notifications, settings and preferences
v1.08 Local image test for local HTML
v1.07 Activity checks and local file support
v1.06 Better examples and descriptions
v1.05 Possibility to keep previous scroll position
v1.04 Back button now works with POST variables
v1.03 Fix for back button in certain conditions
v1.02 Reload page now uses Javascript interface
v1.01 Fix for no-internet reload page
v1.00 Release


Tags: ,

Leave a Reply