I am not able to connectivity of ionic with pouchDB and SqliteDB
How to connect pouchDB with ionic framework.
Please suggest me.
Within mobile apps, it's best practise not to directly connect your phone to the database. This creates a lot more data traffic, which you don't want on a mobile device.
Best practise is creating a rest api which returns the data you want from the database to your app. Most of the time this is a php page, which you can call from within the app with a html request, and then returns the data from the database as JSON.
However, if you really want to use SQLite, you can use sql.js.
Related
I am developing an Android and iOS app that could be used in areas that have a very poor or no data connection. It is a requirement for the app to be pre-loaded with all of the data so it will work even if the app never communicated with the server, but it also needs to be able to update and sync when a connection is made. Is it possible to manually populate the AppSync (Apollo) cache database with data on launch and query and mutate it later? The app also contains several search and filter queries. Our backend API is currently using GraphQL.
I have seen this question, Is it possible to build offline-first mobile apps using AWS AppSync?, but it is a little different that what I'm asking.
The recommendation would be to hydrate (read: pre-load with data) a local SQLite database after install. SQLite is what the 'local cache' uses to persist data on the device.
Refer to this github issue for a code example of how to do this:
https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/160
i was planning to make a project out of my curiosity , to make a ionic framework mobile app that fetches data from a website's database (which i already made). Is it possible? How? i have no idea how to do that because im still on the learning process(novice)
Yes you can do this and its possible. First of all you need to create a connection that you Ionic App can communicate with your Website.
That is Called an API. If we dont use any big tech Words to explain this.
The Common practice is build a REST-API first.
Its a Link, and when you goto the link, the link will give you data in a Format JSON or XML. So your App can Parse the JSON/XML Data and display in your Ionic App.
Example.
www.yourwebsite.com/getusers
www.yourwebsite.com/adduser
you will call the first link from your App in GET protocol and this will give u a list of users in JSON Format.
you will call the second link from your App in POST protocol with User Parameters and this will add a user and Will give you Success or Error Json/XML Response.
So first you need to learn a bit about REST-API and how to build them. You can build them in any language.
REST API FOR BEGINNERS
Then plan which language is the best for you and follow up a good tutorial.
And Finally follow this on how to call an API from IONIC
CALL API FROM IONIC
Cheers XD
A web service is a service offered by an electronic device to another electronic device, communicating with each other via the World Wide Web. In a Web service, Web technology such as HTTP, originally designed for human-to-machine communication, is utilized for machine-to-machine communication, more specifically for transferring machine readable file formats such as XML and JSON
Using PHP and MySQL with Ionichttp://masteringionic.com/blog/2016-12-15-using-php-and-mysql-with-ionic/
Creating an Ionic App with MySQL and Backand
I want to create such a application in which my iPhone will have the UI for entering the data for the employees. After clicking on the post button data should be saved on the sqlite database and I also want to retrieve the data on button click from the database. I want to use node.js for communicating between my iOS app and the database. Since I have never used node.js before, please give me some links where I can study the sample applications.
I am not an iOS developer but I would make a REST service in Node.js that can sit between your Iphone app and your database. You most likely are going to want to have some form of authentication on the service.
Also does it have to be sqlite? There are databases that can understand HTTP. If you use CouchDB (there are others) you can let your app talk directly to your database. That means you can leave out Node.js completely. You can go even further and use a service that will provide a back-end for you. Something like parse.com (there are others) will do this for you.
I have an application that has login screen and it will get user name and password first then whenever application will start, username and password will be checked from data base and after that i need some data to be fetched from database and display in iphone application. So how to integrate mysql data base with iphone app?
you can go through the tutorial for this
raywenderlich provided a great tutorial for this.
Check this
http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/
tutorial for connectivity with sqlite.
You will not be able to connect to MySQL directly from the iPhone. You must use some intermediate layer such as a Web application with PHP.
So, you will have something like this:
iPhone POSTING a request to the WebServer using HTTP Web Server connecting to the MySQL database Web Server returning data to the iPhone (XML, plain text) iPhone processing the data You can use this technique to query and insert/update/delete data.
Once i found this library
http://www.eval-art.com/2008/09/05/libmysqlclient-for-iphone-2/
for mysql, and i dont aware how it works.
i simply want to make an iphone application with a remote database. For exemple facebook iphone application, they have all access to a huge database. Are they using Mysql ? Because i heard that mysql is not secure through iphone and app store may reject it. Can someone help me figure out whats the best to use.
What all those apps are probably using is a RESTful web service endpoint that is in turn backed by a large database. There are a lot of libraries for creating web services regarding of what application stack you're using.
If you're using MySQL, you'd write a Python/Ruby/Whatever-you-choose backend component which actually connects to a MySQL instance, then reformat the results as a web-service endpoint. SOAP can work if need be, or (in my opinion) a better option would be to write a simple JSON service that your iPhone app can parse. There are lots of JSON/WS iOS libraries that are a google query away.
Apple will not be bothered what database you are use remotely (will be accessed through defined API's).