Making offline version of web apps - javascript

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.

Related

How to establish a SSH MySQL database connection for a Electron App?

I'm making a app with the Electron Framework, within this the user needs to register an account to be able to use this app.
This worked great when making this for my localhost database, but creating connection with the MySQL server that is running on a dedicated server seems not working for me, and also insecure since people can unpack the .asar file and see the database credentials..
So, I've heard about 'SSH Connection' but can't figure out how to set this up, and get this up and running for my Electron app.
I am using XAMPP to create a MySQL/Apache server and I use HeidiSQL to enter the MySQL server.
For your info, I've never used Electron before and this is my first time using it. I've also never used a SSH connection before (at least, not that I'm aware of.) so a guide for newbies would be nice.

How Do I connect a local MongoDB database to my Android Studio Application without MongoLab?

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.

Storing data offline on a Node.js backend for Android

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.

Mobilefirst platform local database connectivity with sqlite database

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

Sync data from local SQL Server to MySQL Server on Internet (live server)

I have upload local server data to live server mean i work offline after work done and testing the data on localhost. Sync data from local SQL Server to MySQL Server on Internet (live server). I wanna save time. I found some article about web services may it help full . I am a php new developer and to do this task in php. any way to do this any suggestion and method.
I use WAMP server to work with PHP/MySQL offline. You just install it and then you can plonk your PHP files in there and run it from http://localhost.
If you want to run you code locally and point it to your live server this is entirely possible. You just need to make sure that you have access to the relative ports that your database runs on etc.
See http://wampserver.com

Categories