1
rehman
7y

Guys i'm very confused for doing backend of phonegap. I have seen examples of phonegap app with php all by ajax requests and i have seen that we have sqllite plugin on phonegap too so is there ang way we can do backend without ajax as db is must in my app

Comments
  • 1
    Hi @rheman,
    You could have all of your data etc handled in the local SQLite database on the phone - then use the SQLite Cordova plugin to interface directly with it.

    The reason you would usually not want to do this is:
    1. You would have to ship the app with all the initial application state built in. This means that if you wanted to add some form of back end improvements or upgrades you'd require a rerelease of your app

    2. Lack of centralisation and analytics- if it all happens locally you have no window into the data your app collects including specific usage analytics

    You can do a combination of local database and remote - in the past I've stored data in a local database (for form submissions) which is then synced to the remote server
  • 0
    @mattrayner thanks for this value able comment . So ajax request for remote server can solve the problem. Can you please tell if we want to run website simultaneously then we should do it with building own api?
  • 1
    API would be the best bet, many frameworks for building one as well.

    And the API and website can run simultaneously.

    You can even just host the API on a different port on your server. And then run the website on 80 or on a SSL port.

    Good luck!
  • 1
    I agree with @jacojvvdev - an api is the best bet
Add Comment