Home Back

Using DBFree on mobiles


Mobile Internet is continuing to grow very quickly and soon the classic concept of Desktop Experience we are all used to will disappear. Writing native mobile applications for Android or Apple devices is not for everyone, and takes a ridicoulous amount of time.

DBFree offer a viable solutions for this, even if purist would not consider that a solution: web applications for mobiles.

Android and Web Apps

There are essentially two ways to deliver an application on Android: as a client-side application (developed using the Android SDK and installed on user devices in an APK) or as a web application (developed using web standards and accessed through a web browser—there's nothing to install on user devices).

If you chose to provide a web-based app for Android-powered devices, you can rest assured that major web browsers for Android (and the WebView framework) allow you to specify viewport and style properties that make your web pages appear at the proper size and scale on all screen configurations.

you can provide access to your web pages from either a web browser or your your own Android app. However, you shouldn't develop an Android app simply as a means to view your web site. Rather, the web pages you embed in your Android app should be designed especially for that environment. You can even define an interface between your Android application and your web pages that allows JavaScript in the web pages to call upon APIs in your Android application—providing Android APIs to your web-based application.

Visit Android Developers web site

Introducing DBGW
DBWeb Gateway for DBFree


What is DBGW?

DBWG is an Android App to be installed on any Android device that enables to connect with an external web site (running DBFree) and use it as web application.

How it works

There are essentially two ways to deliver an application on Android: as a client-side application (developed using the Android SDK and installed on user devices in an APK) or as a web application (developed using web standards and accessed through a web browser (so that there are no data on user devices).

DBFree Gateway takes advantage of the second method. You develope your application in the usual way (using MaxScript and the DBFree framework) then put it in the cloud (or on your dedicated DBFree server).
The only real difference is that you must take into account the size and orientation of the display of target devices and redirect mobile devices to a dedicated mobile version of your web site.

This is simple, you should look for the "mobile" string in the User Agent (by using one of the standard ignitor pages of DBFree), which matches a wide variety of mobile devices. Large screen Android-powered devices (such as tablets) do not include the "mobile" string in the user agent, and can be treated exactly like standard connections. 

For example you're using the DBFree standard ignitor 4.0.1.7 you may directly add this code at the end of page:

//-- redirecting to site entrypoint for mobiles
if( /Mobile|mobile|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) 
{ document.getElementById('form_redir').action='<%=cMobileEntrypoint%>'; }

Another difference is the HTML header: you should use this XHTML Basic, instead of the usual DBFree headers:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

Another thing to take into account is that mobile devices typically have a connection speed far slower than a desktop computer, you should make your web pages load as fast as possible.

One way to speed it up is to avoid loading extra files such as large images, heavy stylesheets and script files in the <head> section. Instead of loading these files from the web use those already available on client, or provide your CSS and JavaScript directly in the DBFree footer (at the end of the body) unless you have scripts that need to be loaded before the page is loaded. Alternatively, you should optimize the size and speed of your files by compressing them with tools like Minify.

Once you've finished the development of the web application all you have to do is to get a copy of DBGW Android App dbgw.apk, configure it with the address and credentials to point to your web app and server and deliver it to your users (for example through a link on your web site).

Your Android user will install manually the .apk file (don't forget to provide the necessary instructions) and will be redirected to web app wothout even knowing where it is (unless you provide some information in your Web App).

DBWG is under testing

We already have a working .apk, that was working well on DBFRee V4, but at the moment is under revision to make it compatible with V41 and the new libraries, and is not yet available for downloads.
If you want to be noticed when the BETA version of DBGW will be ready just fill this form:
Insert your mail address
Retype mail address

With DBFree.org your privacy is safe! Your address will be used only for this task: we don't send unsolicited mail and we don't pass user lists to anyone.


Back to top