Can a ionic app fetch data to a website's database? - ionic-framework

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

Related

Accessing Database using node.js in iOS

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.

iOS app to access database from my own website

I own a JSP website for listing books stored in my own database in the same website. I'm planning to develop an iPhone app to access this database and display book list and book details.
My questions are:
If I have to use web services, where
should I start to develop these web
services using eclipse.
How to access these data and display
them in a list.
I want to cache data extracted and
store it locally in iPhone, so when
no Internet connectivity available
the user can view these data
offline. Is there a database engine
embedded in iPhone to sotre such
relational data.
Thanks you all,
Develop the webservice with what you know. PHP, Python, asp.net, java.
Access the data using HTTP GET POST methods. Many application are using the json-framework.
iPhone as the sqlite3 database embed in it operating system. You can find plenty of tutorial on the internet.
1 & 2 Define the services you are going to provided from you website, choose a web service protocol, JSON is generally easy to use, so does xmlrpc.
3 Use core data to cache it locally, if no internet connection, you can fetch the data from core data

Web service advice for an iPhone app

I am currently working on an iPhone app that will have a user log in, enter a workorder or building, and the app will display workorder/building information. The user will then be able to edit some of the data and submit it to the server. The backend database is a MySQL server. What is the best web service to use for this situation? I've been reading about SOAP, JSON, etc. but I honestly haven't found a good description of the pros/cons of each and how well they work with an iPhone app. Any and all help (or links to useful reading) would be greatly appreciated!
Ruby On Rails or PHP is your best bet for the web services layer that goes between the phone and the MySQL and go for JSON as that is the most commonly IPhone Web service data format as it is the one that requires the least amount of data upload by the phone. Touch JSON is commonly used IPhone framework for this.The RoR or PHP web services layer serves up JSON data based on URL requests by the IPhone. There's loads of stuff on this if you google which I did when faced with a similar problem.

Hosting a web service for an iPhone App

I need to write a fairly simple Delivery Tracking application. The device needs to know information about the 'matters' such as status (delivered/awaiting delivery), type (for delivery/for pickup), address, payment accepted etc.
The iPhone part of the app seems very simple but in terms of hosting some kind of web service is the part I am unsure about.
Does Apple have some kind of service or recommending way of handling this?
The web service would need to store all the information about the matters and receive updates from the device when matters are delivered and then there is a possibility that new matters could be sent out manually from the depot.
These are the parts I am unsure about - any ideas?
There is no Apple recommended way or service. For a similar system to the one you are proposing I have a Ruby On Rails (http://rubyonrails.org/) backend application with MySQL database hosted by a third party. It took me a couple of weeks starting from no knowledge of RoR to get the Rails App and database up and running. I recommend Appress's Beginning Rails 3 as a good book to start with. You can develop and run Ruby On Rails on MacOSX and easily port your app to a Linux server when it sufficiently developed.
There are other web-services frameworks such as PHP or ASP.NET which you could use so long as they return data in the form of JSON or XML.
The Ruby on Rails app can render JSON or XML when the iPhone app sends a request via NSURLRequest. I'm using Objective Resource (http://iphoneonrails.com/) which takes care of a lot of work connecting to RoR backend but you can use the many open source JSON frameworks such as TouchJSON (http://github.com/schwa/TouchJSON) or use NSXMLParser, an Apple Objective-C class, if your request returns in the form of XML.

What is good way to register users from phone app

We have a web application and we've built phone applications (iPhone, Android, BlackBerry) to be companions to the site. The usual workflow is that an existing user of the site gets a phone app and then plugs their existing credentials into the phone app and they are off and running, but more often now we are seeing folks who are downloading the app and then (and this should not surprise anyone) don't read the help screen that explains they need to go and get credentials at the web site and therefore cannot connect to the application which does require registration to manage their content. This is a giant usability fail condition.
So we know that we need to put user registration workflows on the phone app.
Other than the obvious solution of duplicating our registration page on the mobile, does anyone know of a better identity solution for the phone? For example, on the desktop we also use Facebook Connect as an identity server and the users love it. I'm looking for something that simple that we can implement across the major smartphone platforms.
Clarifying note:
I should add here that this registration mechanism is likely to; and it would be desirable if it did, go hand in hand with a general identity/authorization mechanism such as the Facebook mechanism mentioned below.
One other place I'm poking around is to see whether there's an openId solution that does not require a browser to pop up.
Restful service might be the e asiest way for you to achieve this, you can use it on any device that can make http requests, so you can make your own login screens and talk to the s ervice that way...
Facebook has a Connect API for the iPhone. Integrating it into your iPhone app is very smooth.
http://developers.facebook.com/connect_iphone.php
On the BlackBerry we were able to build a fairly robust REST pipeline between the client apps in the field and our servers. We primary use the framework for updates, but the device API is generic enough to be able to build almost anything you need via standard HTTP/HTTPS GET/POST calls.
On the RIM platform, look into the HttpConnection API as a starting point. There is also an example on the BlackBerry Developer's site which will help. Finally, I believe there are several examples inside the sample package that comes with every BlackBerry JDE (IDE + API download).