GLBasic forum

Main forum => Bug Reports => Topic started by: Crivens on 2012-Jan-06

Title: NETWEBEND problem
Post by: Crivens on 2012-Jan-06
Ok, this is a weird one. If I make a new project with the single following line:-
NETWEBEND "http://developer.palm.com/appredirect/?packageid=com.teamgates.rotaslider"

Then it works fine. Windows opens it in the browser and my WebOS devices (Pre2/TP) open a browser which immediately opens the app store (TP fails as isn't for TP but Pre2 works fine), which is what I want, and what is expected.

However, when I put this exact same line as the first line of my game (3000+ commands) it quits the program as expected but then nothing else happens... ie. no browser, no app store, nothing. It's like you quit the program. I found this out after quite a bit of time moving the line around (thought it was not working in different functions or files initially). However being the first line of the program I thought it wouldn't matter...

So what the hell eh? Gernot, any ideas? Note it definitely used to work on my old game (Free version of Rotaslider) but now even that has the same problem. I can't remember when I last compiled that so I don't know if it's a new GLB problem or a WebOS one.

Cheers
Title: Re: NETWEBEND problem
Post by: ampos on 2012-Jan-07
it happened to my a while ago, and although I can't remdmber it, was related go glb calling a END znd not returning to exe the web string.

Hope my vague idea can help you :-)
Title: Re: NETWEBEND problem
Post by: Ian Price on 2012-Jan-07
You can't put NETWEBEND as the first line of your app, you must use ALLOWESC FALSE prior to calling it on Pre IIRC. That should stop the app exiting :)
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-07
Strange it works fine as a single line app on the pre and the TP but not as the first line in my main app.

I will try your suggestions a bit later.

Cheers
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-07
Nah that didn't work. I *want* the app to quit and then load up the store on WebOS. It totally used to work in my first app but now isn't. However if I put the NETWEBEND command as the *only* line of an app then it works fine (quits app then runs a browser which kicks off the app store). Using the NETWEBEND command in the main app just quits the app and does nothing else. My old app used ALLOWESCAPE FALSE and yes it used to get the app store up while keeping my app alive. Not working at all now.

Ampos, I don't quite understand what you are saying there. Can you explain again?

Cheers
Title: Re: NETWEBEND problem
Post by: Ian Price on 2012-Jan-07
Maybe Gernot has changed something? Maybe it's a bug that has always been there, just never discovered. I know in my old earlier apps using NETWEBEND wouldn't go to the site and also terminated the app (which seems to be what you are experiencing), but I then started using one of MrT's functions to keep the app alive, which also required ALLOWESCAPE FALSE. I did actually report to Gernot prior to this what you are experiencing, although this was a long while back, when I first started devving for webOS.

Dunno.
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-07
Hmm possibly. My original app doesn't work (quits but doesn't run the browser) now but I can't remember if it ever did or whether it only worked in iOS and I never tested the same code in WebOS. Pretty sure I tested it at the time though so possibly a bug in the latest WebOS?

Still it's a bit weird how the exact same command works perfectly in WebOS if it's the only line of code (or two as I also tried it with a string variable for the URL originally).

Seriously annoying though as the whole reason I wrote an shop function was because WebOS can't search the app store like iOS can (although iOS is a bit rubbish for searching too especially if your company name has a space in it).

Hopefully Gernot can fix the problem though. It's almost the last thing to do before releasing my new app really.

Cheers
Title: Re: NETWEBEND problem
Post by: Kitty Hello on 2012-Jan-08
did you play with AUTOPAUSE, too?
What does the console windows show?
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-08
Quotedid you play with AUTOPAUSE, too?
Not yet at all on my new project, but my old one sets it to TRUE if that helps. How does it make any difference though if two projects use the same command and one works and the other doesn't when the command is the first thing that happens in both projects (even though one of those projects *only* uses this command)? I'll give it another go a bit later if I get a chance.

QuoteWhat does the console windows show?
You will have to explain what you mean a bit more to me for WebOS.

Cheers
Title: Re: NETWEBEND problem
Post by: Kitty Hello on 2012-Jan-09
in compiler/platform/webos/tools/bin is a "deviceshell.bat". That should give you the ability to run a program from command line and view the stdout printout. Also the GLBasic engine log.
To make it easier, make a symlink to the apps-directory:
Code (glbasic) Select

ln -s media/cryptofs/apps/usr/palm/applications apps


you can then do:
Code (glbasic) Select

cd apps
cd com.company.yourapp
./glbasic-webos-exe
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-09
QuoteShut down GLB
glb is shut down
exiting with url http://developer.palm.com/appredirect/?packageid=com.teamgates.rotaslider
Ignore the segfault that will come now ;)PDL_Quit
</PDL_Quit>
exit
Ok, here is what I get. After this nothing is on the Pre2. Just the desktop.

