How to connect online DB Xamarin? [closed]

2020-03-08 07:22发布

please tell me how to retrieve a data from online database(table)?. I just created a table in enter link description here

And I made a SQL database. And can anyone tell me how to retrieve a data from that?

1条回答
Ridiculous、
2楼-- · 2020-03-08 08:10

It is strongly advised for you to not directly connect to a database straight from Xamarin for (at the very least) 2 distinctive reasons: 1. Your credentials for the database will be in your app code, meaning anyone can just decompile your app and read your login info - huge security risk. 2. By connecting to a online database straight from Xamarin you'll most probably overload the database server (they allow only a small number of connections).

Usually when you need data from a database you work with an API that you build yourself. For example A php site, or an ASP.NET web api.

Xamarin communicates with your web site (e.g. www.yoursite.com/api/getinformation). This way your credentials are safe in the website, and your app connects only to your site, which is better because you can cache information there, preventing an overload on your site.

Reading material that will help you:

Xamarin forum link to php+mysql+Xamarin

Consuming REST-API's with

查看更多
登录 后发表回答