From: Wolfgang K. <wol...@xm...> - 2009-10-08 12:17:30
|
I just set up a test project and tried your code. As Arno pointed out you need AndroidManifest.xml and cat.png in directory where the makefile is stored. Additionally note that we currently only support png images resources. While trying you sample code I also noticed a small bug in XMLVM for which I submitted a patch to our SVN. So please update to the HEAD and try again. -- Wolfgang On Thu, Oct 8, 2009 at 10:19 AM, Arno Puder <ar...@pu...> wrote: > > did you import cat.png and AndroidManifest.xml to the XCode project (or > copy those to files to the directory where Makefile is generated in case > you are using the Makefile)? > > Arno > > > Joseph Rukshan Fonseka wrote: > > Hi, > > > > I was trying to play with xmlvm and see it working porting an android > > app to iphone. > > > > I wrote this simple android app which runs ok in the android emulator. > > > > package com.home.imageviewer; > > > > import android.app.Activity; > > import android.os.Bundle; > > import android.view.View; > > import android.view.ViewGroup.LayoutParams; > > import android.widget.AbsoluteLayout; > > import android.widget.ImageView; > > import android.widget.LinearLayout; > > > > public class ImageViewer extends Activity { > > /** Called when the activity is first created. */ > > @SuppressWarnings("deprecation") > > @Override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > > > > > > > AbsoluteLayout layout = new AbsoluteLayout(this); > > layout.setLayoutParams(new > > LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); > > ImageView viewer = new ImageView(this); > > viewer.setImageResource(R.drawable.cat); > > layout.addView(viewer, new > > AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT, > > AbsoluteLayout.LayoutParams.WRAP_CONTENT, 0, 60)); > > setContentView(layout); > > } > > } > > > > I think cross compiled it using xmlvm with android-on-iphone option > > following the instructions in manual.pdf. Also I think there should be > > some instructions for the newbies on how to add iphone frameworks to the > > project and also which ones are needed. As I had to spend some time to > > figure this out myself as it wasn't in the manual.pdf when following the > > steps. > > > > It successfully create iphone files. Well no errors were reported. > > > > I then ran make in this directory which compiled the iphone files and > > launched the iphone simulator. > > > > However when I run my application, it opens up a black window and then > > automatically shuts down. > > > > I ran it via xcode and this is what I get in the IDE > > > > *2009-10-08 09:43:21.988 test[6829:207] *** Terminating app due to > > uncaught exception 'NSInvalidArgumentException', reason: '*** > > -[NSPlaceholderMutableString initWithString:]: nil argument'* > > *2009-10-08 09:43:21.990 test[6829:207] Stack: (* > > * 36152411,* > > * 2438119241,* > > * 36236347,* > > * 36236186,* > > * 588736,* > > * 145543,* > > * 42424,* > > * 41261,* > > * 41810,* > > * 9058* > > *)* > > *(gdb) * > > * > > * > > * > > * > > * > > * > > *Any ideas? I was careful to write an app using only the features I was > > confident were supported by the android compat library. * > > * > > * > > *Regards,* > > *Rukshan Fonseka.* > > > > > > > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------------ > > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > > is the only developer event you need to attend this year. Jumpstart your > > developing skills, take BlackBerry mobile applications to market and stay > > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > > http://p.sf.net/sfu/devconference > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > xmlvm-users mailing list > > xml...@li... > > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > |