my android app run on emulator and run on android devices but does not login page work in mobile devices

huangapple go评论72阅读模式
英文:

my android app run on emulator and run on android devices but does not login page work in mobile devices

问题

我的安卓应用在模拟器上运行以及在安卓设备上运行,但无法登录,它显示用户名和密码的本地主机错误。所以请帮我,我应该在数据库中设置什么类型的权限?我使用的是MySQL数据库和WAMP服务器。

英文:

my android app run on emulator and run on android devices but does not login , it give me localhost error with username and password, so please help me what type of permission I should give in database, I used to MYSQL database and WAMP server

答案1

得分: 2

如果数据库是本地的,您应该添加读取权限(READ_EXTERNAL_STORAGE);如果是互联网数据库,您将需要网络权限("android.permission.INTERNET");此外,我建议您确保您连接到正确的网络并正确地 addressing the correct IP,因为通常当您遇到 "localhost 错误" 时,这意味着您在访问自己的 IP 地址。我只是提一下这个,以防这不是您希望从您的应用程序中获得的预期行为。另外,提供代码将会非常有帮助。

英文:

If the database is local, you should add Read permissions
(READ_EXTERNAL_STORAGE)
And if it's internet database, you'll need internet permissions
("android.permission.INTERNET")
Also, I'd suggest you to make sure you are on the correct network \ addressing the correct IP, seeing as you get "localhost error" usually means you are addressing your own IP address. Just mentioning this, in case that is not the desired behavior you want from your app.
Also, providing code will help a lot

答案2

得分: 0

本地主机地址在实际设备上无法运行。您需要使用IPv4地址和端口连接到数据库。

英文:

Localhost will not work on physical devices. You need to ipv4 and port to connect to the database.

huangapple
  • 本文由 发表于 2020年9月24日 17:21:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/64043404.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定