.NET Web application that can be accessed from mobile device - language-agnostic

I am planning on developing .NET web application which also will be accessed from mobile device. I am thinking to create two separate projects, one for web site and one mobile device so that upon detecting whether users are accessing the web site either from computer or mobile device, start appropriate project (web site version or mobile version). So for example, if users are accessing the web site from computer, it will show full screens (with all the functionalities). And, if users are accessing the web site from mobile device, show screens with minimal controls.
Or, is there any other better design which to develop .NET Web application that can be accessed from mobile device?
Another question is that how do I detect whether users are accessing the web site from computer or mobile device in .NET web application?
Any suggestion or help would be appreciate it.
Thanks.

Ther is a very good tutorial that show you how to do this with mvc. Check it out ASP.NET MVC Videos, its totorial to create a complete app and they mention in one section how display content depending on what mobile phone the user is using

Have you considered ASP.NET MVC?
Scott Hanselman did a session on ASP.NET MVC and mobile browser detection at MIX 09. This blog entry that he did gives a good rundown.
He also talks about some code he was given that will help do the redirection based on the browser version.
I'm sure ASP.NET MVC 2 has even more goodies.
Good Luck,
Patrick

Related

Building Offline capabilites in ASP.NET Core web application

We are building a project management web application using those main technologies:-
ASP.NET Core MVC
SQL Server + Entity Framework
HTML, CSS & Bootstrap
The application mainly allows to create project >> create tasks under the projects >> assign Task to users >> and so on..
Now part of the requirement is to have certain areas that should be available offline as follow:-
My Tasks dashboard. which shows the Tasks assigned to the login user. so even if the user does not have internet access >> the dashboard should list all the Tasks assigned to the user when the user was last online.
Complete a task, by entering some fields and upload images. so even if the user does not have internet access >> the user should be able to click on a Task inside the dashboard >> fill the completion sections >> upload images/files >> click on submit >> the data should stay offline, and get submitted automatically once the user has internet access.
So can we have those offline features available inside our web application ? also some users will be accessing the web application inside their mobile web,, so are mobile browser capable of storing data and attachments and allow them to access the dashboard + edit a task and complete it and submit the change offline ? or we will need to have a mobile application instead?
Thanks
In principle, offline capabilities are available in every browser. These include things like localStorage, IndexedDB (parts of any browser), and progressive web apps (PWA) option (service workers). Note: PWA manifest and service workers are not actually related to or require blazer (mentioned above) in any way, they are web standard basically, don't get confused here. Blazer is a separate thing altogether.
The older technologies to support offline also include "application cache" mentioned in the other answer (NOTE: this one has been deprecated in favor of PWA, and support for it has been removed from Google Chrome for example)
Practically, all this means that every browser has an offline database/storage available for every application to store its data offline and synchronize later on. So, you don't have to build a mobile app to have offline capabilities.
There are some frameworks and platforms that could help you build offline-capable applications, but asp.net core mvc is not exactly one of those, meaning it does not provide offline capability right out of the box. That is, there is no checkbox to click, as far as I know, of course.
You use ASP.NET Core MVC and Entity Framework, and I think it not support offline capabilites. Because this project is compiled and run on the server.
If you want the application to support offline functions, I think it should be possible to download the entire content of the site to the browser locally.
You can refer to the official documentation below.
ASP.NET Core Blazor Progressive Web Application (PWA)
The following documents, I know are not ASP.NET Core MVC projects, but for reference.
I think to achieve offline function, first of all, the content of the complete site needs to be downloaded to the local when it is accessed for the first time. In this way, there will be no network exception errors when accessing offline.
Build an HTML5 Offline Application with Application Cache, Web Storage and ASP.NET MVC

Xamarin: how to create views / UI of an app dynamically from a Json

Have you already developed a Xamarin app whose views are generated from a Json recovered when launching the application?
I met a client with this kind of need:
they are developing a web app to prototype the screens by adding and positioning some controls (TextBox, Label, ...)
this generates a Json that must be interpreted by the Xamarin app: this will build the different views dynamically
in a first version, the user's data would be stored locally (through a file or SQLite) and synchronized "manually" when the device is connected to a computer
the app will work on Android only in a first time, and then on WPF
The client has not yet decided between Xamarin.Forms or Xamarin native, but it's probably more interesting to do it through Xamarin.Forms, even if iOS is not required: this should make porting on WPF easier.
Have worked on similar cases? Have you some recommendations? Are there plugins or patterns that could be used to simplify this development?
I've found this one, but it doesn't seem to be the same use.
There is also this article on iOS, but there is not the same thing on Android.
This would in theory be possible using a massive code behind builder for a page but should NOT be done for a production app. Mobile apps have very specific requirements that need to be thought of before attempting.
Xamarin is great for simplifying code reuse, and if you use Xamarin Forms you can reuse the UI components for Enterprise apps.(the less fancy and pixel perfect the layouts need to be the better. )
Your client would be better served by making it a mobile compatible web page instead from the details you have shared.

