从Android直接访问MySQL[英] Accessing MySQL Directly from Android

本文是小编为大家收集整理的关于从Android直接访问MySQL的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我目前正在开发一个Android应用程序.我希望能够从我的网站目录访问MySQL,而无需使用JSON,SOAP或PHP以访问MySQL.是否可以将MySQL连接器导入Android应用程序.

感谢您的帮助

推荐答案

您可以使用 protobufs 而不是google或使用mysql的连接器这里的例子但是使用连接器不会安全,因为@shaun在他的答案中说.所以它是可能的.

其他推荐答案

哇,我喜欢某人真的说它不可能.这是Java我们正在使用的不是吗?答案并不容易.您可以始终以完整的Java为此编写的Java库,并将其重写为使用Android.问题?它不容易,这就是为什么还没有一个知名的图书馆.有很多连接问题,以及从手机执行此操作时要考虑的安全问题.一,您没有专用的连接流(意思,您的连接可能会在任何时刻丢弃),您的数据可能已损坏,或者您可以询问Coudl最后遗漏了最终的限制,您可以在您的数据库中提醒您的数据库.其次,您必须担心数据库的安全性.手机绝不是最安全的设备,更不用说android.

其他推荐答案

否这是不可能的.您需要一个Web服务前端.

本文地址:https://www.itbaoku.cn/post/102451.html

问题描述

I am currently developing an Android application. I want to be able to access MySQL from my website directory without needing to use JSON, SOAP or PHP in order to access MySQL. Is it possible to to import a MySQL connector into an android app.

Thanks for the help

推荐答案

You can use protoBufs instead by Google or use mySQL's connector example here but using the connector wouldn't be safe as @Shaun said in his answer. So it is possible.

其他推荐答案

Wow, I like how someone actually said its not possible. This is java we are working with isnt it? Its not easy is the answer. You can always take a java library already written for this in full out java, and rewrite it to work with android. The problem? Its not easy, thats why there is not a very well known library for it yet. Theres alot of connection issues, and security issues to think about when doing this from a phone. One, you dont have a dedicated stream of connection (meaning, your connectivity could drop at any moment) and your data could be corrupt, or, you query coudl have left out the LIMIT at the end you could whipe your database. Secondly, you have to worry about the security of your database. Phones are in no way the most secure devices out there, let alone android.

其他推荐答案

No this isn't possible. You'll require a web service front end.