与android设备的openERP连接库

时间:2015-03-03 10:25:54

标签: android apache xml-rpc xmlrpclib

我尝试使用openERP或odoo与其示例一起使用的库连接openERP。但是xmlrpc的Apache库,我无法找到它。

以下是openERP提供的文档,但他们使用的是apache库:https://www.odoo.com/documentation/8.0/api_integration.html

图书馆可从以下网址下载:http://www.apache.org/dyn/closer.cgi/ws/xmlrpc/

但链接给了我404错误,有没有人知道一个好的库/文档,以使其与Android设备一起工作?

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    OpenErpConnect oc = OpenErpConnect.connect("2x7.13x.xxx.xxx", 8069, "DBNAME", "admin", "xxxxxxxxxxxxxxxx");
    List<HashMap<String, Object>> list = oc.read("res.partners", new Integer[] {1, 2, 3}, new String[] {"name"});
    String result = "";
    for (HashMap<String, Object> item : list) {
        result += (String)item.get("name")+"\n";
    }
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();
    if (id == R.id.action_settings) {
        return true;
    }
    return super.onOptionsItemSelected(item);
}
}

1 个答案:

答案 0 :(得分:0)

你试过一个XMLRPC吗?看起来非常强大和简单:https://github.com/timroes/aXMLRPC