我正在尝试将 openERP 与 openERP 或 odoo 与他们的示例一起使用的库连接起来。但是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);
}
}