开发者

Android App - Drupal Services

I am trying to upload data from my And开发者_运维知识库roid app to my Drupal website. I know how to develop PHP code that will parse GET/POST data and save it to a database.

But, when it come to Drupal and CCK fields it is abit more challenging. From my research, the Services module is built for this sort of thing.

Can anyone enlighten me in how to setup a node.save service and how the data should be represented in the URL so that my Android data will be created as or update existing nodes?


To communicate with Drupal's services module you're going to need to pick a way to talk to Drupal. The Services module provides a lot of ways called "interfaces." This is basically the format of the data you send Drupal.

A few examples of Services interfaces:

  • http://drupal.org/project/json_server
  • http://drupal.org/project/jsonrpc_server
  • http://drupal.org/project/soap_server

Once you've chosen the "format" you want to send your data in, you need to translate it to that format. So let's say you choose "SOAP." Here's a good stackoverflow about sending a webservice call from Android: How to call a SOAP web service on Android

Another thing to note is that your user must be logged in (unless anonymous users can create content!) so you must first tackle the login service!

In review:

  1. Setup service module
  2. Choose a format such as SOAP or JSON
  3. Make a call to login the user (unless anon)
  4. Make a call to the node save service.

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