Opening a browser from Kuix

10 messages - 137 views

hi,

I have three questions

how can i open a browser from kuix application. I know that from a midlet you can use platformRequest() method to open browser. Can we do the same in kuix and will it work?

how can we do text wrapping in text field?

I am getting out of memory error when i close and open the application. This is not coming from the simulator memory, it is thrown from kalmeo's parser. I read from the forum that you need to call cleanup when you are using @{..} properties to remove the link between dataprovider and the widget. Am I right ? if yes what should I do to overcome this error ? If i am wrong what else should i do?

> how can i open a browser from kuix application. I know that from a midlet you can use platformRequest() method to open browser. Can we do the same in kuix and will it work?

Yes

> how can we do text wrapping in text field?

It is not implemented for the moment, but planned for the next release.

> ... when you are using @{..} properties to remove the link between dataprovider and the widget. Am I right ? if yes what should I do to overcome this error ? If i am wrong what else should i do?

Yes, if you use @{...} properties, you need to invoke the cleanUp() method on widgets when you no longer use them. The best way would be to invoke this cleanUp method on a screen when you remove it (only if some of its widgets has @{...} properties).

> how can we do text wrapping in text field?

It is not implemented for the moment, but planned for the next release.

> I am using a Text widget not a TextField(sorry for that) and i am updating the text content dynamically. The text is too long that some of the content are sliced. Is there a way to wrap it to the next line.

And to the last question, I tried cleaning the screen before I exit the application but, i am still getting the same error. here is the error trace,

java.lang.OutOfMemoryError
        at org.kalmeo.util.xml.LightXmlParser.parse(+1289)
        at org.kalmeo.kuix.core.Kuix.parseXml(+20)
        at org.kalmeo.kuix.core.Kuix.loadXml(+17)
        at org.kalmeo.kuix.core.Kuix.loadScreen(+15)
        at org.kalmeo.kuix.core.Kuix.loadScreen(+8)
        at com.vhc.mc.frame.MCFrame.firstWSCall(+78)
        at com.vhc.mc.frame.MCFrame.startMIDlet(+224)
        at com.vhc.mc.frame.MCFrame.onAdded(+4)
        at org.kalmeo.util.frame.FrameHandler.pushFrame(+54)
        at com.vhc.mc.midlet.MobileConnect.b(+16)
        at org.kalmeo.kuix.core.KuixCanvas.a(+147)
        at org.kalmeo.kuix.core.KuixMIDlet.startApp(+95)
        at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:44)
        at com.sun.midp.midlet.Scheduler.schedule(+270)
        at com.sun.midp.main.Main.runLocalClass(+28)
        at com.sun.midp.main.Main.main(+80)

> The text is too long that some of the content are sliced. Is there a way to wrap it to the next line.

Yes, use a TextArena

> OutOfMemory

It seems that the error occure on application startup (... MIDletProxy.startApp(MIDletProxy.java:44) ..), is it true ? When you say that you close the application does that meen that the application is totaly closed ?

 

 

>out of memory

Yes, the error occurs at application startup and I am using KuixMidlet.getDefault().destroyImpl() method to close the application

Somme question to understand :

  • Does this exception occure on first start ?
  • Does this exception occure only on the simulator ?
  • Does this exception occure always after you close and restart the application ?
  • When you close the application, do you close the simulator ?
  • What IDE / WTK combination do you use ?

The strange thing is that in theory if you close the application, the me mory is free.

  • Does this exception occure on first start ?

              It doesn't occur on first startup.

  • Does this exception occure only on the simulator ?

              yes. It occurs only in simulator

  • Does this exception occure always after you close and restart the application ?

               Yes.

  • When you close the application, do you close the simulator ?

           No

  • What IDE / WTK combination do you use ?

            Netbeans 6.1 and Sun WTK 2.5.2

It seems to be more an emulator problem, because it doesn't clear loaded classes when the application is closed. And in this case all static classes became a real problem ... because they wouldn't be reinitialized.

This wouldn't appear on real phone.

you should check how mutch memory you allow to allocate for your JVM and NetBeans.

NB have tendensy to eat a lot of memory.

Even the latest 6.5 beta. If I start my day and NB uses ~50 MB at the end of work day it will increase to 250-300MB, nad this is beside the java neede to run NB (~150MB), but since I have a lot of it in my mashine it never is a problem, but I have gotten even blue screen on my home pc when I had only 1 GB.

I would advice you to grab more memory and plug it in you PC

My machine has 3GB RAM and 250 GB secondary memory. I hope i have sufficient amount of memory in my bank. i dont run any other program other than netbeans.