Date   
Re: The next steps in installing apps on the Android phone

Ian_Wade_G3NRW
 

Another question if I may.

Following your instructions I have successfully copied one of your original examples DLGDEMO.BBC from the PC into the *@usr$* folder at Android/data/com.rtrussell.bbcbasic/files on the phone.

However, it does not run properly, presumably because the WINLIB2.BBC library file is missing. Question is: how do I get library files into the *@lib$* folder?

Ian

On 20/02/2018 09:32, Richard Russell wrote:
On Tue, Feb 20, 2018 at 12:03 am, Ian_Wade_G3NRW wrote:
where do I copy them to in the phone so that BBCBasic.apk can find them?
As you say I have documented that before, but I am happy to do so again.  The location can vary a little from one device to another, but typically it will be something like *Android/data/com.rtrussell.bbcbasic/files/*  (this corresponds to the *@usr$* folder in BBC BASIC, so you will need to look in that folder to find any programs you have copied there).
Of course with my new *BBC2APK* utility now being in beta test, you also have the possibility of creating a completely self-contained Android App that is independent of BBC BASIC and can be distributed (or sold) as you wish.  But you will in any case have wanted to test your program thoroughly using BBC BASIC on Android first.
Richard.

Re: The next steps in installing apps on the Android phone

Ian_Wade_G3NRW
 

Richard

I told you I was still learning :-) I have just discovered the Menu button and what it does. Problem solved.

Incidentally, I am running Lollipop v5.1.1

Ian

On 20/02/2018 16:31, Richard Russell wrote:
Out of interest, what version of Android are you running?  Pre-KitKat the menu button really did bring up a menu (!), so in those days to close an app you had to *hold down *the menu button and then swipe - not exactly difficult but slightly more effort.  I've been assuming that you're running something more recent so that the menu button directly leads you to the 'close apps' screen.
Richard.

Re: The next steps in installing apps on the Android phone

Richard Russell
 

On Tue, Feb 20, 2018 at 08:29 am, Ian_Wade_G3NRW wrote:
Re "closing and restarting BBC BASIC", I still don't see how to do that.
I'm not really understanding what your difficulty is, sorry.  I'm suggesting that you use the same 'close app' action as you would for any other app: that is to tap the menu button, which takes you directly to the 'open apps' screen on modern versions of Android, and then swipe it away (or you may find there is a Close All button; there is on my Samsung tablet).

As I said in my previous reply, if you're using an ancient version of Android (Jelly Bean being the only one with this characteristic that will also run BBC BASIC) the Menu button still had its original purpose of opening a menu, and in that case you have to long-press the button in order to bring up the open apps screen.

But either way, if you don't routinely close apps when you have finished with them, every single app you have ever started since last rebooting the device will still be running in the background!

Richard.

Re: The next steps in installing apps on the Android phone

Richard Russell
 

Out of interest, what version of Android are you running?  Pre-KitKat the menu button really did bring up a menu (!), so in those days to close an app you had to hold down the menu button and then swipe - not exactly difficult but slightly more effort.  I've been assuming that you're running something more recent so that the menu button directly leads you to the 'close apps' screen.

Richard.

Re: The next steps in installing apps on the Android phone

Ian_Wade_G3NRW
 

Hmmmm. Understood about the Immediate Mode.

Re "closing and restarting BBC BASIC", I still don't see how to do that. I have the ">" command screen and the keypad visible again now. Pressing the Android back key just displays another "Escape" message then another ">" on the command screen.

If I then press the Android refresh key, the BBC Basic icon re-appears, but when I click on that it doesn't restart Basic. It just returns to the command screen I've been trying to escape from.

I will now go away and experiment some more before coming back here for more help. I'm sure most of my problems are due to not yet fully understanding this new-fangled smart phone.

Ian

On 20/02/2018 15:57, Richard Russell wrote:
On Tue, Feb 20, 2018 at 07:35 am, Ian_Wade_G3NRW wrote:
I had to power down the phone and start it again to restore proper
control.
That sounds bad!  That's never been required here, and nor should it. When you say "to restore proper control" to what extent was full control not returned by closing-and-restarting BBC BASIC?  That should have re-initialised everything.

I now see the helpful instruction to press the Android back key twice to escape.
No, that's not going to help you - it's specifically to get you back to the menu after *deliberately* entering immediate mode. But it won't have that effect on a crash or an accidental exit to immediate mode.
Before you go any further I would experiment with repeatedly closing and re-opening BBC BASIC. That should be absolutely fine, just as it should be with all other apps, and any 'loss of control' requiring a reboot indicates that something is seriously wrong.
Richard.
_._,_._,_

Re: The next steps in installing apps on the Android phone

Richard Russell
 

On Tue, Feb 20, 2018 at 07:35 am, Ian_Wade_G3NRW wrote:
I had to power down the phone and start it again to restore proper control.
That sounds bad!  That's never been required here, and nor should it.  When you say "to restore proper control" to what extent was full control not returned by closing-and-restarting BBC BASIC?  That should have re-initialised everything.

> I now see the helpful instruction to press the Android back key twice to escape.

No, that's not going to help you - it's specifically to get you back to the menu after deliberately entering immediate mode. But it won't have that effect on a crash or an accidental exit to immediate mode.

Before you go any further I would experiment with repeatedly closing and re-opening BBC BASIC. That should be absolutely fine, just as it should be with all other apps, and any 'loss of control' requiring a reboot indicates that something is seriously wrong.

Richard.

Re: The next steps in installing apps on the Android phone

Ian_Wade_G3NRW
 

Thanks again Richard

I have no quarrel with that, but I had to power down the phone and start it again to restore proper control. However, trying some other apps that display the command window, I now see the helpful instruction to press the Android back key twice to escape.

Onwards and upwards!

Ian

On 20/02/2018 15:23, Richard Russell wrote:
On Tue, Feb 20, 2018 at 07:00 am, Ian_Wade_G3NRW wrote:
How do I get out of this?
Close BBC BASIC and open it again.  It's inevitable that a general purpose programming language may occasionally crash, or exit to immediate mode etc. in which case you've got no choice but to close the app and start again.  I'm one of those people who (rightly or wrongly) don't like apps running in the background anyway, so it's second nature for me to close everything. I know some claim that's not actually a good idea; but with BBC BASIC there will be occasions - not often, hopefully, but some - when you have no choice.
If you don't routinely close your apps you may get a surprise when you see how many are running in the background!
Richard.

Re: The next steps in installing apps on the Android phone

Richard Russell
 

On Tue, Feb 20, 2018 at 07:00 am, Ian_Wade_G3NRW wrote:
How do I get out of this?
Close BBC BASIC and open it again.  It's inevitable that a general purpose programming language may occasionally crash, or exit to immediate mode etc. in which case you've got no choice but to close the app and start again.  I'm one of those people who (rightly or wrongly) don't like apps running in the background anyway, so it's second nature for me to close everything. I know some claim that's not actually a good idea; but with BBC BASIC there will be occasions - not often, hopefully, but some - when you have no choice.

If you don't routinely close your apps you may get a surprise when you see how many are running in the background!

Richard.

Re: The next steps in installing apps on the Android phone

Ian_Wade_G3NRW
 

Getting warmer. BBC Basic is now installed and working on the phone, and I have seen a list of demo apps and tried some.

However, then I selected another app from the list (unfortunately I can't remember which one it was). Now all I see is a command window with the ">" command prompt, and a keypad. Trouble is, I can't see how to escape from this. I tried exit, quit, bye, but all I get is the helpful error message "Mistake", followed by a new ">" prompt.

How do I get out of this?

Ian

On 20/02/2018 09:32, Richard Russell wrote:
On Tue, Feb 20, 2018 at 12:03 am, Ian_Wade_G3NRW wrote:
where do I copy them to in the phone so that BBCBasic.apk can find them?
As you say I have documented that before, but I am happy to do so again.  The location can vary a little from one device to another, but typically it will be something like *Android/data/com.rtrussell.bbcbasic/files/*  (this corresponds to the *@usr$* folder in BBC BASIC, so you will need to look in that folder to find any programs you have copied there).
Of course with my new *BBC2APK* utility now being in beta test, you also have the possibility of creating a completely self-contained Android App that is independent of BBC BASIC and can be distributed (or sold) as you wish.  But you will in any case have wanted to test your program thoroughly using BBC BASIC on Android first.
Richard.

Re: The next steps in installing apps on the Android phone

Ian_Wade_G3NRW
 

Many thanks Richard. I will try this later today.

Ian

On 20/02/2018 09:32, Richard Russell wrote:
On Tue, Feb 20, 2018 at 12:03 am, Ian_Wade_G3NRW wrote:
where do I copy them to in the phone so that BBCBasic.apk can find them?
As you say I have documented that before, but I am happy to do so again.  The location can vary a little from one device to another, but typically it will be something like *Android/data/com.rtrussell.bbcbasic/files/*  (this corresponds to the *@usr$* folder in BBC BASIC, so you will need to look in that folder to find any programs you have copied there).
Of course with my new *BBC2APK* utility now being in beta test, you also have the possibility of creating a completely self-contained Android App that is independent of BBC BASIC and can be distributed (or sold) as you wish.  But you will in any case have wanted to test your program thoroughly using BBC BASIC on Android first.
Richard.

Re: The next steps in installing apps on the Android phone

Richard Russell
 

On Tue, Feb 20, 2018 at 12:03 am, Ian_Wade_G3NRW wrote:
where do I copy them to in the phone so that BBCBasic.apk can find them?
As you say I have documented that before, but I am happy to do so again.  The location can vary a little from one device to another, but typically it will be something like Android/data/com.rtrussell.bbcbasic/files/  (this corresponds to the @usr$ folder in BBC BASIC, so you will need to look in that folder to find any programs you have copied there).

Of course with my new BBC2APK utility now being in beta test, you also have the possibility of creating a completely self-contained Android App that is independent of BBC BASIC and can be distributed (or sold) as you wish.  But you will in any case have wanted to test your program thoroughly using BBC BASIC on Android first.

Richard.

The next steps in installing apps on the Android phone

Ian_Wade_G3NRW
 

Richard

I (think I) am getting closer to installing and running .bbc programs on my phone. Using Windows File Explorer on my PC, with the phone connected via a USB port, I can now see the folder structure on the phone.

I am sure you documented the instructions for what to do next somewhere in this group, but I can't find them. So here are my assumptions.

1. Download Android (4.2.1 or later): http://www.rtr.myzen.co.uk/BBCBasic.apk (8.1 Mbytes) onto the PC. Then transfer it to the Apps folder in the phone.

2. Transfer .bbc files from the PC to the phone, but where do I copy them to in the phone so that BBCBasic.apk can find them?

Ian

Re: The Entertainer

Ian_Wade_G3NRW
 

Me too. You are a goldmine of information, Richard.

I have just acquired a Galaxy J3(2016), Android v5.1.1, with apparently no intention/possibility to provide v6 or later (the phone is the basic model, with only 8GB internal memory, and possibly too slow for v6 upwards). However, this phone is one giant leap for mankind -- for the previous 20+ years I have been using a Nokia Marsbar -- so I am still finding my way around it. Main reason for buying the Samsung was the frustration of sending texts on the 3-letters-per-key keypad on the Nokia!

Keep your information coming, please!

--
73
Ian, G3NRW
g3nrw@...

***** Editor: TS-590 Family Resources Page: http://g3nrw.net/TS-590
***** Editor: IC-7300 Resources Page: http://g3nrw.net/IC-7300

On 19/02/2018 06:33, Kendall Castor-Perry wrote:
>> Is this kind of analysis useful?
Highly, at several levels.  I will never tire of posts like that.

Re: The Entertainer

 

>>  Is this kind of analysis useful?

Highly, at several levels.  I will never tire of posts like that.

Re: The Entertainer

 

On Sun, 18 Feb 2018, at 11:20, Richard Russell wrote:

Is this kind of analysis useful?
Yes. Both the choice of co-ordinate system and the method of modelling
the sound queue are far from obvious, and therefore interesting.

--
Jeremy Nicoll - my opinions are my own.

Re: The Entertainer

Gordon
 

I'm a beginner having forgotten 95% of everything i knew 40 years ago. Work, family and life got in the way but my interest in BBCBasic is as strong as ever so your analysis is very useful in helping me understand how i need to think to be able to resume programming in BBCBASIC  thank you for your hard work. Its much appreciated.

Re: The Entertainer

Richard Russell
 

on Yesterday at 9:23pm, Richard Russell wrote:
it is 100% BASIC, compatible with both BB4W and BBCSDL, and not complicated

I like to think, or at least hope, that publishing these various demo programs motivates people to aspire to writing similar programs themselves - or at least to think about how they might go about it.

As I said, the animated piano keyboard was not complicated, but it did involve a couple of interesting aspects, and there may be some value in me explaining how I approached them.

Drawing the 3D keyboard itself was obviously trivial. All the white keys are identical and are modelled as simple cuboids; there was no need to model the 'cutouts' where the black keys go, because by the magic of 3D rendering the black keys simply occupy the same volume! The black keys themselves are slightly more complicated, because of the slant front face, but nevertheless they only have four more triangles each.

So drawing the keyboard was straightforward, but what about animating it? This is where the first 'trick' came in: I chose the coordinate system and orientation of the keys so that 'y=0, z=0' corresponded to the key's pivot point! Now, animating the key was simply a case of changing its tilt value (pitch if you prefer the aeronautical term) which was a big simplification.

The second issue was: how do I determine what notes are currently playing, so as to animate the keyboard in (approximate) synchronisation with the music? The program knows when the SOUND statements are executed, but the sounds are queued by BBC BASIC and are typically made quite some (variable) time later: this is to ensure that music can be played in strict tempo whilst the BASIC program is off doing other things.

There's no legitimate way of 'peeking' the SOUND queues, so surely it must be impossible to determine what sound is playing 'now'? But in fact it is possible! Firstly, in the absence of any way to interrogate the sound queues, I simply create my own copies in the program: so long as I put a new event into my copy of the queue whenever a SOUND statement places a note into BBC BASIC's queue, the two should remain 'in step'.

Having solved the problem of peeking the queue, all I needed to do is to use ADVAL() to discover how many notes are currently queued on each SOUND channel (ADVAL returns the number of free bytes in the queue, but it's easy to calculate from that the number of queued notes). So by looking in my copy of the queue, at a location depending on the number of queued notes, I could find out what sound is currently being played on that channel!

As is so often the case, coding the program was straightforward but it was necessary to do some preliminary thinking to work out just what it needed to do.

Is this kind of analysis useful?

Richard.

Re: Testers wanted

Richard Russell
 

On Fri, Feb 16, 2018 at 03:01 pm, <mclout@...> wrote:
I would like to check it out if that is ok.
I've sent you the email with the link too.

Richard.

Re: Testers wanted

mclout@...
 

I would like to check it out if that is ok.  Thanks either way.

Re: Testers wanted

Richard Russell
 

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.

I've also updated the Forces of Darkness app and put it back where it was: http://www.rtr.myzen.co.uk/FOD.apk

I know that this app places heavy demands on GPU texture memory and some devices, particularly with earlier versions of Android, give up and crash as a result.

Richard.