如何从Android的一个PostgreSQL服务器检查用户名和密码? [英] How to check username and password in a PostgreSQL server from Android?

查看:147
本文介绍了如何从Android的一个PostgreSQL服务器检查用户名和密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Android 2.2的API。我想知道如何连接到PostgreSQL数据库服务器。

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

我是新来这一点,所以没有任何的想法,所以请帮助我做一些样品code。

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

推荐答案

您通常不直接连接到数据库。
为了达到你想要的结果,你可以做一个RESTful请求。

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

这意味着,无论是发送一个JSON字符串或XML文件到服务器(你可以在PHP,Ruby程序,什么不可以)

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

我不打算给你的样品code原因有字面上吨code的一个简单的谷歌搜索机器人宁静登陆
实例教程

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

这个过程通常是:

输入登录Android设备上的凭据 - >发送POST请求到服务器 - >验证凭据数据库(在这种情况下,Postgres的) - >发送确认回导致如果登录成功)

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)

这篇关于如何从Android的一个PostgreSQL服务器检查用户名和密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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