How to check username and password in a PostgreSQL server from Android?

懵懂的女人 提交于 2019-12-23 05:33:16

问题


I am using the Android 2.2 API. I want to know how to connect to a PostgreSQL database server.

I am new to this and so have no ideas, so please help me with some sample code.


回答1:


You usually don't connect directly to a database. To achieve the results you want, you can do a RESTful request.

This means, send either a JSON string or xml file to a server(which you can program in php, ruby and what not)

I'm not going to give you sample code cause there are literally tons of code on a simple google search "android restful login" Example tutorial

The process is usually:

Enter login credentials on android device -> send post request to server -> validate credentials to the database(postgres in this case) -> send verification back -> android device act upon verification(usually by loading a new activity as a result if logged in successfully)



来源:https://stackoverflow.com/questions/10408784/how-to-check-username-and-password-in-a-postgresql-server-from-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!