Offline database, app work with out internet connection.. need help +Monaca Template



  • Hello,

    I found WordPress plugin suit my need but I don’t know how to make it in app that working offline… I want who install the app browse it with no internet connection what so ever … even the database update with an updated app throw the store not throw any website … and I want to make it dynamic: user can add his favorite or share the text throw the app… your help is needed … plugin use tags I don’t know if XML can work like it… and it large amount of data lets say around 100MB (I didn’t start yet … until I see best way to do it)

    //
    Monaca Template: how I make Onsen UI V2 JS Tabbar work with Onsen UI V2 JS Navigation and Onsen UI V2 JS Splitter
    I mean I need tab and Splitter with Navigation: coping from template to template just mess things up.

    programming scale : 0 but I work

    Thanks for your time



  • @AFAA1640 Welcome to the Onsen community. I am not exactly certain what help you need, but I figure I will take a shot at a couple of your questions.

    1. The wordpress plugin - WordPress does not work for mobile applications as it requires a PHP server, so I assume you mean you are running a WordPress site and you have a plugin that does everything you want, except for offline use. So you want to create a hybrid mobile application that emulates that functionality, but will upload the data later once a network connection is established. Is this correct?
    2. XML for transferring of data - The preferred and most portable format is JSON now.
    3. Monaca Template - I assume you mean you are using the Monaca Cloud IDE and using Onsen Templates. Monaca is a developing tool suite. It has a developing environment as well as compiling tools. Onsen is an agnostic UI framework. It is more of what creates the look, feel, and usability of a mobile application. Having said that, Onsen is nothing more, in its simplest form, than JS and CSS.
    4. Regarding Onsen navigation, I suggest the following resources which may offer you a better starting point, as all of those components can be combined in one form or another.

    Official Documentation

    User Code



  • @munsterlander Thanks for help… for 1. No what I mean is I want to show info/data in the app as aperied in the blog with no need for internet connection and no link to the WordPress/plugin it’s self(my site)… it’s like saving the blog/plugin to html page and put it in the app … but it’s large amount of data so I need like local database inside the app or alternate salutation …



  • @AFAA1640 Oh, so you just want to consume the RSS feed from your blog so your users can read it later right? If so, this example could be easily modified to utilize the local sqlite database within cordova. https://docs.monaca.io/en/sampleapp/samples/sample_rss_reader/



  • @munsterlander No. not RSS I want to put all data inside the app with no need for the web page or internet connection. Complete mobile app that separated from actual wordpress/blog and work offline.



  • @AFAA1640 Pull the data on first app startup or embedded with the app?



  • @munsterlander Embedded with the app



  • @AFAA1640 Ok, then you can use sample RSS reader as a starting point for UI and concept of flow, then you will need to embed that much data in a SQLite DB. That is accomplished with this code:

    function populateDB() {
        db = window.openDatabase("dbData", "", "Example DB", 5000000);
        db.transaction(function(tx){tx.executeSql('CREATE TABLE IF NOT EXISTS tblData (ID INTEGER PRIMARY KEY ASC, MYDATA TEXT NULL)')}, errorCB, successCB);
    }
    
    function errorCB(e){
        console.log("Error processing SQL: "+JSON.stringify(e));
    }
    
    function successCB(e){
         console.log("Success: "+JSON.stringify(e));
    }
    

    Here is a help doc to get you started: http://html5doctor.com/introducing-web-sql-databases/ as you will then just use SQL to query and populate your list or whatever element you choose to use.



  • @munsterlander Thanks for great help.


Log in to reply