언어 설정

Menu
Sites
Language
Offline web application

Hi,

I am using webservices in my whole webapp (as it requires network all the time).  Is there any way to make webapp offline?

 

Thanks

 

 

Responses

12 댓글
AVSukhov

Hello,

If your application requires data from network, you can not make it offline. Or you can to cache some data, but there is a question the relevance of these data.

 

John Ixion

Service Workers will be a solution: http://www.w3.org/TR/service-workers/

John Ixion

Intro: http://www.html5rocks.com/en/tutorials/service-worker/introduction/

Rajashri Pawar

Thanks, I will definately try for this.

Rajashri Pawar

I have tried service worker.

Below is my code to register service worker :

if ('serviceWorker' in navigator) {    
    try
    {
      navigator.serviceWorker.register('/sw.js').then(function(registration) {          
        // Registration was successful
        console.log('ServiceWorker registration successful with scope: ',    registration.scope);
      });
    }
    catch(err)
    {        
         console.log('ServiceWorker registration failed: ', err);
    }
    }
    else
        {
            console.log('Browser not supported.');
        }

 

But I am getting 'Browser not supported.' :(

In this case what should I use?

Thanks

John Ixion

afaik Service Worker is not supported in Tizen atm

John Ixion

Service Worker is an early draft: http://caniuse.com/#feat=serviceworkers

Vaishnavi GM

Hi,

Please help me in handling network requests in Tizen Web apps. I tried many things but i got result only for native apps.

Rajashri Pawar

You can try for this

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/HTML_in_XMLHttpRequest

Marco Buettner

Our should it works ... web server offline? wtf?! If you need server connections isn't possible to use it offline.

Also you can download all your data from the web server by online connection and store it in indexeddb or something else

Rajashri Pawar

My question was wrong Marco Buettner, I mean to say first time all data downloaded from server but after thatI have to store that data and it should update automaticaly when update arrives. Large ammount of data is there, so it is possible to store data in indexedb and update everytime. Is it a good way to do this??

What should I use for offline syncing?

 

Thanks

AVSukhov

Hello,

You can store you data any possible way, it can be LocalStorage, DB or write to the file. It all depends on your requirements.

But no one except you can not determine the validity of data. And you have to either each time when network avaliable to make a request to the server for data validation or notify the user that you may need a new data that user provided an opportunity for the application to be online. Otherwise, you have to work with the data that you have.

Also, maybe this article helps you:

http://stackoverflow.com/questions/3285348/offline-online-data-synchronization-design-javascript