Page 1 of 1
native browser
Posted: Mon Jun 25, 2012 1:50 am
by colourpixels
Hi All,
Looking through the Android release notes it seems like a browser control should be easy enough to create (I've already got an iPhone version of my app running, just trying to make an Android version now).
I've got an on card open script as follows:
Code: Select all
on preOpenCard
if the environment is not "mobile" then
exit preOpenCard
end if
-- Create our browser control and store the id
mobileControlCreate "browser"
put the result into sBrowserId
-- Native controls start off invisible
mobilecontrolset sBrowserId, "visible", "true"
-- Set up a suitable initial url
mobilecontroldo sBrowserId, "load", "http://www.google.com"
-- Make sure everything is the right size
resizeStack
end preOpenCard
All I get is a black screen in the emulator though. Anybody got any tips?
Many thanks
Dale
Re: native browser
Posted: Mon Jun 25, 2012 3:37 am
by sturgis
In your resize handler you are doing a mobilecontrolset sbrowserid,"rect","0,50,200,250" right? (with your own numbers of course)
I managed to get it working in the emulator as well as on a device (kindle fire). can you post your resize script?
I did notice that I just can't get mobilecontroldo sbrowserID,"load" to work reload works, i'm sure the others do but load just seems to do nothing.
So i'm using mobilecontrolset sBrowserId,"url","
http://www.google.com"
EDIT: IF I understand the dictionary entry, mobilecontroldo used with "load" is for pushing your own html into the browser. Tried it that way and it works fine.
mobilecontrold sBrowserId,"load","http://somebaseurl","<H1>This is a test</h1>"
Re: native browser
Posted: Mon Jun 25, 2012 5:28 am
by colourpixels
Awesome thanks for the reply. I'll give the url command a try and see how I go. At the moment, my virtual device seems to be broken, I can't even get a hello world app to load anymore (and not sure at which point it broke).
Any chance you could post the Android VDM settings you're using and the corresponding standalone application settings?
Thanks again
Dale
Re: native browser
Posted: Mon Jun 25, 2012 11:33 am
by sturgis
The target is android 2.3.3 api level 10,
arm of course
sd card 10 MiB (I'm not worried about external storage use yet)
snapshot is not turned on.
Skin, using built-in wvga800
which means hardware is:
abstracted density 240
max vm application heap size 24
device ram size 256
On startup my options are limited (since i'm not using snapshots) scale display to real size is not selected. Sometimes I will choose Wipe user data.
I also never try and test anything with less than 2.3 (I think its just me but I had some trouble getting 2.2 to work when I was just starting with android.. Surely something I was doing but.. When I tried 2.3+ I got things to work. Plus my devices are all 2.3.3 and up.)
While I doubt it will have an affect (like I said i'm sure it was ME causing the problems when trying with 2.2) if nothing else it wouldn't hurt to try an alternative to whatever platform level you're using now.
Re: native browser
Posted: Thu Jun 28, 2012 8:16 am
by colourpixels
Many thanks that all worked a treat, it was the lower version that was killing it. "url" also worked, so all is cool.
Thanks again for your help, it was greatly appreciated.
Cheers
Dale
Re: native browser
Posted: Fri Jun 29, 2012 6:13 am
by jacque
Ian from the RR team helped me with the black screen problem today here at the conference. For me, anything launched in 2.2 Android emulation opened all black, though 2.3 worked fine. It turns out that I had all sensors turned on for that particular emulator image. When Ian turned off all sensors and restarted the 2.2 emulator image, it worked again. Since the emulator can't use any sensor info, you aren't missing anything by turning them all off.
It was a real treat to watch Ian debug it. He sure knows his way around Android and the terminal.