I am a bit of a newbie when i comes to iphone dev, but was wondering the best way to retrieve informations form a MySQL database.
I have a load of information via a website all stored on a database which changes daily and wanted to build an app that pulled in the information depending on parameters.
What would be the best way to achieve this? Can you grab info from MySQL or would a XML feed be a safer bet?
Build RESTful web services that hide your MySQL database and then consume them from your iPhone app.
Related
I'm new in developing Xamarin app and I'm not a backend developer. I use VS 2017 to develop Mobile App.
Can anyone please give me links how to create a REST API (Json type) to connect with Backend server? I need to retrieve data from my company server.
The app will take many parameters as database name, table name and return a dataset of all the records. I know that the RESTful can be build for specific table but how can I code the RESTful API can take parameters as databases and tables bases on the input on my Xamarin app.
Please help. and how can I display the record in list view on Xamarin app as I did for my Android app. Thank you.
If you have other way to connect with .NET core server.Please tell me solution.
Use Refit, install with nuget. They have very detailed docs and how to use:
https://github.com/reactiveui/refit
You could use Restsharp for your problem: http://restsharp.org/. It's a easy to use and quite popular REST/HTTP Client Libary.
I already have a django application and am trying to develop an iPhone app. I'm using mysql as the database for the django app.
Here are some questions I was having :
Is it necessary to use Core Data for anything?
Can I create a rest api to interact with the mysql database?
If so, would there be any advantage, at any place or reason, to use Core Data in addition to mysql. For example, for an app like Pinterest, Tumblr, Facebook, etc. are they using Core Data at all? If so, why and how?
Core Data is one way to give you a local database on the phone. With only MySQL on the server, the app cannot access any data when offline. Even in an online-only app, a local cache of some of the data can be useful to speed things up.
Similar to Django,where it has and database-abstraction API that lets you create, retrieve, update and delete objects, iOS has an CoreData. What under-lies is still SQL. From the django end, you need to create an api that returns the class of objects or something. On the iOS side, you have to call this api and parse the data and save it locally using CoreData.
Hope this helps..
I'm about to start an iOS project that requires pulling user's data from an SQL Database and viewing it within the App. Before I begin I'm looking for conformation that I'm taking the right (best) route.
My Plan:
App starts on login page (app will display data from another service)
App uses AFNetworking to post request to web service
Web service gets user data from SQL Database and sends back JSON
App uses JSONKit to parse the feed and load into Core-Data
App uses info from core-data to populate UI
Does this seem like an appropriate way to get the info into Core-Data from SQL? Any suggestions for doing things differently?
Thanks.
Are you receiving the response from the web server in JSON? If so, the fact that the server is using an SQL database is immaterial. What you need to know is how to parse JSON for inclusion in a core data store. Cocoa is my Girlfriend has a pretty good tutorial up.
Part 1
Part 2
To answer your comment, here's what I've done.
Display a login screen. The login credentials should be stored in the keychain for security. I've used SSKeychain for this.
To handle sending and receiving data from a web request your best option is to use a pre-built library. I've always used ASIHTTPRequest, but since it is no longer under active development, you should probably look around a bit before you commit to anything. I'm sure there are nicer and cleaner libraries out there.
You need to parse the JSON responses. I'm a fan of JSONKit. It's very fast, very easy to use, very robust.
Pulling data out of the core data store and displaying it in the interface will be no problem for you. If you create a new project in Xcode most of the setup will be done for you.
Now, there are a lot of projects out there that attempt to combine web requests, json parsing and core data loading into one framework. I've tried to use a few of these and haven't had much luck. The ones I've tried haven't been robust and very difficult to debug. Setting up your own request/parse/load code is not difficult at all, just a bit time consuming.
I am sure that there are a lot os ways to make implement this problem. Your solution is one of the popular solutions I guess but you could connect to the DB via a socket and talk with the database directly e.g. Going over a port 80 web site has the advantage that the possibility of some kind of firewall blocking the communication is very low. I would solve this kind of problem the same way I guess.
I have created an iphone app which basically pulls json feeds into my iphone..I have created the JSON file manually and put the jSON file in My FTP Server..as far as updation are concered the client gives me the updation via email or skype which i then update my JSON file that is in the server.what i want to develop is a Backened CMS so that the client is able to handle the maintanenece.i m a noob as far CMS is concerned,which is the best place to start..is wordpress a better..Any advice on how this can be achived would be helpful
Appnx has a pretty neat backend.
iPhone-CMS uses TYPO3 as the backend and can generate native apps.
Please take a look at our JSON-based StorageRoom CMS. We built many mobile apps ourselves and always had the content problem, so one day we created our own CMS.
I know about http://www.kumulos.com/ which allows us to easily create database for iphone and store it there. They also let you create APIs to connect to this database.
Only problem is that I am not sure whether we can access this database for viewing it on a asp.net website.
I would like to know if there are any other sites which does similar thing?
Thanks!
You can access Kumulos from an asp.NET using the JSON protocol.
There is example PHP code and its very simple to do, would be easy to accomplish the same thing in ASP.
http://www.kumulos.com/2011/01/25/accessing-kumulos-apis-and-database-from-php/