Hi Guys,
I am looking to see if I need to incorp keyboard features to my app or use some internal value to identify the username for a highscore table?
I want to send the scores online...My main issue is getting the name saved in a userfriendly manner.
Any ideas?
Also, I tried openfile on android and my program crashed...any ideas there?
Ok not crashing now that I error check the openfile command...but whats best practice for creating files in android Media folder?
IF i can help, I think in the sample folders you have something for make an High Score tables into a remote Server...
About Keyboard I always I do my keyboard, it's very easy to do.
PS: If you need I think I have the code in fantasy Bricks for do all this tasks. :good:
My main issue at the moment is trying to store highscore in text file locally...
for some reason its not working...
FUNCTION gethighscore:
LOCAL test$ = GETCURRENTDIR$()+"Media/data/scr.txt"
LOCAL hsc% = 0
LOCAL ok
ok= OPENFILE(1, test$, TRUE)
IF ok=TRUE
READLONG 1,hsc%
IF hsc% > 0 THEN RETURN hsc%
CLOSEFILE 1
ENDIF
ENDFUNCTION
FUNCTION sethighscore:sc%
LOCAL test$ = GETCURRENTDIR$()+"Media/data/scr.txt"
LOCAL ok=TRUE
//KILLFILE test$
ok=OPENFILE(1,test$,FALSE)
IF ok=TRUE
WRITELONG 1,sc%
CLOSEFILE 1
ENDIF
ENDFUNCTION
Got the create file to work with platforminfo documents setting...but would have preferred the Media/data folder setup...is it a permissions write issue?
OK...how does netwebget$ work and does it work correctly on Android...?
Recently I have been thinking about how to store high score online but as an simple alternative, if you don't mind me sharing. In the olden days when sending in high score to game magazines, we'd take a Polaroid photo screen shot as proof. :zzz:
For a modern version, I would like to add QR codes for high scores. The idea is that the score can be saved as a photo offline, without having to write anything down or just scanned whilst online. The QR code would consist of the player and game details perhaps unique to that session and it's just a replacement for netwebget$. Now if only we had QR code in GLB. :P
What stops you from writing your own qr-code generator? :-)
Guys,
Netwebget$ should work perfectly for me and i have the online database and php page made. But I am thinking, is my ISP blocking the connection?
The php code works when done manually but not when done by the App.
So is there a permissions problem for Internet access from the app itself (for Android)?
:blink:
All good now...got it working ;-)
Even when fixing your own problems: If you posted the question already, please enlighten us to the solution too, for the next poor sod having the same problem :-)
(Usually it's because of mixing up the domain name and the url path in the strings) :-)
You're right Moru!
My first issue was the name recording using Android Extras...
Once I separated the startVKText() from getVKText via a Showscreen and a delay of 500ms I was able the get the value required for the Name value.
Then using netwebget$ works perfectly now...with a condition to prevent false sending...
IF nme$<>"" THEN scoretable$=NETWEBGET$("www.gazzapper.com",pathloc$,80,512,5000)
(Note: using forward slash "/" in the start of the pathloc$ str
I setup my own mysql db online and php to save the results...I now have the following...
sending to server and save (Y)
get from server and parse data using a splitstr function (Y)
Hope this helps others down the line...
End result...
Looks very nice :-)
Are you using any sort of encryption for the transfer?
Thanks Moru.
Not yet, just a security code. Will add better encryption soon.
That looks good. :good:
Quote from: matchy on 2014-Jan-22
Now if only we had QR code in GLB. :P
Quote from: Moru on 2014-Jan-22
What stops you from writing your own qr-code generator? :-)
It's
our own. ;)
So what to you think of my idea?
Hi Matchy,
So if I understand your idea correctly...Someone gets a highscore and the game displays a QR code...The user would then need a second "device" to scan and post that details?
(but this still requires a backend to save it? no?)
I am not sure how u mean it to work with user uploading/hosting their own image though...?
I believe there is a javascript version of QR code generator on the web somewhere...but I am not sure if its easier for the user...maybe easier for the developer...
I'm still trying to understand the benefit of using qr-codes for saving highscores online. QR-codes are easy to make on your own if you know how so is not useful for creating a safe highscore table. Saving offline because you don't have internet at the moment? Just save it in a file on the device and upload when there is internet next time. Instead of having the user to scan the QR-code from a screenshot, make it easy for the user :-)
The conceptual progress and reason for using QRCode is that there are some (gaming/vending) systems that are naturally isolated from the internet. An plain example could be an iPod touch in a non-WiFi zone but the user or friend may have any mobile camera phone with web access. There's surely something out there that does this, at least that's not actually marketing hook.
The reason I have been thinking about it is that in my case it is Arduino with a display and/or gaming shield. The only issue here is that the QRCode can be heavy on the program memory. Again, the idea would be that instead of typing in your high score in a web page the score and other info is transferred. Right now I'm not certain on the amount of data that can be sent but perhaps there would also be program/user key data also in the post query as just taking a photo is not a valid verification.