Offline HTML5 web app iOS/Android: under which conditions is it possible?

I need to develop a catalogue mobile app, that will be used as products' brochure by the sales employees of the company. I need that the whole catalog of products (the list of products, the single product page, the product search) is accessible also when the device is offline.
I'm sure that this could be easly done developing the app as a native app. But I strongly would prefer to develop it in HTML5 as a web app. But I'm not sure that the HTML5 web app supports the offline access.
Searching on Google I found that if the cache is less than 5MB a web app works well as a native app. But in my scenario the catalogue of products is composed by 120 products, eachone with gallery of photos. So it is much more bigger than 5MB.
In your opinion, how can I deal with the offline access requirement? Maybe an hybrid solution, composed by half a web app and half a native app? Feel free to suggest your approach. Thanks
Why don't you try an existing hybrid mobile app framework, like: PhoneGap. You can build the app using html, CSS, and JavaScript.
http://www.sitepoint.com/top-7-hybrid-mobile-app-frameworks/

Mobile compatible/hybrid web application in MVC3/4

I am creating an web application for user to manage their schedule. It will be MVC3/4 application. I want to know what will be the best approach to make it as mobile compatible also.
I read few articles online like using a phone gap,Kendo UI or a HTML 5 responsive view etc.Well i would love to try it all but dont ahve enough time to try it all.So what will be the best approach to handle this problem. Website will basic login,registration,Grids for data information and maybe a google calender intrigation for scheduling. User will be using this website on their desktop and also on their mobile devices.
Thanks in advance,
Arpan
I will definitely go with ASP.NET MVC 4 and jQuery Mobile
Since you are already building a web application, ASP.NET MVC 4 and jQuery Mobile will allow you to reuse your current model and controllers, and just build the presentation layer for mobile, you don't even have to take care of deciding which view to show to each device, MVC 4 will select the correct view when accessed from a mobile browser.
Note that this proposal implicitly chooses HTML5.
Kendo UI is a tool that will save time for complex controls like the schedule you plan to build, but it is not a different technology and you can add these controls later when you really need them.
Once your application is mature enough, then you can build a Native App to have better interoperation with the smartphone's own schedule, contacts and other features. When that moment arrives check out Xamarin that will allow you to build for any mobile platform using your existing C# knowledge. But do that later, start with the browser based version until the app mature.

Approaching a new Web app with Mobile app

I have a new project starting up that consists of building a webapp for a workorder based system. The main views are:
Viewing all open/closed/hold work-orders,
View Detail of Workorders
Create new Work orders
Account management.
In addition to being a webapp, it should also function as a mobile app.
What is the best approach for doing this? Will i have to develop a separate app for the mobile side? Can i use my webapp + sencha, jquery mobile, something.. that can work with my logic, classes, HTML structure to have it effectively work on mobile?
Or do i develop a mobile version first and think about progressive enhancement to the webapp (website)?
This question is open to all interpretations of flow, process, technologies.
Thank you Stack Overflowers.
Seperate out your business logic and model code from the view layer. Then use sencha touch and Extjs to create both a web and mobile (mobile web atleast) application. You can then reuse the model and business logic code and use the different frameworks to manage the view. When you have a mobile app running, use phone gap to turn it into a full-fledged app (assumming you need access to phone only systems (camera etc)).
We've done this with our own custom framework built on top of Ext and Sencha. We use ActiveRecord to run the models and then have a compile script that knows which files are for mobile and which are for web. We can then have all the code in the one repository and use the compiler to produce versions for the correct type (mobile or web).
It's definitely not a good idea to start with the mobile app, since web browsers are more ubiquitous than smart phones. Start with the web application and tailor the UI so that it can be easily displayed on smart phones as well as desktop browsers. If that's not a viable route, you could have a regular version and a mobile version of your website. In general, I think the overhead of writing a dedicated mobile client to browse your website is greater than the payoff unless you want to take advantage of the phones' hardware features like GPS or sensors (and even GPS you can still access from a web app using W3C geolocation api).