ASP.NET MVC developer creating a Phonegap application - asp.net-mvc

I will be starting a PhoneGap application. My skill set includes just MVC framework of .net.
Since I will be making an app for mobile, I believe I wont be able to get benefits of MVC framework for state management, etc or will I?
I guess I will have to use a WCF service for the back end. Or do I need to use something else. How is state management done on HTML5 mobile applications.
Please suggest.

Related

Should I use asp.net Mvc with Angular 4 Cli ?

I am a beginner to angular4 wanted to integrate angular with asp.net MVC,
Should I use the only Angular to develop web Application or with MVC ?
AngularJS is a Client Side web (for browser) development framework, and it has nothing to do with the server-side stuff (eg. database related operations or managing user session).
You can use ASP.NET MVC with angular, but it's a good practice to use WEB API, because the View part from MVC will be taking care by the angular framework.
It shouldn't be a problem. You'll need to add a json api to your .net app but people do it all the time. As with everything, right tools for the right job though.

Cross Platform Platform

General question:
If I wanted to develop a web site, say ASP.NET MVC (the only web framework I am familiar with), is it generic enough so I can use it to have later apps for iOS, Android, obviously Windows Phone?
I mean I will need to connect somehow to SQL server that is the backend of the ASP.NET MVC web site etc. What are technical difficulties & considerations I need to take into account so that app is generic enough.
Note that I am planning it to be multilingual and will use ASP.NET resources to support that.
Or should I learn completely different framework to have it generic over multiple platforms?
Thanks in advance!
ASP.Net is generic enough. You can expose REST endpoints (although WebAPI is probably better to do that, but you can run that alongside, and consume from, MVC), create full user interfaces, etc.
However, if you are planning a write-once, run-anywhere application to avoid having to develop native device apps (e.g. Android and IOS), make sure to take the time to read this excellent (but long) article.
The MVC framework can definitely be used for mobile devices (when you say apps, I am assuming you mean websites that function as apps), and MVC 4 introduced significantly more support for mobile development, including things like templates (http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253809).
MVC is a move to a less heavy handed framework than, for example, Webforms, and it should give you the flexibility to develop for any device. However, it does also open you up to coding yourself into some problems if you approach it in the wrong way, so make sure you are familiar with the framework before trying to develop some super next-gen responsive web app.
You can expose your ASP.NET MVC controllers to other platforms, like web services or Web API, so the client, IOS, Android or anything else can call your services.

Offline and online application using asp.net mvc

brief history of my project:
2 versions of application, one running in windows form, another running in the web using asp.net
current task: to revamp the project to use asp.net mvc 4 to use only one version of code base.
In final product, there will no more windows form; but only the asp.net mvc. this is with regards with short development timeline.
concern:
my concern is for offline users.
maybe i can host the asp.net mvc4 offline using localhost and sql lite.
When offline users click on check update, there will be able to get the latest version of asp.net mvc 4 ?
any other better solution that is feasible ? i prefer the architecture fits the vb.net
Have you take a look at SPA. That kind of projects, by nature, can work in online and offline mode. One thing to take into account is the ammount of data that the offline mode should handle (most SPAs are using the local storage for offline use, which is a little small)
By looking at this site you will find a lot of resourses on SPA.
http://www.johnpapa.net/spa/
Deploying MVC app with Sqlite in localhost will be quite a challenge in term of maintenance. Maybe you can develop HTML + jQuery solution which can run locally on client system and make use of client cache to hold the temp data. Also it can interact with live app by making ajax calls.

asp.net mvc3 - calling controller actions from external app

I have an asp.net mvc3 application built with RavenDB and I want to be able to access the data via an external HTML5 mobile app. I'm thinking of exposing methods via WCF or via MVC controller action methods? Which option is best?
Ok, I have faced similar situation a while ago. This the way I have handled it, I have directly exposed Controller urls to the mobile application clients. Bascially it will help you in reducing the burden of maintaining two code bases and helps you to reuse existing functionality. Even if you go with WCF you need to expose with REST to make HTML5 client developer life easy.
This is the why microsoft released ASP.NET MVC 4 Web Apis to avoid confusion among developers which way to go in these scenarios. So that your services are device agnostic and easily testable.
Since you've already built the app in MVC3, I'd recommend a JsonResult action on an MVC Controller: http://www.asp.net/ajaxlibrary/jquery_json_data_from_controller.ashx

Architectural pattern for ASP .NET and Silverlight UI

do you know of any available architectural pattern where the most of the code could be shared between Silverlight and ASP .NET UI? I understand that Silverlight won’t work very well with MVC (although people are blogging on how they achieved this in fact what they did wasn’t pure MVC) and same applies to ASP .NET MVVM.
However, I’m pretty sure there is a pattern where all of your business and data layers could be re-used by both Silverlight and ASP .NET app?
The example of when this would be needed is if we created a web application using Silverlight for desktops and asp .net for mobile devices and iPad, assuming that everything but UI would be the same.
You could simply creat a business logic layer assembly that would be used by both the Silverlight and ASP.NET versions of the application, the UI would be different but they'd both be using the same business logic or whatever you want to call it. The trick however is that Silverlight is a client technology so the server-side piece would house all that shared logic and you'd need to then interface that through a web-service your client could talk to, but that goes without saying when it comes to Silverlight/client-side technologies.
Contrary to what you've heard: Silverlight works great with MVC!
As far as sharing code the simplest answer is to have a single implementation of your data layer and business objects in the MVC application and then expose this to your Silverlight application via web services.
Ideally this means that the only code in your Silverlight application is UI specific...
RIA Services works with both Silverlight and ASP.Net and provides both client and server validation via member attributes. Code is shared auto-magically between sever and client apps.
You can use WCF and/or Ria services for data layers.

Resources