I am running node.js server side with MongoDB and I like the use of the NoSQL databases as it is easy to run with.
The android app I am creating stores data into the database from Node.js when it is online, but I want to have a functionality to retrive data offline from the DB?
I have a app.post set up, but I am still not sure how to communicate server-side offline?
You can't communicate server when off-line.
Suggestion : When sever is off-line you have to store data in android database.
Related
I have to build a project that connects a Java application with a node.js server. I've already built the server part, it uses MySQL to store values and can process HTTP requests to return them in JSON format.
The Java app must be able to retrieve data from the server and then process it. The thing is, this application must be receiving information constantly from the server because it will be updating frequently.
Any hints on how to start or documentation you recommend to build this?
Thank you in advance.
I would like to use electronjs to develop a desktop application. The app has to have an offline and online database, such that when the system connects to the Internet, the databases can sync.. How can I achieve this please. Using nodejs to develop apis
Sure, you can do that with sqlite database or pouchDB. If you don't want to write long queries for sqlite then you can use Prisma sqlite. then after just store it in the local database (sqlite or pouchDB) whenever the system is offline. and whenever the system will become online post the last data to your SQL/Postgres/Mongo server.
I wish to connect my Android Studio project to a local MongoDB database (on my pc). I cannot find any solutions that do not use MLab, but I really have to use the local MongoDB storage.
I've tried tutorials online, but they still don't work. What should I do?
The best way to connect a mongo db database to an Android app is via API REST. You can check about that here. Now, if you want to connect your local mongo db with your app is a little bit different process. MLab is a way to deploy a mongo db into the cloud and make it public so any app could connect with that, for that reason all the answers go for that way. One solution could be expose your localhost via ngrok, it's not the best way you dont do that for production it could be useful just for demo or something little.
On resume : Build a rest api with the language of your preference it not affect the result because you always return JSON, then expose your localhost rest api with ngrok and finally connect your rest api with your android app, your base url is the url the ngrok return to you.
Hope this could help. Cheers.
So I'm building web apps or website using laravel as php backend and bootstrap for frontend and using mysql (phpmyadmin) database from hosting service. so because in my country internet connection is bad i thinking a way of making my website to be available or can be used without internet connection , so it will be like this
When bad or no internet connection my website will load local data like html,js,css and also database mysql from local machine
When internet connection is good or available my website will load data like html,js,css and also sync database mysql (phpmyadmin) from local machine into hosting service or otherwise
So how to achieve that?
Use a Service Worker to mediate your front-end network connections and store data locally when no connection is available.
If you just need to sync database to remote host, you can use the MySQL replication setup.
http://dev.mysql.com/doc/refman/5.7/en/replication.html
The FAQ has already told you that the connection doesn't need to be always available
https://dev.mysql.com/doc/refman/5.5/en/faqs-replication.html
Hope this helps.
I want to maintain local sqlite database in MobileFirst platform.I tried with sql adapter. But its not successful. I dnt get what r the actually step or procedure for that.
Plz help me for that and suggest any tutorial which will helps to understand actual process for that...
A local SQLite database in your application has got nothing to do with SQL adapters. Adapters are a conduit allowing you to send and retrieve data from a remote backend, not local in the device.
If you want to use SQLite you will likely need to use either a Cordova plug-in or use the Send Action API to interact with Java code in your app.
Read about SQLite (I'm assuming Android here...): http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html
Read about creating Cordova plug-ins for IBM MobileFirst: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/adding-native-functionality/
Read about Send Action API: http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.dev.doc/devref/c_action_sender.html