The International Simutrans Forum

 

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

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1730
    • 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: 4897
  • 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: 4897
  • 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: 35
  • 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: 1730
    • 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: 4897
  • 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: 10818
  • 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: 35
  • 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: 10818
  • 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: 1730
    • 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: 35
  • 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: 10818
  • 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: 1730
    • 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: 35
  • 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: 10818
  • 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: 1730
    • 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: 35
  • 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: 1730
    • 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: 1730
    • 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: 35
  • 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: 10818
  • 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: 1730
    • 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: 35
  • 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...