- This topic has 2 replies, 2 voices, and was last updated 12 years, 6 months ago by Kasalop.
-
AuthorPosts
-
KasalopMemberHi guys,
i’m using mobione 2.1 preview and tried to use the eventsource interface from html5 in my application for android and as a web application. But in both applications it didn’t work.
The emulator doesn’t know EventSource, so all the tests have to be at the device (Samsung S2) directly. At the device i can’t debug helpfully.
First I try to initialize the ES component in the phoneui.documentReadyHandler but I got a black screen, without seeing my formular or websurface. The next step was to load it in a seperat function and call it with a delay of two seconds with “setTimeout”: now I can see the surface but after that nothing happend. If I place an alert box before and another one behind theesObj = new EventSource('...');
statement, the first alertbox appear, the second was never seen.
What I want to know is: how can I use the eventsource interface in mobione. It seems like that it isn’t async (so I never see the results, because the connection will never terminated). Must I use a backgroundworker? or is there no support for EventSource, yet? Does anybody know a solution?
Thank you so far.
Best regards
Kasalop
support-michaelKeymasterAt this time (MobiOne 2.1 and earlier ver) the Test Center does not support server-side events and websockets apis. We realize the importance of supporting these and other emerging html5 core apis. We are working to prioritize their inclusion in upcoming mobione versions.
KasalopMemberok. No problem. But the application at the device have to work, I thought. so i want to know if the error is in the software or is in front of the computer (just me) 😉 I can’t figure out, because the debugging at the device is very hard. i tried to lookup if the EventSource class is defined and test this code:
alert(EventSource);
The messagebox show something like this: function EventSource() { [native code] }
I think its already implemented, but it doesn’t work?!With best regards
KasalopEDIT: I have a general question too. How do you parse the html and interpret the javascript code? Do you use an own interpreter, or do you use the buildin browser-engine of the devices? In the second case there is a problem: http://caniuse.com/eventsource there is no support for that yet in android.
EDIT2: ok. I figured out that you use the internal android borwser. Now I installed Opera Mobile and now it works (with a little error, but I think, I can do a workaround). But its very uncomfortable that all my users have to install the Opera browser. I think about to write my own ES class. -
AuthorPosts