在Android SDK Tools和Eclipse ADT 插件的第17版本 (revision 17)中,我們對Android項目的依賴關系管理做了很多改變。
我們所做的第一個改變是調整基于 Ant 的編譯系統和 Eclipse ADT 插件,使他們具有相同的行為。
Android 項目包含源代碼檔案夾,以及對庫項目 (android library projects) 和 jar 檔案的依賴。 不需要其他多餘的設定,隻需要在project.properties中添加對于庫項目的依賴,Android項目就會在動在 classpath 中添加以下依賴項:
-
libs
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView)findViewById(R.id.myprojtext);
tv.setText(R.string.mylibhello);
Intent it = new Intent(this, MyLib.class);
startActivity(it);
}
}
轉載于:https://www.cnblogs.com/jiezzy/archive/2012/08/16/2641894.html