facebook

Database Useage

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #336442 Reply

    nvts
    Member

    Hello,

    Is there a sample database type app created with MobiOne. I am wanting to use sql lite or ? for a form type app that stores the data collected.

    Thanks in advance

    #336454 Reply

    nvts
    Member

    To all the experienced developers on this forum.

    I asked this same question 6 months ago.

    I am really looking for someone that has developed a app for data storing SQLite database connectivity for off-line mobile database storage. Having all CRUD functions accessing the db.

    I have looked and have not seen a good example or tutorial. I really like MobiOne and have purchased it, but I need some help/direction on this.

    I have a project that I need this for and I am looking for an experienced developer for help on this project.

    But what I would like to do as well is provide a demo/tutorial for others like my self to learn from. I am looking to use MobiOne for data collection apps, so this is important.

    Thank you in advance,
    Howard

    #336458 Reply

    Brandon
    Member

    I have used SQLite for a couple web apps. What exactly are you trying to do with it?

    #336459 Reply

    nvts
    Member

    Hello,

    I am looking to develop database apps for our companies staff to run on their ios or android devices. They will be collecting data in the field and storing local to their device (because sometimes it will be in a remote area with no coverage) then when in wifi coverage or 3/4G area or if it has to wait till they get to the office that is fine. Then from the office database be able to report from the data and send to the clients and so on.

    Thanks Howard

    #336460 Reply

    Brandon
    Member

    I used the PhoneGap sample and it seems to work pretty good.

    http://docs.phonegap.com/en/2.5.0/cordova_storage_storage.md.html#Storage

    #336462 Reply

    nvts
    Member

    Thanks for the site.

    Do you have this in a sample MobiOne developed app to view and play with? I have tried something similar in the past and could not get it too work properly.

    I am new to this kind of development and a working example would be helpful with just a few fields for the CRUD and the interface attached.

    I think this would help me a lot and others that have been looking for this. I am still trying to get familiar with MobiOne to make this happen.

    Thanks again for your quick replys.

    Howard

    #336463 Reply

    Brandon
    Member

    I may be doing a sample for my mobione cheatsheet app, but currently dont have one I can share the code with.

    #336464 Reply

    nvts
    Member

    BTW.

    I was looking at this a while back to work with MobiOne and I was not successful at all.

    http://editor.datatables.net/

    This was the code I tried within MobiOne

    var editor; // use a global for the submit and return data rendering in the examples

    if ( !window.indexedDB ) {
    window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
    }
    if ( !window.IDBTransaction ) {
    window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction;
    }
    if ( !window.IDBKeyRange ) {
    window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange;
    }

    var db;
    var request = indexedDB.open(“todo”, 1);
    request.onupgradeneeded = function(event) {
    var db = event.target.result;

    var objectStore = db.createObjectStore(“todo”, { keyPath: “id”, autoIncrement: true });
    objectStore.createIndex(“item”, “item”, { unique: false });
    objectStore.createIndex(“status”, “status”, { unique: false });
    };
    request.onerror = function(event) {
    console.dir( event );
    };
    request.onsuccess = function(event) {
    db = request.result;
    };

    $(document).ready(function() {

    // Set up the editor
    editor = new $.fn.dataTable.Editor( {
    “domTable”: “#example”,
    “fields”: [ {
    “label”: “Item:”,
    “name”: “item”
    }, {
    “label”: “Status:”,
    “name”: “status”,
    “type”: “select”,
    “ipOpts”: [
    { “label”: “To do”, “value”: “To do” },
    { “label”: “Done”, “value”: “Done” }
    ]
    }
    ],
    “ajax”: function ( method, url, data, successCallback, errorCallback ) {
    var transaction = db.transaction([“todo”], “readwrite”)

    if ( data.action === ‘create’ ) {
    transaction
    .objectStore(“todo”)
    .add(data.data)
    .onsuccess = function(event) {
    successCallback( {“id”: event.target.result} );
    };
    }
    else if ( data.action === ‘edit’ ) {
    data.data.id = parseInt(data.id,10); // Use the ID that was submitted
    transaction
    .objectStore(“todo”)
    .put(data.data)
    .onsuccess = function(event) {
    successCallback( {“id”: event.target.result} );
    };
    }
    else if ( data.action === ‘remove’ ) {
    transaction
    .objectStore(“todo”)
    .delete( parseInt(data.data[0],10) )
    .onsuccess = function(event) {
    successCallback( {“id”: null} );
    };
    }

    }
    } );

    // Initialise the DataTable
    var t = $(‘#example’).dataTable( {
    “sDom”: “Tfrtip”,
    “aoColumns”: [
    { “mData”: “item” },
    { “mData”: “status” }
    ],
    “oTableTools”: {
    “sRowSelect”: “multi”,
    “aButtons”: [
    { “sExtends”: “editor_create”, “editor”: editor },
    { “sExtends”: “editor_edit”, “editor”: editor },
    { “sExtends”: “editor_remove”, “editor”: editor }
    ]
    }
    } );

    // Get data fromt he local database and populate the datatable
    // This should go into the db success handler
    var d = [];
    setTimeout( function () {
    db.transaction(“todo”).objectStore(“todo”).openCursor().onsuccess = function(event) {
    var cursor = event.target.result;
    if ( cursor ) {
    // Rows need an ID
    d.push( $.extend( true, {}, cursor.value, {DT_RowId: cursor.value.id} ) );
    cursor.continue();
    }
    else {
    if ( d.length > 0 ) {
    t.fnAddData( d );
    }
    }
    };
    }, 500 );
    } );

    Howard

    #340391 Reply

    ManuelNogueira
    Participant

    @nvts wrote:

    Hello,

    Is there a sample database type app created with MobiOne. I am wanting to use sql lite or ? for a form type app that stores the data collected.

    Thanks in advance

    Hello NVTS-

    I am also in the same situation,,,Have you been able to resolve your problem?
    If you have, I would appreciate if you could share the solution.

    Thanks,
    MANO

    #340394 Reply

    aklisiewicz
    Member

    @nvts wrote:

    Hello,

    Is there a sample database type app created with MobiOne. I am wanting to use sql lite or ? for a form type app that stores the data collected.

    Thanks in advance

    I do not have MB1 license, and I’m still holding up before I invest my time and money.
    The database question was asked here about a year ago and after searching the forum I haven’t found adequate answer. I’m mostly interested in database type Apps and need to know how well MB1 supports the use of local SQLite (or remote MySQL/MSSQL) ???

    I have asked this same question myself and haven’t got satisfactory answer. Even more importantly I would like to see some example of full CRUD operation using MobiOne.
    If somebody have a full working example App it would be more than welcomed to post it here for study. I like the idea and concept of MB1 but missing clarity, examples and documentation on implementing SQL into Apps holds me back from buying the license.

    PS>
    For those who were asking about connecting to MySQL from Android App I just can confirm – it is possible and you do not have to use web/PHP services, however I’ve done it with some other tools than MobiOne.

    Arthur

    #340414 Reply

    Brandon
    Member

    You can look at my template Notepad screen. It uses the DB to store notes, I have used it in several projects with great success.

    http://cincyplanet.com/mobione/templates/

    #340418 Reply

    ManuelNogueira
    Participant

    Hi Cindy-
    Thanks for your reply.
    I downloaded your Contact Screen via your link / Oronjo and tried it on the Mobione emulator
    with no success… I also tried compiling it and saving it to my phone and it also did not
    function. I’m sure I’m doing something wrong…Help!
    I tried on various occasions saving what I typed, updating first than saving it etc etc
    Do I have to have MySQL or SqlLite installed on my pc? excuse my ignorance…

    Thanks

    #340423 Reply

    Brandon
    Member

    for the contact screen you need to have a php file on a server that supports php to have it work.
    sqlite is a browser based db so you dont need to install anything. To use my sample be sure to read the notes carefully as there are some things you need to change to make it work correctly (mainly the Action for the button!).
    If you are new to MobiOne and javascript I would suggest some tutorials to get more familiar with it before tackling the database and external resources aspect.

    #340426 Reply

    ManuelNogueira
    Participant

    Thank you Cindy!

    #340448 Reply

    nvts
    Member

    So, back then I asked if M1 could support or work with SQLite or MySQL. I wanted to see some examples of this working. I was sent the same link to by CincyPlanet to look at. It showed me that it could be done, but you have to know how to code in JS or PHP to make either work.

    This does require coding to make it work. There is no plug or play or drop and drag to make it happen.
    This has nothing to do with M1. It does work for both, but it takes a lot of hours to perfect a good CRUD integration for SQLite or MySQL.

    I am still perfecting a CRUD for both that can be reused for all my data apps.
    MobiOne is a great GUI to build in. It is not a code generator for manipulating custom items like this. It requires coding to do the MAGIC.

    If MobiOne did do code generating, it would be worth 5 times what the license costs and I would have paid that.
    It does work for both as I have it working, but still perfecting the reusable code.

    CincyPlanet’s example is a great start and shows that it works.

    Cheers…

Viewing 15 posts - 1 through 15 (of 16 total)
Reply To: Database Useage

You must be logged in to post in the forum log in