GLBasic forum

Main forum => Bug Reports => Topic started by: BdR on 2011-Dec-18

Title: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: BdR on 2011-Dec-18
Recently I updated my game and I noticed that PLATFORMINFO$("DEVICE") doesn't seem to work correctly on WebOS. So I did a test:
Code (glbasic) Select

PRINT "PLATFORM=" + PLATFORMINFO$(""), 20, 20
PRINT "DEVICE=" + PLATFORMINFO$("DEVICE"), 20, 40

On the ipod this gives:

PLATFORM=IPHONE
DEVICE=IPOD TOUCH

But on my Palm Pre this gives:

PLATFORM=WEBOS
DEVICE=NO_DATA

While in previous versions it gave DEVICE=PRE. The update was compiled with GLBasic v10.118, and when I tested it just now with GLBasic v10.205 it still gave NO_DATA on Palm Pre. I think this is a bug.

My app does a one-time log message to my server at the first time startup and the PLATFORMINFO$("DEVICE") value is logged. The wierd thing is, that after the update most WEBOS users (89.13%) logged the device value as "NO_DATA", but some (10.87%) did log the device value as "PRE"..?
Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: Kitty Hello on 2011-Dec-19
Was a bug. Fixed in next update.
Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: BdR on 2011-Dec-19
Thanks, I'll probably update my webos apps next year, but looking forward to the update. :good: Btw what are the possible values that PLATFORMINFO$("DEVICE") will return on the WebOS platform?
Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: Kitty Hello on 2011-Dec-20
"PRE", "PIXI", "TOUCHPAD".
PRE  =320x480, PIXI=320x400, Touchpad is bigger than that. I should use https://developer.palm.com/content/api/reference/pdk/pdl/pdl-get-hardware-id.html to get more information. But if https://developer.palm.com/content/api/reference/pdk/pdl/pdl-get-pdk-version.html returns a value > 100, you can call that yourself:
Code (glbasic) Select

INPORT "C" int PDL_GetPDKVersion(void);
IMPORT "C" int PDL_GetHardwareID(void);

IF PDL_GETPDKVersion() > 100
   LOCAL id% = PDL_GetHardwareID()

ENDIF


Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: BdR on 2011-Dec-20
Quote from: Kitty Hello on 2011-Dec-20
"PRE", "PIXI", "TOUCHPAD".
PRE  =320x480, PIXI=320x400, Touchpad is bigger than that.
Actually Palm Pre3 device has 480x800 (see wikipedia (http://en.wikipedia.org/wiki/HP_Pre_3)) and I though GLBasic is compatible with that one, right?
Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: Kitty Hello on 2011-Dec-22
OK, I'll update to offer proper values. So far, use the function I posted.
Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: Wampus on 2011-Dec-23
Would this also have impacted using PLATFORMINFO$("APPDATA") by any chance?

Had a report in that PowFish wasn't saving progress. Am going to issue an update today.
Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: Wampus on 2011-Dec-23
Heh. Found this on the WebOS developer resources (https://developer.palm.com/content/api/reference/pdk/pdl/pdl-get-data-file-path.html):-

"We would like to thank our users for bringing to our attention a bug in the initial release of webOS 1.4.5: this API returns a location that is not writable. This also applies to apps that are trying to save data to a location in /media/internal/. We apologize if this issue affects your app.

As a workaround, you can save preference and configuration data in your app's directory. Your app can do this by writing to a file with no relative path. Any files and folders created there are not visible to the user and are preserved when your app is upgraded. However, if the user deletes your app from the device, they are removed, unlike those in the location returned from this API.
"

So, I'm going to save to the root app directory and use the full path, just to be safe.
Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: Kitty Hello on 2011-Dec-23
Platforminfo appdata or documents
Title: Re: WebOS: PLATFORMINFO$("DEVICE") gives NO_DATA
Post by: Wampus on 2011-Dec-23
Thanks. Updated me stuffs.