Android: how to start work defined in a library project
I am developing an android app that uses androidVNC Viewer as a library project, but I cannot start an activity from androidVNC (exception not found in work).
Also, how do I link my library project and use it as a single apk?
UPDATE
I am using the following intent to call:
Intent call= new Intent("android.androidVNC.androidVNC.LAUNCH");
startActivity(call);
UPDATE 2 After using the following code, I think I can get started, but getting this (java.lang.NoSuchFieldError: android.androidVNC.R $ id.textIP) error ...
Intent vnc_call = new Intent(getApplicationContext(), androidVNC.class);
vnc_call.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(login);
after i checked both R.java, androidVNC original and androidVNC when used as a library (in generated java files) ... what i got is this textip is there in orignal R.java but that doesn't exist in R .java (generated java files) in the calling project .
O / P logcat (first few lines)
04-05 01: 34: 18.135: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / AbstractConnectionBean; (256) 04-05 01: 34: 18.135: W / dalvikvm (479): Link of class 'Landroid / androidVNC / AbstractConnectionBean;' failed 04-05 01: 34: 18.135: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / ConnectionBean; (8) 04-05 01: 34: 18.135: W / dalvikvm (479): Link of class 'Landroid / androidVNC / ConnectionBean;' failed 04-05 01: 34: 18.145: W / dalvikvm (479): VFY: unable to find class referenced in signature (Landroid / androidVNC / ConnectionBean;) 04-05 01: 34: 18.155: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / AbstractConnectionBean; (256) 04-05 01: 34: 18.155: W / dalvikvm (479): Link of class 'Landroid / androidVNC / AbstractConnectionBean;' failed 04-05 01: 34: 18.155: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / ConnectionBean; (8) 04-05 01: 34: 18.155: W / dalvikvm (479): Link of class 'Landroid / androidVNC / ConnectionBean;' failed 04-05 01: 34: 18.187: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / AbstractConnectionBean; (256) 04-05 01: 34: 18.187: W / dalvikvm (479): Link of class 'Landroid / androidVNC / AbstractConnectionBean;' failed 04-05 01: 34: 18.187: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / ConnectionBean; (8) ` 04-05 01: 34: 18.135: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / AbstractConnectionBean; (256) 04-05 01: 34: 18.135: W / dalvikvm (479): Link of class 'Landroid / androidVNC / AbstractConnectionBean;' failed 04-05 01: 34: 18.135: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / ConnectionBean; (8) 04-05 01: 34: 18.135: W / dalvikvm (479): Link of class 'Landroid / androidVNC / ConnectionBean;' failed 04-05 01: 34: 18.145: W / dalvikvm (479): VFY: unable to find class referenced in signature (Landroid / androidVNC / ConnectionBean;) 04-05 01: 34: 18.155: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / AbstractConnectionBean; (256) 04-05 01: 34: 18.155: W / dalvikvm (479): Link of class 'Landroid / androidVNC / AbstractConnectionBean;' failed 04-05 01: 34: 18.155: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / ConnectionBean; (8) 04-05 01: 34: 18.155: W / dalvikvm (479): Link of class 'Landroid / androidVNC / ConnectionBean;' failed 04-05 01: 34: 18.187: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / AbstractConnectionBean; (256) 04-05 01: 34: 18.187: W / dalvikvm (479): Link of class 'Landroid / androidVNC / AbstractConnectionBean;' failed 04-05 01: 34: 18.187: W / dalvikvm (479): Unable to resolve superclass of Landroid / androidVNC / ConnectionBean; (8)
any hint?
source to share
Although library projects have their own AndroidManifest.xml, its content is not added to your assembly. Anything that a library that is usually declared in the manifest contains must be copied into your actual application manifest if you plan on using them. This includes actions, broadcasts, services, permissions, etc.
source to share
assuming lib and app have different namespaces:
when merging lib-manifest-info with manifest app as above, did you include different namespaces in activities?
<application ... >
<activity
android:name=".MyActivity" >...
to
<application ... >
<activity
android:name="my.namespace.MyActivity" >...
using latest eclipse-android 1.7 tools might help as well. See how-to-consume-reusable-gui-element-widget-with-resources-in-android for details
source to share