News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Github action workflow for android nightly build

Started by krosk, August 17, 2021, 08:12:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Dwachs

Quote from: krosk on August 25, 2021, 09:54:51 PM
@prissi, additional patch, that ties in-game logging to Android logcat. Android redirects stdout and stderr to /dev/null, and introduces different logging functions for logcat, The patch below applicable to r10049 makes use of them. For those who want to capture the logs, add the command line parameters -debug x at the beginning (SDL config), and capture logs via adb logcat -s com.simutrans.
This patch could use cbuffer_t to get rid of fixed size char buffers. Then it could be included.
Parsley, sage, rosemary, and maggikraut.

Dwachs

Parsley, sage, rosemary, and maggikraut.

krosk

@Dwachs
As instructed, the attached patch (applicable to r10084) has switched to cbuffer_t.

Yona-TYT

I am very happy with this project!

There is something very important that I think we are overlooking.

Zoom in and out with two fingers, and it is that inplementing this in android would greatly improve the playability on touch screens. :C


It would be a shame if we don't have this in the first official version released for android.

What do you think of this friends? .

Dwachs

Parsley, sage, rosemary, and maggikraut.

prissi

The zoom gesture is only supported with SDL2 ... And then it was not working. I submitted something that makes SDL2 useful with finger on my touchscreen under window in r10087/10088

krosk

@Yona-TYT
Libsdl android has a handy feature which is able to map pinch gestures to a command.
In this case, I mapped the pinch gestures to emulate mouse wheel, which achieves map zoom in/out via pinch.
However this is not an optimal fix; for example mouse wheel also controls list scrolling, and pinching a list will make it scroll up/down; definitely an incorrect behavior.
Nonetheless, I will submit the patch later since the pros are bigger than the cons.

@prissi
Good news; I make it a goal to move the android port to SDL 2, so it will benefit from native touch support with SDL2 from other platforms.

prissi

Since windows also trnslates pinch to scroll wheel events, also SDL2 will behave the same ... i.e. scrolling in lists with pinch.

Yona-TYT

#44
 
Quote from: prissi on September 11, 2021, 02:47:15 PM
The zoom gesture is only supported with SDL2 ... And then it was not working. I submitted something that makes SDL2 useful with finger on my touchscreen under window in r10087/10088
Thank you very much, I will try as soon as it is available.  :D
Edit.
Ah wait! ... :police: :police: :police:  This is just SDL2, and the android version is not ported yet, therefore it is not possible for me to test.  ::'(   


Quote from: krosk on September 11, 2021, 03:03:48 PM@prissi Good news; I make it a goal to move the android port to SDL 2, so it will benefit from native touch support with SDL2 from other platforms.
This is great! I'm happy to hear this!.  ;D 

krosk

Patch applicable to r10089.

This patch configures libsdl-android to map pinching touch events to mouse wheel (they were previously mapped to keyboard + and keyboard -); the cfg file change is on the libsdl-android repo fork.

prissi


Yona-TYT

For some reason it no longer works on my device, it closes right after stop loading.

krosk

Patch applicable to r10103.

