Answer the question
In order to leave comments, you need to log in
Remote Mysql database and Android application how to proceed?
Hello!
There was a need to write a small application for Android, the essence of which is very simple.
We have a person who bought a ticket, there is a qrcode on the ticket. You need to scan this code with the application (let's say the code contains the id of the record in the database) and get information on this record from the database. Mysql database is located on a remote server. What's the best way to do it? With the creation of applications for android had no business. I want to write in Xamarin because I know C#.
Can you tell me the best way to implement this?
P.S. The database will not be updated often. It is possible that when the application is opened, all rows from the mysql table would fall into the local sqlite database, if this would be easier to implement.
Thank you.
Answer the question
In order to leave comments, you need to log in
No need for bicycles, or REST API, or store the database on the SQLite server and download it (REST API is ideologically correct, although the second option is also suitable for a number of tasks)
1. The remote server must be accessible from the Internet. So the base must be either on the hosting or behind a NAT with a white IP.
2. Write a web server and raise it on the server (the hosting has already raised it for you) on whatever you like (asp.net mvc or php, or python)
2.1. The server interacts with your Mysql base
2.2. It is possible to make http requests to the server from the android application and receive a response of your choice (xml, json, text, a set of bytes)
I like the protocol (json-rpc)
I found a service suitable for the parameters: https://www.codereadr.com/
Allows you to create a database with records inside the service. I have an application for android in which you log in and it compares the qrcode values with the values \u200b\u200bin the database and gives the result. Maybe there are still analogues, otherwise this one is not very popular and confusing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question