ASP.NET MVC and mobile website development - asp.net-mvc

Good Morning.
We want to modify our MVC website to use different views in order to service the different mobile resolutions across android and iOS. Is there a framework or recommendation in how can we achieve this?

Related

Best practice for exposing data using Web API along with building MVC4 website

I am having one client who wanted to have a website along with an app on iPhone and Android too. So, I am worried about how to structure my MVC solution architecture to best suit the requirement and re-use the business logic among all the platform using Web API.
Can any one suggest the architecture in bit detail to prefer in the above mentioned requirement.

Multiple view for multiple devices in ASP .Net MVC

What can be the best way for architecting an ASP .Net MVC project, which have common web service part and multiple views for multiple devices. I have started with a JQuery mobile project, and have view for mobile devices. Now I need to add web api controllers that should work as web services. Also another View part is needed for desktop browsers.
Is it good to assign different Areas to group different Views?
Web Request Flow:
Route mobile client request to MVCController in Mobile Area, and desktop client request to MVCController in Desktop Area from RouteConfig
Call web api controller(common) from MVC controllers
Return corresponding View from MVC controller
Is there any better approach available to do the same? I am confused if webservices and multiple views in same project will increase the complexity.
I think a better approach would be to pursue a responsive design. Ideally you'd end up with just one view for multiple devices instead of multiple views for showing the same information.
Take a look at this explanation.
You can use the Bootstrap framework to achieve a responsive design that will play nicely on any device.
See http://twitter.github.io/bootstrap/
For the most parts, you wont need jQuery mobile.

ASP MVC 3 mobile strategy

I am starting a group uni project and we are using ASP MVC 3. We are going to have a mobile (web) component as well as a "traditional" web app. Some of the views will overlap (as in Incidents mobile view and Incidents ordinary view). ASP MVC 4 has the mobile features that we want, but we don't want to take chances with a Beta version.
What we were thinking of doing was having two MVC 3 projects in our solution, one for the mobile and one for the web app. Alternatively, we were thinking of having some mobile only controllers and having everything in one MVC project. For example (/AccountMobileController/Signup and /AccountController/Signup)?
What do you guys recommend? Is it silly to use ASP MVC 4 Beta?
You can get mobile view support fairly easily in MVC 3. Take a look at how they approached this on Stackoverflow.
http://kevinmontrose.com/2011/07/17/mobile-views-in-asp-net-mvc3/
For the most part, your controllers should be the same for mobile and full site, but the views will be different.
I'd say go for MVC4 Beta.
Although, yes, it is in Beta, it is ALMOST ready for production.
System.Web.Mvc has really not changed that much, and in reality the, "mobile templates" from MVC4 are mostly just Html, Css, and Js templates that come pre-bundled with the templates.
The main new mobile functionality in MVC4 is for swapping out views for different devices.
Plus the Web API is really awesome for creating an API.
http://www.asp.net/mvc/tutorials/mvc-4/aspnet-mvc-4-mobile-features
I'd suggest you to look at frameworks like Bootstrap and Less, they'll help you build responsive websites without too much effort. Just be careful that you do not inject any css or styles from mvc code as it might interfere with them.

Silverlight to MVC to WP7

We have been developing a silverlight app for the last couple of years. We have a large library base and much of it is reused on the ASP.Net MVC version which we have been developing for a month or so. So I created an MVC app and pretty much added the libraries from the Silverlight server app.
I would like to do a demo for the WP7 version of our app and was wondering what is the best way to reuse the libraries we already have? I was told that I could share files but with such a large library based, I do not want to go that way.
Would it be possible to expose the MVC app via WCF and then get access to the data in WP7 where I can then all the XAML views?
I do not have any experience on the architecture of WP7.
TIA
JD
What you could do is have the MVC app expose the data via a Controller (possibly returning it as json) which would be your "api".
WP7 would just need to make a web request to the api you've already made. WebClient should make this quite easy.
This way you wouldn't need to use WCF.
Hope this helps.
Tony

How to develpo the web based application that can be viewed on the mobile phone in asp.net(vs2008)

sir
I am the beginner of the asp.net,for my current project i need to develop a mobile web application using asp.net 3.5 that can be viewed on an Phone and all other browser what to support it, but there is no longer a template in VS2008 to enable mobile development. please give some more idea about that sir,Thank you.
You would need to create a page that is specific to each mobile browser you want to target, or create one that works on the lowest common feature set across all.
Using ASP.NET or any other server based framework should make any difference, it is more how you render it and what functionality you provide to the limited mobile browsers that is key.
Learn about General Mobile development at http://www.mobiforge.com/
For ASP.NET specific technologies look at http://mdbf.codeplex.com/
Details about using MDBF (with ASP.NET MVC - but the basics still apply) cand be found at:
http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx or the video at http://videos.visitmix.com/MIX09/T20F.
For publishing mobile content from the same URL than web content you can use mobile phone detection software. Try:
http://www.moviladetection.com/

Resources