From: Wolfgang K. <wol...@xm...> - 2011-03-22 07:54:50
|
Miggi, using Android SDKs UI Builder is fine as long as you stick to the widgets currently supported by XMLVM. The post you are referencing is pretty old and a lot of things have changed. Generally, if there is a runtime error the cross-compiled application simply exits. In the post that was likely due to missing resources or a missing Manifest file. As of now you can create a complete Xcode project with XMLVM which includes everything you need. -- Wolfgang On 22.03.11 08:23, opwoco GbR wrote: > Hi Wolfgang, > > i'm not sure about how to use android-UIs with xmlvm to create an ios > project safely. > > 1) Can I use the standard android xml layout , generated with the > Android-Interface-Builder? > 2) Or must I create the layout just using code ? > > I'm confused because of this thread and that post below: > > >> I have the same issue: "when I run my application, it opens up a > black window and then automatically shuts down" > >> http://sourceforge.net/mailarchive/message.php?msg_id=23705695 > > > 2011/3/22 Wolfgang Korn <wol...@xm... <mailto:wol...@xm...>> > > Miggi, > > the widgets you are using in your little sample are all supported. > From > the stack trace you sent I could see that the problem is actually > caused > by a missing constructor. So I went through the classes and > noticed that > Checkbox(Context, AttributeSet) is currently missing. Although adding > the constructor is simple and will make your layout work, there is one > problem left which requires some more work. Checkbox is a control > which > does not exist on the iPhone. We mapped Checkbox to UISwitch. In > contrast to Android's Checkbox UISwitch does not support setting size > and text. So a more complete implementation would be mapping > Checkbox to > a group of UILabel and UISwitch so that at least setting text would be > supported. > > As a workaround I suggest using separate controls for the the > label and > the Checkbox in your layout. That would work after adding the missing > constructor. There is one more thing which can be helpful. We support > "IOS specific layouts". This basically means you can have a layout > resource (i.e. main.xml) which is used in case your app runs on > Android. > If you have a second resource with the same name prefixed with _ios_ > (i.e. _ios_main.xml) this will be used instead of the original one > when > running on IOS. This mechanism supports using widgets which are not > directly supported on IOS. In your case you can have one resource for > Android using the Checkbox as you did in your sample. However, the IOS > specific resource would use the workaround using separate Label and > Checkbox widgets. > > I will add the missing constructor to Checkbox later today. > > -- Wolfgang > > > > On 20.03.11 23:48, Miggi wrote: > > Hello Arno. > > > > This is the whole layout of my little dummy program: > > > > <ScrollView > > xmlns:android="http://schemas.android.com/apk/res/android" > > android:id="@+id/ScrollView01" > > android:scrollbars="vertical" > > android:layout_width="fill_parent" > > android:layout_height="wrap_content"> > > <LinearLayout > > android:layout_width="fill_parent" > > android:orientation="vertical" > > android:layout_height="fill_parent"> > > <TextView > > android:id="@+id/TextViewTitle" > > android:layout_width="wrap_content" > > android:layout_height="wrap_content" > > android:text="@string/feedbacktitle" > > android:textSize="10sp"> > > </TextView> > > <EditText > > android:id="@+id/EditTextName" > > android:layout_height="wrap_content" > > android:hint="@string/feedbackname" > > android:inputType="textPersonName" > > android:layout_width="fill_parent"> > > </EditText> > > <EditText > > android:id="@+id/EditTextEmail" > > android:layout_height="wrap_content" > > android:hint="@string/feedbackemail" > > android:inputType="textEmailAddress" > > android:layout_width="fill_parent"> > > </EditText> > > <EditText > > android:id="@+id/EditTextFeedbackBody" > > android:layout_height="wrap_content" > > android:hint="@string/feedbackbody" > > android:inputType="textMultiLine" > > android:lines="5" > > android:layout_width="fill_parent"> > > </EditText> > > <CheckBox > > android:id="@+id/CheckBoxResponse" > > android:layout_height="wrap_content" > > android:text="@string/feedbackresponse" > > android:layout_width="fill_parent"> > > </CheckBox> > > <Button > > android:id="@+id/ButtonSendFeedback" > > android:layout_height="wrap_content" > > android:text="@string/feedbackbutton" > > android:onClick="sendFeedback" > > android:layout_width="fill_parent"> > > </Button> > > </LinearLayout> > > </ScrollView> > > > >> Message: 4 > >> Date: Sat, 19 Mar 2011 09:25:27 -0700 > >> From: Arno Puder<ar...@pu... <mailto:ar...@pu...>> > >> Subject: Re: [xmlvm-users] Error in java_lang_reflect_Constructor > >> To: xml...@li... > <mailto:xml...@li...> > >> Message-ID:<4D8...@pu... > <mailto:4D8...@pu...>> > >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >> > >> > >> XMLVM tries to instantiate a UI element that it finds in your .xml > >> resource via Java reflection, but that particular UI element > does not > >> yet exist in XMLVM. You can find the UI elements that are > supported by > >> XMLVM in source folder src/android2iphone in packages > android.widget and > >> android.view. > >> > >> If you tell me which UI element you are trying to use I can > give you an > >> estimate on how difficult it would be to implement it in XMLVM. > >> > >> Arno > >> > >> > >> On 3/19/11 4:04 AM, Miggi wrote: > >>> After the java_lang_RuntimeException and the error in > >>> android_webkit_WebView_2 (which is gone without changing > something) the > >>> project still won't run. > >>> > >>> Now I get a NSException in the class > java_lang_reflect_Constructor in > >>> the method newInstance___java_lang_Object_ARRAYTYPE. > >>> > >>> Here's again the output from Xcode console: > >>> <I> <Resources>: Unable to resolve resources for > >>> de.android.ContactForms: array > >>> <I> <Resources>: Unable to resolve resources for > >>> de.android.ContactForms: dimen > >>> <I> <Resources>: Unable to resolve resources for > >>> de.android.ContactForms: raw > >>> <I> <Resources>: Unable to resolve resources for > >>> de.android.ContactForms: array > >>> <I> <Resources>: Unable to resolve resources for > >>> de.android.ContactForms: dimen > >>> <I> <Resources>: Unable to resolve resources for > >>> de.android.ContactForms: raw > >>> 2011-03-19 11:52:11.887 de.android.ContactForms[7701:207] *** > >>> Terminating app due to uncaught exception > 'NSInvalidArgumentException', > >>> reason: '+[NSInvocation invocationWithMethodSignature:]: method > >>> signature argument cannot be nil' > >>> *** Call stack at first throw: > >>> ( > >>> 0 CoreFoundation 0x030c1b99 > >>> __exceptionPreprocess + 185 > >>> 1 libobjc.A.dylib 0x02eb640e > >>> objc_exception_throw + 47 > >>> 2 CoreFoundation 0x03031a59 > +[NSInvocation > >>> invocationWithMethodSignature:] + 553 > >>> 3 de.android.ContactForms 0x00016e7b > >>> -[java_lang_reflect_Constructor > >>> newInstance___java_lang_Object_ARRAYTYPE:] + 320 > >>> 4 de.android.ContactForms 0x00089ca4 > >>> -[android_internal_LayoutParser > >>> > createView___java_lang_String_android_content_Context_android_util_AttributeSet:::] > >>> + 1027 > >>> 5 de.android.ContactForms 0x00088883 > >>> -[android_internal_LayoutParser > >>> > didStartElement___org_xmlvm_iphone_NSXMLParser_java_lang_String_java_lang_String_java_lang_String_java_util_Map:::::] > >>> + 1000 > >>> 6 de.android.ContactForms 0x0002b6e3 > >>> -[org_xmlvm_iphone_NSXMLParserDelegate > >>> parser:didStartElement:namespaceURI:qualifiedName:attributes:] > + 130 > >>> 7 Foundation 0x005bb999 > _startElementNs > >>> + 1478 > >>> 8 libxml2.2.dylib 0x03d32ac0 > xmlParseXMLDecl > >>> + 8539 > >>> 9 libxml2.2.dylib 0x03d3b3c4 > xmlParseChunk + 1955 > >>> 10 Foundation 0x005babaa > -[NSXMLParser > >>> parse] + 321 > >>> 11 de.android.ContactForms 0x0002b608 > >>> -[NSXMLParser(cat_NSXMLParser) parse__] + 36 > >>> 12 de.android.ContactForms 0x0008787e > >>> +[android_internal_LayoutManager > >>> > getLayout___android_content_Context_int_android_view_ViewGroup:::] > + 533 > >>> 13 de.android.ContactForms 0x000c3dbf > >>> -[android_view_Window setContentView___int:] + 203 > >>> 14 de.android.ContactForms 0x00042113 > >>> -[android_app_Activity setContentView___int:] + 137 > >>> 15 de.android.ContactForms 0x00002459 > >>> -[de_android_ContactForms_ContactForm > onCreate___android_os_Bundle:] + 157 > >>> 16 de.android.ContactForms 0x00040e4e > >>> -[android_app_Activity create___java_lang_Object:] + 600 > >>> 17 Foundation 0x00500978 > >>> -[NSObject(NSThreadPerformAdditions) > >>> performSelector:onThread:withObject:waitUntilDone:modes:] + 229 > >>> 18 Foundation 0x00512f86 > >>> -[NSObject(NSThreadPerformAdditions) > >>> performSelectorOnMainThread:withObject:waitUntilDone:] + 184 > >>> 19 de.android.ContactForms 0x00029e77 > >>> +[NSObject(cat_org_xmlvm_iphone_NSObject) > >>> > performSelectorOnMainThread___java_lang_Object_java_lang_String_java_lang_Object_boolean::::] > >>> + 175 > >>> 20 de.android.ContactForms 0x000408c4 > >>> -[android_app_Activity xmlvmCreate___android_os_Bundle:] + 173 > >>> 21 de.android.ContactForms 0x0004aae7 > >>> -[android_content_Context > >>> startActivityForResult___android_content_Intent_int::] + 1528 > >>> 22 de.android.ContactForms 0x0004aeda > >>> -[android_content_Context > startActivity___android_content_Intent:] + 118 > >>> 23 de.android.ContactForms 0x00046370 > >>> -[android_app_Application onCreate__] + 707 > >>> 24 de.android.ContactForms 0x0007c619 > >>> -[android_internal_AndroidAppLauncher > >>> > applicationDidFinishLaunching___org_xmlvm_iphone_UIApplication:] + 140 > >>> 25 de.android.ContactForms 0x0002ffc9 > >>> -[org_xmlvm_iphone_UIApplicationDelegate > applicationDidFinishLaunching:] > >>> + 43 > >>> 26 UIKit 0x00782f80 > -[UIApplication > >>> _callInitializationDelegatesForURL:payload:suspended:] + 1252 > >>> 27 UIKit 0x007853b0 > -[UIApplication > >>> > _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] > + 346 > >>> 28 UIKit 0x0078f3ec > -[UIApplication > >>> handleEvent:withNewEvent:] + 1958 > >>> 29 UIKit 0x00787b3c > -[UIApplication > >>> sendEvent:] + 71 > >>> 30 UIKit 0x0078c9bf > >>> _UIApplicationHandleEvent + 7672 > >>> 31 GraphicsServices 0x03603822 > >>> PurpleEventCallback + 1550 > >>> 32 CoreFoundation 0x030a2ff4 > >>> __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 > >>> 33 CoreFoundation 0x03003807 > >>> __CFRunLoopDoSource1 + 215 > >>> 34 CoreFoundation 0x03000a93 > __CFRunLoopRun + 979 > >>> 35 CoreFoundation 0x03000350 > >>> CFRunLoopRunSpecific + 208 > >>> 36 CoreFoundation 0x03000271 > >>> CFRunLoopRunInMode + 97 > >>> 37 UIKit 0x00784c6d > -[UIApplication > >>> _run] + 625 > >>> 38 UIKit 0x00790af2 > >>> UIApplicationMain + 1160 > >>> 39 de.android.ContactForms 0x0002fb70 > >>> +[org_xmlvm_iphone_UIApplication > >>> > main___java_lang_String_ARRAYTYPE_java_lang_Class_java_lang_Class:::] > + 565 > >>> 40 de.android.ContactForms 0x0007ca6d > >>> +[android_internal_AndroidAppLauncher > >>> main___java_lang_String_ARRAYTYPE:] + 173 > >>> 41 de.android.ContactForms 0x0007cdf0 main > + 278 > >>> 42 de.android.ContactForms 0x0000226d > start + 53 > >>> 43 ??? 0x00000001 0x0 + 1 > >>> ) > >>> terminate called after throwing an instance of 'NSException' > >>> > >>> Stil an idea what's going wrong? Shall I post the unerlying > >>> android-project with its main.xml and string.xml? > >>> > >>> Thank you > >>> Miggi > >>> > >>> > ------------------------------------------------------------------------------ > >>> Colocation vs. Managed Hosting > >>> A question and answer guide to determining the best fit > >>> for your organization - today and in the future. > >>> http://p.sf.net/sfu/internap-sfd2d > >>> _______________________________________________ > >>> xmlvm-users mailing list > >>> xml...@li... > <mailto:xml...@li...> > >>> https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > > ------------------------------------------------------------------------------ > > Colocation vs. Managed Hosting > > A question and answer guide to determining the best fit > > for your organization - today and in the future. > > http://p.sf.net/sfu/internap-sfd2d > > _______________________________________________ > > xmlvm-users mailing list > > xml...@li... > <mailto:xml...@li...> > > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > > ------------------------------------------------------------------------------ > Enable your software for Intel(R) Active Management Technology to > meet the > growing manageability and security demands of your customers. > Businesses > are taking advantage of Intel(R) vPro (TM) technology - will your > software > be a part of the solution? Download the Intel(R) Manageability Checker > today! http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > xmlvm-users mailing list > xml...@li... > <mailto:xml...@li...> > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > |