Discussion Forums  >  WebViews and HTML for Mobile

Replies: 7    Views: 109

RB
Aspiring developer
Profile
Posts: 150
Reg: Jun 29, 2011
BR
6,150
08/07/12 10:35 AM (13 years ago)

HTML DOC issue

How to create a same application for mobile phones and tablets without using the background image of html doc screen and using the html pages with different backgrounds images? I need to create a page for each one?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
08/07/12 11:34 AM (13 years ago)
If its iOS v1.5, you can take a look at the DoubleHTML Tool: http://idevdepot.com/double-html-tool/ It allows you to define separate HTML docs for "large" devices vs "small" devices.
 
RB
Aspiring developer
Profile
Posts: 150
Reg: Jun 29, 2011
BR
6,150
like
08/07/12 11:48 AM (13 years ago)
Thanks Stobe, but for android.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
08/07/12 11:51 AM (13 years ago)
Ah... I've never looked at the java code before, but I'm sure a similar solution can be attained by editing the html doc screen in the buzztouch source. (easy for me to say...) Sorry I'm not much help in that arena.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
08/07/12 12:02 PM (13 years ago)
Easiest way is with custom css files and a routine to sense which type of device. Below is what I've been using successfully in both custom html screens and html docs. <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> <meta content="width=device-width; initial-scale=1.0; maximum-scale=2.0; user-scalable=1;" name="viewport" /> <script type="text/javascript"> if((navigator.userAgent.match(/iPad/i))) { document.write("<link type=\"text\/css\" rel=\"stylesheet\" media=\"all\" href=\"ipad.css\" charset=\"utf-8\" \/>"); } else if(navigator.userAgent.match(/iPhone/i)) { document.write("<link type=\"text\/css\" rel=\"stylesheet\" media=\"all\" href=\"iphone.css\" charset=\"utf-8\" \/>"); } else { document.write("<link type=\"text\/css\" rel=\"stylesheet\" href=\"web.css\" \/>"); } </script> Then you just set your css files for each device. If you google you can find some good examples of css for large and small devices. Also, this works for both iOS and Android.
 
RB
Aspiring developer
Profile
Posts: 150
Reg: Jun 29, 2011
BR
6,150
like
08/07/12 12:19 PM (13 years ago)
Thank you, MGoBlue. I figured someone would have something ready. Do you have informations about CSS?
 
rhundle denz
Aspiring developer
Profile
Posts: 53
Reg: Feb 22, 2012
location unknow...
2,630
like
08/08/12 09:13 PM (13 years ago)
 
RB
Aspiring developer
Profile
Posts: 150
Reg: Jun 29, 2011
BR
6,150
like
08/09/12 04:23 AM (13 years ago)
Thank you rhundle, but it's not for android
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.