The github actions pipeline is again silently passing upon failure to download the soundfont (occasional 502 Bad Gateway reported by wget, https://github.com/aburch/simutrans/runs/3583126278?check_suite_focus=true#step:14:25170), which broke the apk reported by @Yona-TYT.
Previous patch was not exhaustive enough, so this one will retry for any reason except success and ensure build failure upon any error.


Additionally, as a bonus background work, the libsdl-android now downloads prebuilt openssl binaries, which should reduce building time by 10 minutes.

prissi


Yona-TYT

Well the above problem seems to be fixed.

Now I have a new problem, this time with the resolution of the screen, before it looked better on my device, now it does not allow me to do anything.   :-[
Look at the image as it looks:

krosk

@Yona-TYT
- What is the model of your device? This will let me know about your device native resolution and screen size for reference, to check if code behavior is expected.
- On the SDL prompt at the start on top of the screen there is a button "Change device configuration". Click on it, then on "Command line parameters, one argument per line":
  * if you remove the line "-autodpi", it will switch to the native resolution with the correct aspect ratio.
  * If the above is too small, you can customize resolution by typing "-screensize" in one line, and "800x600" in the next line; change the numbers for the resolution you want to have. Let me know also which resolution looks nice.




krosk

@Yona-TYT
I had a look; your device native resolution is 960x480.
So removing the -autodpi argument in the command line options should be fine for you, even without setting a screensize. The resolution is low enough to display a big enough UI.


prissi

480 is a little bit too low to display most dialogues. So maybe oversize resolution to 1200x600

Yona-TYT

I'm not sure if "-screensize" is taking effect, as I can't tell the difference.

-screensize 1200x600

krosk

@Yona-TYT,
you need to write it on two separate lines:

-screensize
1200x600

Try it, but I think it won't work because it is above your smartphone resolution...

Yona-TYT

I have a gambling problem using a tool other than inspection.

The problem is that I cannot scroll the map while selecting a tool so I have to switch to inspection and this is very tedious.


I would like us to have a small box in the upper right corner that when dragging the cursor allows you to move around the map, no matter what tool is used.

krosk

@Yona-TYT
Point taken. Some other options exist to handle this, like drag the map with two fingers when a tool is enabled, etc. It is a matter of implementation I suppose.

@prissi
The attached patch, applicable to r10121, is:
- SDL2 (version 2.0.13) for Android
- An adjustment of the target DPI on mobile devices. 96 for computer screens (retina screens) is OK, for mobile devices it is too big; I put 192 for now. But now the game should be adaptative to each device screens.

99% of the work behind this patch is on my fork of pelya repository. https://github.com/krosk/commandergenius/tree/sdl2_android_prebuilt_2

Yona-TYT

Quote from: krosk on September 27, 2021, 01:13:04 PMPoint taken. Some other options exist to handle this, like drag the map with two fingers when a tool is enabled, etc. It is a matter of implementation I suppose.
And what would happen with "Zoom in and out with two fingers", or are they different touch gestures? .

prissi

You could also open the minimap without all the buttons and zoom in and use it as some kind of touchpad together with the tools. Also SDL2 opens up the possibility of using own gestures like three finder scrolling ...

@Krosk And thank you very much for this highly appreciated work. Incorporated in r10122.

Looking at the commits, I see that debug builds are the default. I wonder if this makes sense for most of the users might never see the debug messages on a smartphone and debug builds eat quite a lot more ram and CPU. (They also usually never look at them on the PC either ... )

Yona-TYT

@prissi, I see 2 drawbacks with using the minimap:

1- The displacement is opposite to that of the general map, that makes it confusing to move with it.

2- It is not good for practical uses since you have to be opening and closing the window, not to mention that the drag area changes in size depending on the zoom or the size of the map.

Hence my idea of a small drag area fixed in a corner where it does not obstruct visually, also you can use transparency to make it less of a visual obstruction.

prissi

#63
For the different scroll direction in the minimap, you should switch off the inverse scrolling. For some reason it is the default in pak128, and since no other pakset set it explicitely, it stay default later on. Go to setting display and the inverse scrolling.

But as said, not three finger dragging as default option would be possible too. Please test r10123

Yona-TYT

There is a little problem here, I can't go back to the previous window if I accidentally hit the install pakset button.


krosk

@prissi
(I will disable the debug in my next patch; it was enabled for development convenience reasons...)
I tested the 3 fingers drag and dropping. When 3 fingers touch the screen, the scrolling works. But the number of fingers will naturally decrease from 3 to 2, from 2 to 1 as we drag the map. If a tool/building is selected, there will be a very short moment when only 1 finger touches the screen and the tool will activate (and build).
I don't have better suggestions at this time for enabling both a tool and a scrolling.

@Yona-TYT
Indeed, a cancel button would be welcome here.

Yona-TYT

Quote from: krosk on September 30, 2021, 08:48:43 PM@Yona-TYT
Indeed, a cancel button would be welcome here
It would also be good if the arrow button (back) of the android system did not return until the first window. ;)

Yona-TYT

I have a problem with the on-screen keyboard, it unfolds for no reason at startup.

prissi

Test the fingerhandling in r10125. It should no longer generate spurious event when using three finger scrolling. (However, I have no test device currently.)

Yona-TYT

With SDL2 Is it possible to have on-screen keyboard support on Android? .