Development >> Android >> Testers wanted http://bbcbasic.conforums.com/index.cgi?board=android&action=display&num=1518396331 Testers wanted
Post by Richard Russell on Feb 11th, 2018, 11:45pm
I am developing a software tool which will automatically convert a BBC BASIC program to an Android app. My objective is to make it as straightforward to create an APK file for Android as it is to create an EXE file for Windows using BB4W! Enough of it is working to give me confidence that I will succeed: here is an APK for David Williams' Forces of Darkness game that I made this way (40 Mbytes):
Because the user-interface is such an important aspect of the program I would like to invite people to try it out and give me their feedback before it is formally released. The prerequisites are that you must have written a BBC BASIC program which you have confirmed works on an Android device (using BBCSDL), and that you have a relatively modern Windows PC which has Java 1.7 or later installed (or on which you are happy to install Java).
If you would like to volunteer let me know.
Richard. Re: Testers wanted
Post by DDRM on Feb 12th, 2018, 07:53am
Sadly it seems that APKs generated by my utility fail to work for about 50% of those who have tried them: they stop with a 'String too long' error from BASIC. This happens for more than one app.
I can't see any reason for it, nor can I think of any variability between Android devices that could possibly cause some to work and others to fail, at least not with such a straightforward BASIC error.
Very unfortunately I cannot reproduce the error on any of my Android devices, they all run the APKs perfectly, so I'm not able to perform any diagnostics other than what can be carried out remotely by the people with the troublesome machines.
Apart from that my utility seems to be working very nicely, but it looks as though I won't be able to release it.
Re: Testers wanted
Post by DDRM on Feb 15th, 2018, 07:44am
That's a shame, and frustrating, presumably for both you and us!
Would you consider releasing it for personal use on an "at your own risk" basis?
Edit: I see on groups.io you have already thought of this (not surprisingly) and had a go at dealing with it I'll leave it in the message for historical consistency.[Without knowing anything about the internal working of your utility, might it occur when expanding a string like @usr$ into an absolute address? If different devices have different directory structures that might explain why the failure is machine dependent.]
If different devices have different directory structures that might explain why the failure is machine dependent.
Indeed, and as you say it's something I thought of, but it doesn't seem to be borne out by the evidence. The workaround which bypasses, but does not solve, the problem was to change this (simplified) code that generates the 'String too long' error:
$!^@dir$ = path$
into this code, which doesn't:
$$!^@dir$ = path$
The only difference is that the string is CR-terminated in the failing case and NUL-terminated in the working case. Not only is it hard to understand how the choice of terminator could make a difference, but it's even more mysterious that the 'failing' code only fails on a subset of devices.
Drilling down into the code of the interpreter the only significant difference that I can see is that in the $$ case the length of the string is found using the strlen library function (since NUL-terminated strings are the norm in C) whereas in the $ case the length is found by searching for the CR terminator using the memchr function and subtracting the start address.
So one 'explanation' for the problem is that the memchr function is failing, but why should it fail and why only on some devices? If you, or anybody you know, has some insight into this - I am far from being a C library expert - I would be very interested to know.
Richard. Re: Testers wanted
Post by Richard Russell on Feb 16th, 2018, 4:40pm
I've sent copies of the BBC2APK utility, albeit with known incompatibilities, to all those who expressed an interest in testing it - I think. If I've missed anybody out please get in touch.