Is there any JavaScript framework that supports offline scenario in MVC 4 SPA? - html

Steve Sanderson presented MVC 4 SPA "Delivery Trucker" for mobile devices with offline support using upshot.js JavaScript framework.
http://channel9.msdn.com/Events/TechDays/TechDays-2012-Belgium/199
It seems that the MVC team dropped support for upshot.js
Is there any other JavaScript framework to provide offline support for mobile devices?
Example: MVC4 SPAs application is running on a smart phone. The phone might lose reception. SPA is using the HTML5 local storage to save data changes when offline. The JavaScript framework in question will detect when the mobile device is back online and synchronize the changes from the HTML5 local storage to the DB Server.
It would be really helpful if the MVC team provides support for Single Page Applications (SPAs) templates running on mobile devices offline.
Please vote for it if you think it will be helpful:
http://aspnet.uservoice.com/forums/147203-spa-single-page-application-framework-with-javas/suggestions/3721721-offline-support-for-single-page-application-templa

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted.
SpineJS has support for persistent local storage of model objects. Here's the guide. It's actually surprisingly transparent for the programmer to use and I highly recommend it.
Specifically, it fits your requirements in the following way:
it enables you to save state changes locally when offline
it's possible to announce itself to a server-side service when it's back online and push changes to the backend
the creators of Spine.js plan to implement an automation of that process using AJAX CRUD replays of the transactions you did when offline, read about it here.

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

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.

Offline collections - Meteor 0.6

The smart package appcache allow us to improve the load time of Meteor applications by keeping in the browser static ressources defined in the manifest.
But that's not enough to run the app offline, we need to have offline database/collections as well.
Today, what are the best strategies to use offline minimongo? What is planned (or not) in the future?
Is Meteor (as excellent as it is) the right tool when there's a lot of offline? SyncIt is one of the "edit locally then apply to server" libraries, but it's thought about as offline first. Disclosure: I wrote it.
At the moment the collections aren't persisted offline. Meteor needs the ability to sync between offline and online collections as well the ability to persist collections offline. While its not on the roadmap yet, hopefully its still on the minds of core developers.
Hopefully they see this question and put it on
I answer my own question by linking the offline-data package for Meteor by Andrew Wilcox who is the author of the appcache package as well.

What to Use for PhoneGap Database Storage

I am writing an application using PhoneGap, and am finding it hard to work out how to store my data in a database. For the minute I just want to keep an open mind as I will be recommending technology options to our company.
The PhoneGap API for storage is here,
http://docs.phonegap.com/en/1.3.0/phonegap_storage_storage.md.html#Storage
It is based on this HTML5 spec,
http://www.w3.org/TR/webdatabase/
The problem for me is that the specification for this is not being maintained any more, and the standard has been deprecated.
The other problem is that I implemented a database using web database, and the versioning didn't work properly.
What is PhoneGaps stance on this and will PhoneGap look at other technologies such as the Indexed Database API,
http://www.w3.org/TR/IndexedDB/#database-concept
I am storing JSON data in the localStorage for now which is working great, but I am wondering if my database could get too big and it might not be the best option.
I faced the similar issue while developing an application few months back in which we were expecting to port the application to different platforms (with different versions). So instead of using the core storage mechanism which phonegap offers we went on using a dedicated storage framework which can provide consistent api but uses the best underlying storage mechanism.
There are variety of JS frameworks which can help you use the underlying storage. The following are few might interest you if you are planning to use the app on different platforms.
PersistenceJS - persistencejs.org
lawnchair - http://westcoastlogic.com/lawnchair/
persistencejs uses gears and localstorage in combination which helps to run the app on BlackBerry 5.x devices as well without any change.
I went on using the persistencejs and it have really worked well till now. We have ported the application on Android, iPhone, iPad, BlackBerry (5.x and greater)

Web Application Framework - HTML5 with mobile devices JavaScript support

I searched for Java based web application frameworks the last few days. I have to build a Java EE backend and a HTML5/CSS3/JavaScript frontend which can be accessed with multi-touch capable devices. So I will need modern JavaScript frameworks like Sencha Touch.
My backend should be built upon with Java EE, Hibernate and MySQL. I have two kinds of data transfer: AJAX / JSON so the page does not need to be reloaded and pages and normal pages which reload the page by sending a form with POST (or do you think to have more the feeling as a application I should do all stuff with AJAX/JSON?).
I found several web application frameworks:
JavaSever Faces
Apache Wicket
Spring MVC
handle it only with jar files for JSON (and REST)
Google Web Toolkit
What do you think will fit best? Perhaps you can exclude one of them, that would also be great, so I can take a closer look at the remaining technologies.
Best Regards, Tim.
Interesting question.
Concerning exclusion: If you use a JS framework like Sencha Touch in the frontend I don't see the sense in using something like GWT which is for frontend-code generation.
I would probably stick with a more lightweight framework like http://www.playframework.org/.
You get your data from the backend and then hand it via JSON over to your frontend code i.e. sencha, sproutcore, cappuccino, gwt or what you choose to use.
Let me know what you choose :-)