BBC Basic for windows and Android - *DISPLAY and swiping

bbc micro/electron/atom/risc os coding queries and routines
User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 11:24 am

I finally got it working in Android Richard :)
This is what I had to add......I wasn't sure what to write...you have to put @dir$ before the path like you said ( but I wasn't quite sure where e.t.c)
Anyway now I have this working I can proceed. I am thinking how to get these pictures on the internet then it can load from there.
Anyway this is a massive step forward.
Bluestacks is a very useful tool for this. It can do portrait or landscape and you can test touch with it on your windows pc (it runs as a VM of some sort)

Here is what I changed:

OSCLI "DISPLAY """ + @dir$ + pic$ + """"

OSCLI "DISPLAY """ + @dir$ +bmp$ + """" +" 510,416,1040,700

User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 12:50 pm

My main issues now are how to work out resolutions. It displays ok in Bluestacks at 720x1280 portrait but when I copy it over to my phone it's not displaying properly/image chopped off. So I need to read up about how to get around resolution issues.

The other thing I need to do is work out finger presses. At the moment I have A$=GEt$ which moves from one pic to the next. On Android that does nothing when you tap the screen. So I need to work out if user taps screen then go back to the start of the program.

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by Richard Russell » Sat Jan 04, 2020 1:32 pm

pixelblip wrote:
Sat Jan 04, 2020 12:50 pm
when I copy it over to my phone it's not displaying properly/image chopped off.
I don't think it should ever be cropped, normally it will be scaled to fit your display (whilst preserving the aspect ratio). How are you setting the 'window' size, by means of a MODE statement or what? How do the various example programs supplied with BBC BASIC behave in that respect? Are you getting cropping with any of those?
The other thing I need to do is work out finger presses.
The thread title refers to 'swiping' and I thought that was your plan. I explained how to implement swiping, so have you now changed your mind about that?

User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 1:56 pm

Hi Richard
I haven't changed my mind about swiping..... I am a beginner with it so need to start with little steps........that's all......just trying things out a bit first...keyboard presses are the easiest thing to get going with at the start with A$=GET$! I will have a look at the mouse commands now. The thought of programming a swipe.....it's a bit too complicated at the moment for my level ( maybe ).

The resolution issue I am not sure what to do about.....I will try a few MODE commands.... On my galaxy S8 the whole image (gallery and pic) displays in only the bottom left quarter of the screen.....but on my lower cheapo Doggee X70 the image get's chopped off in half in portrait mode.

When I look at the Doggee the resolution is 540 x 1132 and the Galaxy far higher so I am puzzled how to get about acommodating all these size phones and resolutions ( I really need a command that gets the resolution and then stretches the picture to that ).

I have to say it's a marvel the way you have programmed BBC basic and got it to create Android apps - it's genius. We are very lucky to have someone like you in the Acorn world! I can't think of another way I'd be able to do this....with Java (Urrgh) so I think this is brilliant I have got so far....because of BBC Basic's simplicity.

User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 2:03 pm

Here's what I am seeing. I haven't experimented yet with any MODE commands...the Galaxy s8 is on the right
Attachments
IMG_1477.jpg

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by Richard Russell » Sat Jan 04, 2020 2:13 pm

pixelblip wrote:
Sat Jan 04, 2020 1:56 pm
I haven't changed my mind about swiping..... I am a beginner with it so need to start with little steps........that's all
I think swiping is a "little step" but perhaps our perceptions of difficulty are different! Whichever way you want to do it, get it working on the PC (using the mouse) first, it makes no sense to write any 'Android-specific' code for something so straightforward. Really it's only if you want to implement 'multi touch' facilities (such as pinch-to-zoom) that you need a genuine touchscreen for testing. Admittedly I am spoilt by having a touchscreen on this Windows laptop anyway.
I really need a command that gets the resolution and then stretches the picture to that
You don't! One of the very first design decisions I made for BBC BASIC on Android and iOS was that, because of the variety of screen resolutions and shapes, BBCSDL would do the necessary scaling automatically (and support pinch-to-zoom, by default). That's why I asked how the supplied example programs are behaving, the majority don't take any special measures to adjust to the screen size (some do) and if that's not working properly on your device I need to know.

Try dibley.bbc (in the games directory) for example. That uses a fixed 'window' size of 640 x 500 but should scale to suit your display whatever its resolution. Is that working?
Last edited by Richard Russell on Sat Jan 04, 2020 2:18 pm, edited 1 time in total.

User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 2:15 pm

Just to say all the MODES ( from what I can see ) are resolutions that are landscape not portrait. e.g

22 128x48 1024x768 2048x1536 16
23 64x48 1024x768 2048x1536 16
24 144x54 1152x864 2304x1728 16
25 72x54 1152x864 2304x172

What do you do if your phone is a resolution 720x1280 ( portrait)?
I think holding/cupping a phone in portrait mode is a natural way to hold the phone not in landscape ( and least I find it difficult to hold a phone in landscape!). So that is why I am trying to do it in portrait....

User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 2:16 pm

Ok thanks I will try Lemmings and a few and get back to you.....thank you for all your perseverance.

User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 2:22 pm

Well Lemmings on the S8 is fine. Lemmings on the X70 ( on the right ) is a bit weird - but it is a cheapo £50 phone ....
I realise there are so many models of phones it is difficult to accommodate everything......but yes the S8 has stretched that properly.....
My image size for the gallery was output at 720x1280 so maybe I need to up that to higher or try a lower setting.....maybe that is the issue?
Attachments
IMG_1478 (1).jpg

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by Richard Russell » Sat Jan 04, 2020 2:25 pm

pixelblip wrote:
Sat Jan 04, 2020 2:15 pm
I think holding/cupping a phone in portrait mode is a natural way to hold the phone not in landscape ( and least I find it difficult to hold a phone in landscape!). So that is why I am trying to do it in portrait....
But surely the majority of your pictures are themselves in landscape format (traditionally that has been the case, before people with phones started shooting them in the wrong format!) so shrinking them down enough to fit across a portrait screen is going to look silly. It's what BBC BASIC should do automatically, as I said, but it doesn't make for a pleasant viewing experience!
Ok thanks I will try Lemmings and a few and get back to you.....thank you for all your perseverance.
I edited my post to suggest dibley.bbc instead, because in fact lemmings.bbc does respond to orientation changes.

User avatar
Richard Russell
Posts: 1668
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by Richard Russell » Sat Jan 04, 2020 2:30 pm

pixelblip wrote:
Sat Jan 04, 2020 2:22 pm
Lemmings on the X70 ( on the right ) is a bit weird - but it is a cheapo £50 phone
That's not right, and I'm sorry to say it's likely to be the phone at fault. There's no point continuing with your project if you want to display the results on the X70, there is unlilkely to be anything you can do to compensate for the faulty behaviour (and if you could, it would almost certainly make it fail on a 'working' device).

After your praise for my efforts in bringing BBC BASIC to Android, sadly I must advise you to abandon it. :(

User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 2:32 pm

You have a fair point. My pictures are in landscape format. I just do not like swiping through pictures holding a phone in Landscape mode. Tinder just isn't as quick! :lol:

User avatar
pixelblip
Posts: 2089
Joined: Wed Feb 04, 2015 7:19 pm
Location: London
Contact:

Re: BBC Basic for windows and Android - *DISPLAY and swiping

Post by pixelblip » Sat Jan 04, 2020 2:33 pm

I don't think I will abandon this. It is too interesting!

Post Reply

Return to “programming”