如何安全地将android连接到mysql数据库 [英] How to connect android to mysql database securely

查看:56
本文介绍了如何安全地将android连接到mysql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有梦想主机的phpmyadmin设置程序.比方说,例如,我想从android的数据库中检索用户名和密码,我该怎么做呢?要访问我的数据库,我需要该数据库的用户名和密码,那么如何在没有人能够查看我的应用程序源代码和查看数据库凭据的情况下通过android连接?

我的一个很大的误解是,我应该在哪里存储php webservice文件?不是在设备上,对吧?

解决方案

您可以直接连接到MySQL,但这不是一个好习惯,特别是对于生产应用程序.我的建议是使用将促进连接的Web服务.

Web服务是从企业的Web服务器为Web用户或其他与Web相连的程序(在本例中为Android应用)提供的服务.

这是一个很棒的教程,可帮助您入门 Android,MySQL和PHP

I have a phpmyadmin setup with dream host. Lets say for instance I wanted to retrieve user names and passwords from the database from android, how would I go about doing that? To access my database, I need the username and password for the database, so how can I connect through android without people being able to view the source code of my app and see the database credentials?

EDIT: A big misunderstanding I have is, where do I store the php webservice file? Not on the device, right?

解决方案

You can connect directly to MySQL, but is not a good practice, specially for production apps. My advice is to use a Web service that will facilitate the connection.

Web services are services that are made available from a business's Web server for Web users or other Web-connected programs, in this case, your Android app.

Here is a great tutorial to get you started Android, MySQL and PHP

这篇关于如何安全地将android连接到mysql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