views:

596

answers:

2

Hi

I am trying to design an ASP.net based mobile web application that should run on IPhone, Blackberry etc. while giving the look and feel of the native application.

This seems to be no easy and straightforward task, or example IPhone menus are at the top while other mobile platform uses menu button on the phone itself (at the bottom). Also designing a good application with IPhone look and feel is not just css and js scripts that can be tailored for another device(say blackberry).

I am planning to extend XHTML and then use XSLT to properly expand to correct html for the output device. For example,

<html  xmlns="http://...&gt;
<head>
...
</head>
<body>
<menu>
 <menuItem Name="Home" Url="..." />
 <menuItem Name="Back" Url="..." />
</menu>
<span>This is a test page</span>
</body>
</html>

So, when we run this using a iPhone XSLT (for example) we can expand the menu at the top and when using another device we can expand it at the bottom.

I am curious to know if anybody else has solved this problem in the same way or in a different way or have some other ideas.

Thanks for your time!

+1  A: 

I use DeviceAtlas.

Noon Silk
I looked at the site, it seems to be a database of device capability (much like http://mdbf.codeplex.com/, correct me if I am wrong), however, the problem I mentioned still remains and that is how to format the output based on different mobile device conventions.
Samuel
also there is another problem with DeviceAtlas (for me). It seems like the license is based on server/year and what I am developing is a product that can be downloaded and run on multiple server.
Samuel
Well that's the work for you to do. You take the info DA gives you and render differently depending on that.
Noon Silk
@Samuel, well, then you may need to consider the DA license cost in the price to your users. I believe there are free services like DA though.
Noon Silk
+1  A: 

I worked on a project awhile back that did something similar to what you're describing; our solution was to have a common HTML and send out a device-specific css file based on the User-Agent header. That way, you always leave a fallback (the raw HTML) and you're not constantly scratching your head worrying about implementations of XSLT or what the transformed XHTML looks like.

EDIT: Just caught your comment on a good iPhone app not being just css and js. I would argue that a good CSS stylesheet would give you what you need; IE setting your menus as an absolutely positioned div either with top:0 or bottom:0, etc. The bonus with mobile development is that your window size isn't going to change, so it's not that hard to get pixel-perfect layout.

Chris Miller
Yes in most cases what you are saying is true. However, look at this page: https://accounting.quickbooks.com/c11/v28.113/884561071/mobile/home#_home in safari(simulating iphone) and IE(simulating windows mobile) and you will see how different they are...
Samuel
Yes, they are. It's an implementation choice. In the case of the Safari page, there's some javascript to detect the rotation of the iphone. The IE version contains a lot of javascript code that seems to have nothing at all to do with the page in question.As far as the HTML is concerned, they're not very different. The safari version is a bit more refined, is all. I don't see any reason the html couldn't be identical between the two and use css to handle the layout.I can work up a sample if you're interested.
Chris Miller
Thanks for our comment. You mentioned before that you could do a div with absolute positioning. After some research I found that not all mobile browser does ot support absolute positioning (ex. iphone).
Samuel