Create a mobile web application from your RSS feed

The easiest way to create a mobile version of your web application (particularly, your APEX web application) is to use a tool to generate it using the RSS feed. Presuming you already developed an APEX web application with an RSS feed, you can use of the may (free or not) tools to generate the mobile version of your website in just a few minutes.

A list of some of these tools is available here: http://spyrestudios.com/10-great-tools-to-create-a-mobile-version-of-your-site. We’ll use Mofuse (a 14 day free trial version) to demonstrate how we can create a mobile version in just 5 minutes for www.apexninjas.com. Our RSS feed is available at http://localhost:8081/apex/rss.

Using the simple wizard available at Mofuse.com, create a trial account, log in, create a new website, at a RSS element, choose a layout and design and that’s all! Just check out http://apexninjas.prohost.mobi on your mobile (available on free trail 14 days beginning in June the 14th). The result is a mobile app generated from the RSS feed, that looks like this:

Automatically redirect to mobile version

For simplicity, one can use a web service like Mofuse for the mobile version of the APEX website. But users will access the desktop version of the website and Google will index also the links present in the RSS (www.apexninjas.com over http://apexninjas.prohost.mobi,for example). So the user accessing the website from a mobile device must:

1. Access a mobile URL, like m.apexninjas.com. Add this link in the desktop web application, so the users can access it from the desktop version

or

2. Automatically redirect to the mobile version.

In your APEX application, create a application item called F100_USER_AGENT (Go to Application Builder -> Shared Components -> Application Items -> [Create])

Create an application process that loads the user agent information into item F100_USER_AGENT. Go to Application Builder -> Shared Components -> Application Processes -> [Create]. Create process “Set User Agent”, process point: “On Load, Before Header”, type “PLSQL Anonymous Block”. Set the PLSQL source to:

select owa_util.get_cgi_env(‘HTTP_USER_AGENT’) into :F100_USER_AGENT from dual;

Create an application process that redirects the user to the mobile version of the website. Application Builder -> Shared Components -> Application Processes -> [Create]. Create process “Redirect to mobile”, process point: “On Load, Before Header”, type PLSQL Anonymous Block”. Now, search through the user agent value set in item F100_USER_AGENT for strings that indicate that the user is accessing the URL through a mobile device/browser. Set the PLSQL source to (this code is just a draft version, can be greatly improved):

declare
v_exists number;
begin

v_exists := instr(lower(:F100_USER_AGENT),’symbian’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

v_exists := instr(lower(:F100_USER_AGENT),’nokia’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

v_exists := instr(lower(:F100_USER_AGENT),’iphone’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

v_exists := instr(lower(:F100_USER_AGENT),’mot’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

v_exists := instr(lower(:F100_USER_AGENT),’android’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

v_exists := instr(lower(:F100_USER_AGENT),’mini’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

v_exists := instr(lower(:F100_USER_AGENT),’samsung’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

v_exists := instr(lower(:F100_USER_AGENT),’lg’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

v_exists := instr(lower(:F100_USER_AGENT),’windows ce’);

if v_exists >0 then
htp.init;
owa_util.redirect_url(‘http://apexninjas.prohost.mobi’);

end if;

end;

 

 

One thought on “Create a mobile web application from your RSS feed

Leave a Reply