I have a website setup, where users can register, and that data is stored into a database. My website is built using SlimPHP along with some other dependencies, such as twig. Is there a dependancy that I can use to help connect my iOS app to my database so users can log in? Or, how could I go about linking my app to the database. Thanks
You need to Develop a RestApi on your webserver and that Api will connect your app with Database you have. Then your app will need to interact with that RestApi. Here is a nice tutorial to connect swift IOS app with RestApi which return JSON response.
Related
I'm currently building a new project that needs a web app and mobile app and i'm forced to work with Laravel and React Native.
So my question is if I can connect between the two app's using MySQL ?
PS: I already searched and i did find this topic here, but i didn't get the idea clear.
Laravel can be just a backend and React-Native is a front-end. Your React-Native can talk to a Laravel backend without any problem or can share a database such as MySQL, it is no different then using a Node, ASP.NET, Ruby or even a Perl backend for your React-Native app to serve a REST API and connect to a database.
Not knowing the details of your website, I would look to build a REST API that can be used by React, React-Native (iOS android, or both) and the laravel based website. Certain features like authentication should easily work cross platform, other API calls may need to be tailored to Mobile vs Web. The backend can be Laravel or any other system include Node as long as it is a REST API, both the site and app will be able to use it.
I am new to android development and i am willing to make an Android app for Managing Notes and Task as well as i want to make a Web app for the same using PHP.(For learning purpose like Google Keep).I want both of this web app and android app to work in sync with each other, Just like Google's Google Keep works on Android and Web as well. what would be the easiest way to do this?
Is it necessary to create a REST api for my web app so that my android app can query the web app ?
Also i saw somewhere on internet that i should save all my data in Mysql Database on server and my Android app should retrieve all the data from the server but i if will do this then my app will not be work in offline mode.
Please help, Thankyou .
Yes,You should have a main Database on server and your Android app should retrieve all the data from the server,then Save them in your local database in android that can be same as or lesser than your main database.
Now you can work offline ,and when data has changed in your app ,you should keep them somewhere and sync them with your server database as soon as you got online.
and also you can use push Notification to notify your app that some data has been changed and no longer valid and application should update itself.
It's my idea Hope help you
I'm involved into an app that have to retrieve queries from an existing database. This db have to be implemented in php in a remote server, and will be the place where the admin will have to insert content into the shared db, but I don't know how to implement that correctly or what is the best solution.
I'm thinking about make a sqlite database with php and connect directly the app to the db, but I haven't found yet the best way to do that.
What do you think? Thank guys.
FYI, without any server communication (Web services) you can't use the website database in android application.
If you want to manage the communication between the website and the android app means you need a centralized server (probably my sql dab) which having the data of your web/mobile applications. So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them
I'm thinking about make a sqlite database with php and connect
directly the app to the db, but I haven't found yet the best way to do
that.
This is not the right approach to connect mobile applications with the database. Instead you should create a middleware(REST/SOAP webservice) which runs on server. This middleware will in turn connect with the database and your mobile app whether it is android, iOS or windows app can communicate with this middleware.
we have already developed a web app using codeigniter and now planning a mobile client(for android phones).The scenario is like this
1)mobile client will have a local db same as server db
2)After installing the app an authentication process is there
3)After authentication we need to download the data from server db to mobile client DB.
I have created one web service using REST api for authentication process and its working but for step 3 i need help.
Can i use REST api for that also or is there exist any other secure mechanism to sync server and mobile client DB ?
Can anyone suggest please!
Best regards,
First, you need create a very strong structure compatible with Oauth2, I recommended this library: Codeigniter RESTserver
After, you must know how works the Oauth2 protocol and implements it.
Read this tutorial, is old but good for your work: http://code.tutsplus.com/tutorials/working-with-restful-services-in-codeigniter--net-8814
right I am planning to make an application that connects to an online database to a certain website i have developed using php. the site uses MYSQL. anyways how would i allow the application on my iphone update and receive records from one of the tables with the ability to delete records aswell.
I am fairly new to programming on my iphone thanks.
You should write a webService which will connect to the database, and your iPhone app should be making calls to the webService ideally.
Duplicate of this question -
How would you connect to a Microsoft Access database sitting on a remote server through Objective-C?
There are a couple of options you can go with.
First, you can build a REST API around your database that your application can call using the built in NSConnection or ASIHTTPRequest classes. Check out this SO post: How to write a REST API?
Second, you can build a web service in front of your database that your iPhone application can connect to.