Using the mobile ready project template in vs.net

The Mobile Ready HTML5 MVC project template is a template I created to speed up my team's jQuery mobile learning curve and development using the API.
While some of the team members had lots of experience using jQuery, no one have ever used the mobile version.

The template setup is easy.

1. Download the template extension from visualstudiogallery.com
2. Create a Mobile ready project using file, new, project "watch Video for more help"

Points of interests:

  1. In the project's Web.config App settings
     <add key="HasMobileSpecificViews" value="true"/>
        <add key="MobileViewsDirectoryName" value="M"/>

    The HasMobileSpecificViews setting is used to determine if the application has mobile specific views.

    When set to false, all mobile views will be ignored.

    The MobileViewsDirectoryName is used to determine the location of the application mobile views.

    The default value is set to M.

  2. Due to the complexity of debugging client script on mobile devices;

    I created an extension method "IsSupportedMobileDevice" in the Application helper class.

    We used this method to enable browsing the mobile views in firefox and debug client scripts using firebug.

    To enable client script debugging using firefox and firebox modify this method to return false as shown in the comment

    public static bool IsSupportedMobileDevice(this HttpRequestBase request)
            {
                //return true to enable debugging client script in firebug
                bool isMobile = request.Browser.IsMobileDevice;
                string userAgent = request.UserAgent.ToLowerInvariant();
     
                isMobile = isMobile || (userAgent.Contains("iphone")
                    || userAgent.Contains("blackberry")
                    || userAgent.Contains("mobile")
                    || userAgent.Contains("windows ce")
                    || userAgent.Contains("opera mini")
                    || userAgent.Contains("palm")
                   || userAgent.Contains("fennec")
                    );
                return isMobile;
     
            }

We are using iBBDemo to emulate iPhone and iPad devices, you can download this tool from http://www.puresimstudios.com/ibbdemo/

It's best to view the video in full screen mode :-)

Comments (14) -

Sweet, Thank you

Hello, I can´t create a project . I have the error "The Project type is not supported by this installation" . I have Visual Studio 2010 Ultimate - 10.0.40219.1 SP1Rel . I need install any more? Thank you in advance. Best Regards, Walter

Great template. simply the best.
Any idea when the next version will be released?

Jeff

Thanks Jeff,
I am currently working on on the next version.
Nothing major, just minor fixes and updates. the template auto updates once the next version is released.

Thank you,

Sammy

Hi Sammy, awesome work!  I too am having trouble figuring out where the "Mobile ..." header is coming from.  I saw this mentioned earlier in another forum but I don't think it was ever addressed.  I'm new to MVC so thanks for and direction you can provide!

Hello, I also can´t create a project . I have the error "The Project type is not supported by this installation" . I have Visual Studio 2010 Ultimate - 10.0.40219.1 SP1Rel . I need install any more? Thank you in advance. Best Regards, Chip

You will need to install MVC 3.0 and Web Standards Update for Microsoft Visual Studio 2010 SP1
visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83

Iqbal Husain 9/4/2012 11:37:34 AM

Nice help for beginners like me.
I had the same problem "The Project type is not supported by this installation".
I installed the Microsoft Visual Studio 2010 SP1
and  MVC 3.0.
Now its working fine for me.

There is one question "How we can add databse support (Like MS SQL Server or MySQL) to it?"

Thanks Smile

@Iqbal Husain
This is just a template, it has nothing to do with your code or project infrastructure. You can use any RDB you want just like in any other project.

Iqbal Husain 9/25/2012 12:06:43 PM

Thanks Sammy
Thanyou very much to making clear my query.

Thanks
Smile

You welcome Iqbal

using this we can develop any mobile app like any other project and can we add html5 directly in view?

I cant see the video Frown is a private video.

Check This Out 2/16/2014 6:43:07 PM

Cool page. Thx for posting!

Add comment