The International Simutrans Forum

 

Author Topic: Github action workflow for android nightly build  (Read 7704 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #35 on: September 09, 2021, 08:29:35 PM »
--

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4933
  • Languages: EN, DE, AT
Re: Github action workflow for android nightly build
« Reply #36 on: September 10, 2021, 07:40:11 AM »
@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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4933
  • Languages: EN, DE, AT
Re: Github action workflow for android nightly build
« Reply #37 on: September 10, 2021, 07:56:42 AM »
submitted the fluidsynth patch in r10084.

Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #38 on: September 10, 2021, 08:24:07 PM »
@Dwachs
As instructed, the attached patch (applicable to r10084) has switched to cbuffer_t.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #39 on: September 11, 2021, 12:40:26 AM »
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? .

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4933
  • Languages: EN, DE, AT
Re: Github action workflow for android nightly build
« Reply #40 on: September 11, 2021, 07:17:12 AM »
submitted the logging-patch in r10085.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: Github action workflow for android nightly build
« Reply #41 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

Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #42 on: September 11, 2021, 03:03:48 PM »
@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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: Github action workflow for android nightly build
« Reply #43 on: September 11, 2021, 03:07:26 PM »
Since windows also trnslates pinch to scroll wheel events, also SDL2 will behave the same ... i.e. scrolling in lists with pinch.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #44 on: September 11, 2021, 05:02:57 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.  ::'(   


@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 
« Last Edit: September 11, 2021, 06:08:39 PM by Yona-TYT »

Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #45 on: September 11, 2021, 10:36:17 PM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: Github action workflow for android nightly build
« Reply #46 on: September 12, 2021, 12:52:00 AM »
Thanks, submitted. in r10092.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #47 on: September 13, 2021, 10:59:14 AM »
For some reason it no longer works on my device, it closes right after stop loading.

Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #48 on: September 13, 2021, 11:26:53 AM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: Github action workflow for android nightly build
« Reply #49 on: September 14, 2021, 01:20:39 AM »
Commited, thank you

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #50 on: September 15, 2021, 05:02:56 AM »
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:

Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #51 on: September 15, 2021, 06:16:48 AM »
@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.


Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #52 on: September 15, 2021, 06:24:35 AM »
- What is the model of your device?

Alcatel one 5033E.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #53 on: September 15, 2021, 06:31:27 AM »
screen: 5" 18:9

Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #54 on: September 15, 2021, 09:08:17 AM »
@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.


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: Github action workflow for android nightly build
« Reply #55 on: September 15, 2021, 01:43:10 PM »
480 is a little bit too low to display most dialogues. So maybe oversize resolution to 1200x600

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #56 on: September 15, 2021, 03:02:40 PM »
I'm not sure if "-screensize" is taking effect, as I can't tell the difference.

Code: [Select]
-screensize 1200x600

Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #57 on: September 15, 2021, 05:36:45 PM »
@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...

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #58 on: September 24, 2021, 02:12:47 PM »
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.

Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #59 on: September 27, 2021, 01:13:04 PM »
@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

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #60 on: September 27, 2021, 04:01:38 PM »
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.
And what would happen with "Zoom in and out with two fingers", or are they different touch gestures? .

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: Github action workflow for android nightly build
« Reply #61 on: September 28, 2021, 01:53:43 AM »
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 ... )

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #62 on: September 28, 2021, 02:05:50 AM »
@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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: Github action workflow for android nightly build
« Reply #63 on: September 30, 2021, 01:42:28 AM »
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
« Last Edit: September 30, 2021, 01:55:06 AM by prissi »

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #64 on: September 30, 2021, 08:22:09 PM »
There is a little problem here, I can't go back to the previous window if I accidentally hit the install pakset button.


Offline krosk

  • *
  • Posts: 38
  • Languages: EN,FR,ZH
Re: Github action workflow for android nightly build
« Reply #65 on: September 30, 2021, 08:48:43 PM »
@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.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #66 on: September 30, 2021, 08:54:32 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. ;)

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #67 on: September 30, 2021, 08:57:56 PM »
I have a problem with the on-screen keyboard, it unfolds for no reason at startup.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10979
  • Languages: De,EN,JP
Re: Github action workflow for android nightly build
« Reply #68 on: October 01, 2021, 01:22:59 AM »
Test the fingerhandling in r10125. It should no longer generate spurious event when using three finger scrolling. (However, I have no test device currently.)

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1795
    • Simutrans-BLOG
  • Languages: ES
Re: Github action workflow for android nightly build
« Reply #69 on: October 04, 2021, 02:46:49 PM »
With SDL2 Is it possible to have on-screen keyboard support on Android? .