Build an ASP.Net web app with offline functionality

后端 未结 4 636
眼角桃花
眼角桃花 2020-12-29 00:41

I\'m in the process of building an asp.net (3.5) web app and was wondering if you knew of any way I could do it so that there would be some offline functionality.

Th

4条回答
  •  爱一瞬间的悲伤
    2020-12-29 00:54

    For offline HTML5 applications with ASP.NET, see this link and this link.

    For offline functionalities, there are some alternatives:

    01 - If you need to store small amounts of data in the offline application, and security is not a big concern, you can use HTML5 Web Storage (link, link, link, link, link, and take a look at CanIUse for understand browser version support).

    The main disadvantages are that it lacks in security, is key-value based (no complex structures) and there is a big limitation in storage size (5MB for most browsers).


    02 - If you need larger amount of data, you can look at IndexDB (link, link, link and CanIUse) or Web Sql (link, link, link and CanIUse for browser support).

    The main disadvantages of Web SQL are that it is not supported by Firefox an IE. Also, it is deprecated by W3C.

    IndexDB is good (link), but it seems like ios still doesnt support it (see canIUse).

    For approaches 1 and 2, you can make a responsive design or a dedicated mobile web site in your ASP.NET application (link).


    03 - (greater flexibility demands more effort) Implement an Web Service in your ASP.NET application and a mobile native app applying concepts of Occasionally Connected Applications (more info: link, link)

    • ASP.NET Web Application => For the web application, expose a Web Service with services related to the offline functionality.

    • Mobile application => Implement a native mobile app (e.g., develop an app for android and iphone) with a database for the application. You then create the offline functionality in the mobile app that will use its own database to read and write (locally) data that must be available offline.

    You then implement a silent synchronization mechanism in the mobile app that relies on internet (e.g. a recurrent thread) that will search for updates by accessing the ASP.NET application via Web Service. This sync mechanism will send the data that was stored locally and recover data from the Web Service that can be useful for the offline functionality.


    Hope it helps.

提交回复
热议问题