How to connect to an online database from my iPhone app? [closed] - ios

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to make a very simple app that connects to a database and retrieves some questions and answers for a quiz.
What is the simplest way to do this? Is Parse the way to go, or is it possible to use a sqlite3 database, which is hosted online? I want to keep it as simple as possible.

you should NEVER connect your mobile apps directly to a database. you should create a rest api for that, a simple php for example that will be connected to the database and return the results to you.

For connecting data on a server to a mobile app you should use a API Rest, not a direct connection to a database.
You should denitively go for Parse. You would have to implemente nothing on server side and it has an SDK already implemented for iOS that helps you retrieving the information.
Also the free plan could fit you for quite time.
https://parse.com/docs/ios_guide#top/iOS

The easiest way would be to be create a Rest API in any of the server side language like PHP and access your online database. Having said that , this would mean you would require it to be hosted somewhere online.
The best option in case you don't want to spend on hosting on a server and writing a server side script to access the traditional database would be use to Parse which has options of saving the data in the offline mode in your app and then you can sync it with the database online.
About sqlite3 being hosted online , that won't be a suitable option . I suggest you go for Parse it is easy to learn .

Best a way for your task - Core Data
If user don't have access of network? How he takes questions and answers?
Just I too building that task.
Parse can use when we want save results test or something data user

Related

Best Database to use for iOS application [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am trying to develop an iOS app (Swift) that requires the use of database. The app will have three different users login and courses. I have 5 database tables that i will have in my app but I am not sure which database platform to use. (I have done research and some people recommend Core data and others say Realm)Thank you for your suggestions.
Depend upon your requirement you need to choose Realm, Sqlite and CoreData database.
For Reference check this link
https://rollout.io/blog/ios-databases-sqllite-core-data-realm/
Since you are just getting started, I would suggest you to try out CoreData and see if it works for your use case. It is object oriented, works well across all Apple platforms and is well integrated with Xcode. Although, please note that this only works for local data. However, if you need (or wish) to store the data on remote server then Firebase would be the way to go. Also this might be preferable if you later wish to do analytics based on the data stored.
Both of these work pretty well and aren't exactly comparable to each other coz they have different purpose. You just need to figure out what's your long term use case and plan it out. For more details check this: https://www.quora.com/How-does-Firebase-compare-to-Core-Data
You can use Firebase if you do not want to setup your own database. You can then assign 'roles' to the users logging in. Check out Firebase authentication documentation.
If you're doing it locally, Core Data is fine.
But if you're doing it remotely (over the Internet, in the cloud), then Firebase is OK.

Should I add mid-tier (like Java or Node) when working with iOS and Parse (or any other cloud based SDK)? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am pretty new to iOS and I am planning to start one iOS native application with Parse/AWS or any other cloud based DB handling. Is this a good practice or I should include mid-tier like Java and let my app talking to it instead of directly dealing with Cloud? My question is around security and scalability of my application. If I include a mid-tier then I think I can use that as an API with in Android version of my same app as well and which will make things easier for me to handle.Share your thoughts please.
First, great question. I am a long-time user of Amazon web services, where I call for the database without a middle tier. I find that the cloud balances the load well, spins up new resources well, and generally responds well.
As for the security element, you are really sending authenticated requests directly into the cloud, not to a given server. Hence, making a round trip to a specific server (linux + java) is no longer necessary. The cloud can accept datagrams with authentication information loaded.
I am not a parse person, so I may not get this answer voted, but AWS uses a security service called IAM (Identity and Access Management) which forces you to define a pool of permitted resources in your cloud. I imagine that Parse provides comparable services (if not, perhaps consider the AWS cloud), since this is how you are able to call for the database without a middle server tier.

Protecting API calls from iOS app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I started development of iOS applications using HTML5 and Phonegap.
I have a question about security here. Since iOS applications can not run PHP code, people use REST apis to communicate with the server in order to get data from a database and such. Or am I wrong?
Anyways, how can this be secure? For example, someone can just extract the code from the app and will have access to the API calls. How can this be secure? I am not looking for snippets of code, I am wondering what method is used to secure this? As of now, all I have on my head are tokens like the ones used to prevent CSRF attacks and such.
Thanks in advance!
you can use rest services but it doesnt mean you are giving the access to the service. You have to deal with the sessions but do not include clear passwords, etc., unless you connect to the backend by prompting the user, using Oath to authenticate the session and store it in the keychain. You can force the user to re insert the information when the session expires and you can check that everytime the user accesses the application.
If you decompile the app or just unzip the app, the html code can be accessed but the difference is "how you manage the connection". Obviously, as Ive told you, if you use static information (using a .plist file or whatever) your applications will be strongly inefficient and easily to break. My recommendation would be to learn how to work with keychain, NSURLCredential, OAuth and cookies management in iOS.

How to create a poll on IOS? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
hi I’m new to IOS development i have developed only one application in iOS now i want to make a polling app in IOS i Google every where i did’t get a proper solution to make a polling app.
In my polling app i want get input poll form the user and i have to store in database and i have to calculate the value for the polling and i have to show the result how many people voted .
so please can any one suggest what is right way to make polling in IOS or is there any alternative way to make this.
thanks.
Assuming you want to store your results on a back end web server with a DB then you would first need to write some web services. I personally would suggest a combination of PHP and MySQL as they're both open source and relatively easy to get to grips with. I also recommend you use JSON as your data interchange format as it provides a human readable structure without the complexity of XML.
Once you have a functioning back end you would need to build an app with the appropriate data fields that you want in either one or multiple views. Personally I would put all of your questions into an array and then cycle through them changing the input controls if necessary. You can then add your answers to an NSMutableArray.
Once you have your complete answer set in your NSMutableArray you can serialise it to JSON and transmit it off to your web service.
There are many guides for getting started with JSON on iOS available, I would suggest you take a look at this one.
Your question is business specific (not to iOS, iPhone & objective C).
So I would suggest you to better try these APIs available in market.
support.polldaddy.com
Poll EveryWhere
TypeForm
Hope that helps.

How can I create a cloud backend to update my iOS app? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a news application that i am in the process of building, and of course news updates a lot, so I have to constantly update my stories, so I need a backend of some sort that will let me update my stories over the air without updating the actual app.
I found Parse.com and they have some awesome stuff, but with the way my app is built I don't think I can use them.
I will have to update UIImageviews, UItextviews, and the names of Buttons. With Parse I can only seem to find help regarding the PFQueryTableViewController, which I could use this, but that requires completely recoding and some redesigning of my app to fit into that.
So unless there's another way, I guess I will suck it up and get to work.
So is there a simpler way to do this, or maybe a better service that works more towards what I'm describing?
What you are asking basically is how to do network communication. It sounds like to me you can do what you want with just Parse. You just store the images and text and then call the information from the parse backend when you are loading. From there you can update the UITextViews, button names, and UIImageViews however you want dynamically (using the .text, setTitle, and .image properties and methods respectively). You could also use Amazon S3 for image storage... but the API is less well documented for that.
This is probably your best bet, unless you really want to delve in more deeply and learn how to use NSURLConnection or AFNetworking to communicate with a back-end that you build on a django, ruby, etc. server that you host yourself on a server.

Resources