解决方案 »

  1.   

    原来曾经做过把Message消息中心,Network网络交互以及一些常用的工具类封装成jar供程序调用,一定程度上是可以减少工作量的。但是你会发现……这个jar会越变越大……
      

  2.   

    有道理。网络部分使用起来感觉不是很麻烦,毕竟Android提供的库易用性还是不错的。关键是与UI关联部分,比较繁琐和麻烦。可以考虑从这个角度出发,提供一些自动关联的函数库来,效果会更好些。
      

  3.   

    根据大家的意见,我觉得,没有必要去使用xml文件来描述了。直接提供一个库就可以了。比如,我可以在Activity onCreate的时候做这些事情:HttpRequest req = new HttpRequest("http://localhost/hellowrold.xml");
    req.bind("//message", findViewById(R.id.text), "android:text");
    可以静态的绑定一个图片HttpRequest.bind("http://localhost/icon.png", findViewById(R.id.image), "android:src");
    如果发送一个postHttpRequest post_req = new HttpRequest("http://localhost/post.php", HttpRquest.METHOD_POST);
    post_req.setEntry("username", findViewById(R.id.edit_username), "android:text");
    post_req.setEntry("password", findViewById(R.id.edit_password), "android:text");
    post_req.setSubmit(findViewById(R.id.btn_submit));