Note that I also did this for my test program that *only* does the exact same NETWEBEND command that is above (and I end up with the app store in the correct location and a browser window open which is fine). And the trace is identical to the above at the end.

Cheers
Title: Re: NETWEBEND problem
Post by: Kitty Hello on 2012-Jan-10
Oh. That's very strange then.
Maybe you must clear some memory before?
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-10
Hmm. First perhaps I should make my test app load tonnes of sprites and see if that can still exit to a browser.

It's weird though as the trace specifically says it is "exiting with URL" which is identical to the test app.

Honestly this "finish the game off" stage takes bloody forever. Wrote the main game in an afternoon, and that code has hardly changed since then, and it's now been about 4 months of "everything else"...

As an alternative is there any other way to kick off a URL do you think? I know Trucidare has/will have a library to allow a URL inside an app. Do you think (or anything else you can think of) this would be a good (possibly better) workaround the problem?

Cheers
Title: Re: NETWEBEND problem
Post by: Kitty Hello on 2012-Jan-10
No. There's no other way than the PDL_ function I use :(
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-10
Hmm. Ok I will try the memory release later. Out of interest, assuming that is the problem, could the same thing be done by GLB? ie. if WebOS and doing NETWEBEND then clear out all memory it can first before exiting?

Cheers
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-10
Oh and is there (can there be?) a command that gets me the memory/video memory left?

Cheers
Title: Re: NETWEBEND problem
Post by: Kitty Hello on 2012-Jan-10
I don't think I can calculate the memory in use. Not x-platform anyway.
But the netwebend might be possible for apps that really end.
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-10
Ah yeah, good point, only do it if really are ending the app (is that ALLOWESCAPE? Can't remember right now...). So if it stays in memory then don't do it. Assuming that's the problem of course!

Cheers
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-13
I tried my small program loading in a load of sprites (more than I use in my game) and then doing the NETWEBGET and it works perfectly.

I assume then if it's a memory problem then it's to do with the program itself taking up a load of memory when it quits and doesn't have enough to run the browser. This would explain how come putting the NETWEBGET right at the start of my main program doesn't work (quits but doesn't do browser even though trace says it exited with a URL command). ie. the program all loads into memory then it performs the NETWEBGET command. It then quits but because the program is in memory it doesn't have enough to run the URL command.

Can you then see about making sure the memory is flushed of the program when it quits a WebOS app with a NETWEBGET? Hopefully that will do it!

Cheers
Title: Re: NETWEBEND problem
Post by: Kitty Hello on 2012-Jan-16
ok, will do.
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-16
Ta! Hopefully that will fix it. It is about (mustn't forget little list of things to implement before release) the only thing that is holding up a WebOS release really.

Cheers
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-17
Out of interest can SHELLEND be used instead to call the catalog directly (even better as won't use browser)? I tried making it do anything but all I get is "failed to call" messages. Still, would be nice if this could be used and then pointed at the correct location for the app catalog.

Cheers
Title: Re: NETWEBEND problem
Post by: Kitty Hello on 2012-Jan-18
No. the shop must be called with netwebend. It's a website. You can't launch real apps on mobile devices with this. On WebOS you "might" be able to run some command line utils like sed/awk.
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Jan-18
That's a shame. I haven't used many apps on WebOS but do they also have a browser hanging about then? ie. there is no possible way to launch the catalog without using the browser?

Any further with the fix for webos memory clearout?

Cheers
Title: NETWEBEND problem
Post by: Crivens on 2012-Feb-04
Hey Gernot, get any further with the memory clear out? I've submitted the app for TP as it works on there but have left it for pre until this is resolved.

Cheers
Title: Re: NETWEBEND problem
Post by: Kitty Hello on 2012-Feb-06
not yet. Just clean you graphics memory used manually:

Code (glbasic) Select

FOR i= 0 TO 32767
   GRABSPRITE i, 0,0,0,0
NEXT

Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Feb-06
Ah ok. I assumed it was program memory or something because I created a test program with about 10 lines of code and loading in loads of sprites (hundreds more than I used in my game) and it still worked on the Pre2. Either that or it freaks out if inside a different source file than the main on a Pre2 (TP works fine). I'll give this a go though just incase.

Cheers
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Mar-02
Quotenot yet. Just clean you graphics memory used manually
Makes no difference. It always works on the TP (even without your memory clean) but not on the Pre2 (just quits once I make sure allowescape true but either way does nothing at all let alone launch a browser). Notice that my new demo project which just included my full shop code works fine on the Pre2, just not in my bigger actual game project. Perhaps it needs to clear the whole program out of memory?

Cheers
Title: Re: NETWEBEND problem
Post by: Crivens on 2012-Mar-03
Well it didn't mention it in the latest upgrade (10.283) but it seems it now works again on the Pre2! :)

Just for other users it works exactly like the TP and doesn't require the sprite routine that Gernot posted to clear sprites out of memory, and the AUTOESCAPE doesn't have to be true.

Cheers