Android到Drupal用户创建

Android到Drupal用户创建,android,drupal,profile,Android,Drupal,Profile,如果这被证明是我的问题的错误论坛,我提前道歉,但我的问题是基于代码的,似乎是合适的: 对于可能需要帮助从android应用程序创建Drupal用户的任何人,以下代码适用: //create a new HttpClient and post header HttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost("http://test.sit

如果这被证明是我的问题的错误论坛,我提前道歉,但我的问题是基于代码的,似乎是合适的:

对于可能需要帮助从android应用程序创建Drupal用户的任何人,以下代码适用:

    //create a new HttpClient and post header
    HttpClient httpClient   =   new DefaultHttpClient();
    HttpPost httpPost       =   new HttpPost("http://test.site.com/testpoint/user/register");

// TODO Auto-generated method stub
try{
    List<NameValuePair> nameValuePairs  =   new ArrayList<NameValuePair>();
    nameValuePairs.add( new BasicNameValuePair("account[pass]", "cutelady"));
    nameValuePairs.add( new BasicNameValuePair("account[mail]", "scarter@sgc.gov"));
    nameValuePairs.add( new BasicNameValuePair("account[name]", "Samantha Carter"));
    httpPost.setEntity( new UrlEncodedFormEntity(nameValuePairs));

    //Execute HTTP post request
    HttpResponse response   =   httpClient.execute(httpPost);

}catch(Exception e){
    Log.e("HTTP ERROR", e.toString());
}
//创建新的HttpClient和post头
HttpClient HttpClient=新的DefaultHttpClient();
HttpPost HttpPost=新的HttpPost(“http://test.site.com/testpoint/user/register");
//TODO自动生成的方法存根
试一试{
List nameValuePairs=新的ArrayList();
添加(新的BasicNameValuePair(“帐户[通行证],“cutelady”);
添加(新的BasicNameValuePair(“帐户[邮件],”scarter@sgc.gov"));
添加(新的BasicNameValuePair(“帐户[名称],“Samantha Carter”);
setEntity(新的UrlEncodedFormEntity(nameValuePairs));
//执行HTTP post请求
HttpResponse response=httpClient.execute(httpPost);
}捕获(例外e){
e(“HTTP错误”,e.toString());
}
但是,我还有一个问题:当使用profile模块为用户注册过程提供额外的自定义CCK字段时,我找不到正确的帐户[CCK_参数]来连接我的android数据并将其保存到profile CCK字段。(我希望有人明白我的意思:-)


有人对此问题有任何专业知识吗?

用户是用户对象,额外的配置文件值是节点对象。因此,user_save函数被设计为只接受很少的参数。 关键是,您可以创建覆盖用户/注册表单的“必填字段”状态的用户配置文件。 保存用户对象后,保留当前表单,并尝试创建新节点

请参阅内容配置文件API以了解如何保存(它是一个节点_save())内容配置文件