Website to IOS App [closed] - php

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
I have a website that I've created using PHP, Mysql, and other (HTML, CSS, etc) and I'm looking into converting the website into a native Iphone App for the app store. I know quite a bit of Objective-C and have used X-code for a couple years but I'm confused about one aspect of it. I've never worked with databases from an app. The database that we have set up is just a good old fashion PHP and Mysql that we connect to. It holds all of the site's users and other information.
Therefore, what should I do about accessing this database on the phone? Is there a way to use Mysql or is there something else that I can use that would interact with the database separately? I know there is SQLite but does that work with Mysql or not?
Any tutorials or guides you could point me to also would be great. Thanks.

The simple answer is: don't connect an iOS app directly to the database. Think about it: you'd be embedding a username and password somewhere in the app's code, which some nefarious user will find a way to extract and exploit.
Much better way to do it: create a simple API on your website, then pass requests from mobile users through the API. Then your server handles all database connections, authentication of users, and so on, and you haven't put your database credentials in the hands of lots of unknown individuals.

Related

NSUserDefaults vs Core Data [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 5 years ago.
Improve this question
I am creating an app like Snapchat using Swift and PHP as my backend. I am using MSQL is my database. I am currently saving my user information in NSUserDefaults (it is only a couple variables like username, email, id etc). I heard if I am creating a full scale app for more than 100k users I am supposed to use Core Data so I am not sure if I should switch over. As i said it is only a small number of variables is stored, rest is in my database. Will i be noticing any speed differences?
It can't logically follow that the number of users downloading your app has any impact on the viability of using CoreData vs. UserDefaults to save someone's username and email. However, it's plausible that there are advantages one way or the other (independent of scalability). Personally, I use UserDefaults to save that information, but can't imagine it makes much a difference.
However, the fact that you're keeping all other data (user profiles, photos, messages) exclusively in a remote database is quite worrisome. Without any kind of caching, your Snapchat app should probably be marketed toward the older generation, keen to reminisce in the days of Dial-Up with an app crafted to pull any data (other than username/email) repeatedly from a remote database. For this purpose, you ought to use CoreData or a similar alternative (SQLite, etc.). It's absolutely crucial that you have some sort of local database if you want to scale. And please, dear God, do not attempt to save this type of data to UserDefaults.
Unless, of course, you find my facetious proposition appealing.

Swift/MySQL/PHP: how to write an ios app using an online database [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 7 years ago.
Improve this question
I have just fineshed an apprenticeship in a little company for which I have developed management web application hosted in ARUBA together with mysql DB. Now for my "Mobile application" course I would like to realize an iOS app as a mobile version for that web application: pratically I could create a new frontend as an iOS app. I am supposed to use Swift and I am totally new to iOS development. So I would like to ask if you can give me some tutorials about how to use swift and php to connect to a database and perform CRUD operations. Before suggesting this idea to my teacher I would like to make some practice and see if I am able to create this kind of app.
What do you say?
This course looks promising, though I haven't done it myself, so I'm not sure.
Think of this project in three parts:
Creating your MySQL database
Developing your PHP API to "talk to" the database - this is the mediator between the client and the database
Developing the client code
It sounds like you've done some web development, so can I assume that you know how to do number 1 and 2 above? You can create the PHP almost exactly like you would for a website, and it has a great function (json_encode) to put everything you're sending to the client in JSON. There is a class called NSJSONSerialization to deal with the JSON received on the client end.
Do know that this is a big project; developing all the PHP and Swift code in addition to the database is no small feat.
To accomplish number 3, I would recommend reading up on NSURLSession. This tutorial and this tutorial may be useful.

virtual pages using PHP only? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am working on a project that I need to let users to create pages on my server. however, I do not want to let users clutter my mysql database by storing the stuff in there so I cannot use mysql database for creating the pages.
I did research this topic and there seem to be a some sort of a plugin for WP that will allow virtual page creation.
is this possible using pure php WITHOUT the use of any database ?
It's possible, but wrong.
You can use php to write a html file to your web directory, sure. But that
solution is in no way cleaner or less cluttered than putting stuff in your
database, for a few reasons:
It's easier to have structured information in the database
It's a good thing conceptually to separate user data from your program
It's easier to control access to your database in a safe way, compared
to writing user data to the file system
"I really do not want to use mysql database" is not a good reason to give this
up. You might have a good reason, but it's not easy to guess what that is, which
makes suggesting alternatives very difficult.

retrieving datatbase information on a web page [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
This will be a total novices question, but I am looking for advice.
My apologies, In the post as I failed to mention that the database that I am working on is MySQL.
I know absolutely nothing in regards to any technologies that retrieve or get information from a database. The only 3 facts that I know is that it can be done by either PHP or HTML5, I should be able to pick it up and that I will make many mistakes
Could the community suggest which would be the better technology to learn and would any be able to suggest a starting point?
Yours in advance
Keith
In order to retrieve database information, you generally only need a database such as MySQL - and a client to perform your queries (fetching data from the database).
Your client could be anything, a commandline tool or a PHP script opening a connection to your database and performing the desired queries.
Fetching data alone will not get you very far unless you can display that information somewhere, or even provide access to it or (if desired) allow users to interact with it.
Basically, if you want to retrieve database information and show it on a website, your minimum requirements would be HTML, a database server, a database (preferably with some data to run some tests with) and some kind of scripting language (such as PHP).
There are numerous tutorials out there on how to make your first steps with this.
Here is one.
Start with PHP + MySQL. There are a lot of manuals and examples over the Internet. Google it.

how to transffer data from website to android app and enable or disable it from website only? [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
My team is going to make application in android having quizzes on mobile whose questions,options would be entered from my website. I want to be able to enable the new quiz from website end.
Going to code website in PHP. I'm good at wordpress so just wondering if I can do this in that only or not as I don't in what form I have to convert my data so that android can get it and use it in "native app"(not browser!!).
my job is only the website part I know how to make pages but don't know in what form I have to give quiz data and how to control enabling and disabling the quiz in mobile app
thanks for the help in advance...
There are several ways you can transfer data through different applications/technology.
Some ways that appear to be straight ahead to me:
The Android App can parse your generated HTML file directly and extract the questions and the options parsing the HTML tags.
The Android App can also connect to your website DB and get the information directly from that.
You can also expose your data creating a services using WebServices or ODATA, for example.
I have to say I've only ever dealt with Cordova for writing apps but if Cordova can do it...
In the app I wrote for an internal application I used an AJAX call (Cordova uses JS + HTML as its interface). My PHP server then returned a response my app could use (in my case, JSON) It sounds like this is what you want to know. Now your app team will have to tell you what format to send your response but it's possible to have apps do this.
This would have to be done in PHP(EDIT: or any other technology as such) since your team is working in PHP already. To enable/disable the "new quiz", the app would have to query the server for this information, which would come from the Database.

Categories