[英]How to send an object of custom class from Android to Java Server?
I have created several classes in android client application corresponding to each database table (just like concept of Entity-Objects). 我在android客户端应用程序中创建了几个对应于每个数据库表的类(就像实体对象的概念一样)。
i want to retrieve data from database of the server to android client application and then assign that returned data set to objects of those created classes to further process the data and apply some logic. 我想从服务器的数据库检索数据到Android客户端应用程序,然后将返回的数据集分配给那些创建的类的对象,以进一步处理数据并应用一些逻辑。
I also want send data from android to server in the form of objects to process them on server or insert/update in the database. 我还希望以对象的形式从android发送数据到服务器,以便在服务器上处理它们或在数据库中插入/更新。
(I can send the data to Servlet using HttpClient and HttpPost but don't know how to send objects and how to receive result set of database in the form of objects). (我可以使用HttpClient和HttpPost将数据发送到Servlet,但不知道如何发送对象以及如何以对象的形式接收数据库的结果集)。
I'm new to client-server programming so my this approach might be wrong, if so then please correct me. 我是客户端服务器编程的新手,所以我的这种方法可能是错的,如果有的话请纠正我。 any sample code will be appreciated.
任何示例代码将不胜感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.