Results 1 to 5 of 5

Thread: Mobile apps, databases and Cloud server interaction

  1. #1
    Junior Member
    Join Date
    Jul 2015
    Posts
    25

    Mobile apps, databases and Cloud server interaction

    Hi,

    I'm confused about how a phone app interacts with a cloud server. How do I access data on a Lianja cloud server from a mobile app (for that matter how do I access it with a desktop app)? I know how to run a web app on a cloud server and access it via a web browser, is there a way to just run a database on the server without an app? Does the associated database get packaged with the mobile app for local access or is it supposed to access it remotely?

    Has there been any documentation written on handling data remotely?

    Thanks.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,368
    Blog Entries
    22
    Hi Joanna,

    If you build a mobile app using best practices and standard sections the data is automatically bound for you. It is a seamless SPA interacting with the database under the control of the cloud server.

    If everything is data bound and validation is handled by remote procedure calls for you, and... you can dynamically create HTML5 content into webview sections in what other way are you wanting to access data on the server? You have Lianja.evaluate() and Lianja.evaluateJavaScript() as well as a lot of built-in OData functionality.

    Try reading the developers guide on this and see if it makes sense to you.
    http://www.lianja.com/doc/index.php/...velopers_Guide

    Look down the page to the section "Lianja Cloud Server for Web/Mobile App Developers"

    One document well worth reading and understanding is this:
    http://www.lianja.com/resources/blog...a-html5-client

    It includes a lot of information regarding OData access if you MUST access data programmatically. In most cases you should not need to.
    Last edited by yvonne.milne; 2016-08-26 at 06:10. Reason: Link updated
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,368
    Blog Entries
    22
    Just to clarify...

    - You deploy your app and its database.
    - You specify the mobile app settings in the project settings for phonegap
    - You build your mobile app
    - In there while testing, it will inject a reference to your local machine and access the cloud server using port 8001
    - After you have fully tested everything you change that URL to point at your cloud server production installation

    There are example mobile apps included that you can study and install on your mobile devices.

    Mobile Apps are regular client/server apps with the UI on the mobile device and the database on a remote server under the control of the cloud server.
    Last edited by barrymavin; 2016-01-27 at 22:55.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  4. #4
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,196
    Hi Joanna,

    Let me create an anthropomorphic description of how things work (because that's they way I think <s>):

    1) User app on mobile phone opens a page. It needs data. It says to the Cloud Server (using a JSON call) "hey, I need the data from view vt_myview with parameter x set to value n."

    2) The Cloud Server says, "OK, I need to get the data from vt_myview with parameter x set to value n" -- it then runs the view, just as one would run the view from the command console, connected to the backend. Now, that could be Lianja SQL Server, which could be on the same machine or could be somewhere else on the network (reachable by ODBC). Or it could be MSSQL, etc.

    3) Having gotten the data back, the Cloud Server replies to the mobile app: "OK, I've got your data, here it comes," and sends it back as oData (a JSON string).

    4) the Mobile app then gets the oData string, decodes it into a JSON object, and the UI does its work off that object. When the mobile app makes a change to the data it sends the old and changed values back to the the Cloud server and the general cycle repeats.

    All of this is tucked out of the way in normal development. As it should be: the hoops that have to be jumped through (the "impedance mismatch" between data and code that the rightly-vilified ORM's seek to solve) don't exist in Lianja.

    Coming down the line will be offline use of data. The first call to data will go through a traffic cop who, when the app is disconnected from the Cloud Server, will re-direct the JSON call to be processed by a JavaScript function against the phone's local data store. At least that's how I imagine it will work. <s>

    hth,

    Hank

  5. #5
    Junior Member
    Join Date
    Jul 2015
    Posts
    25
    Thanks for the explanations guys, it helped a lot.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us