Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Map on Android has very small text

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #20742

    Julian

    Hello,

    I have the issue (Felgo 2.16.1 – 2.18.2), that on Android all text (like street names, etc.) in a map are very small.

    I figured out that, if I set:

    <meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/>

    In AndroidManifest.xml the scaling of the text is correct, unfortunately the NavigationBar is now double the size it should be.

    Does anybody has the same issue? I wonder, how no one saw that.

    Best,

    Julian

    #20743

    Julian
    #20757

    Julian

    Any news here?

    #20760

    Günther
    Felgo Team

    Hi Julian,

    you do not require the

    <meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/>
    

    setting in AndroidManifest, as this can lead to wrong scaling as seen with the NavigationBar.

     

    About the Map issue:

    • Which device(s) are you using for testing and what is their Android OS version?
    • Which map provider are you using for the map?

    Note: The MapBox provider also allows a highdpi_tiles setting, are you using this setting?

    AppMap {
            id: map
            anchors.fill: parent
    
            plugin: Plugin {
              name: "mapbox"
              // configure your own map_id and access_token here
              parameters: [  PluginParameter {
                  name: "mapbox.mapping.map_id"
                  value: "mapbox.streets"
                },
                PluginParameter {
                  name: "mapbox.access_token"
                  value: "pk.eyJ1IjoiZ3R2cGxheSIsImEiOiJjaWZ0Y2pkM2cwMXZqdWVsenJhcGZ3ZDl5In0.6xMVtyc0CkYNYup76iMVNQ"
                },
                PluginParameter {
                  name: "mapbox.mapping.highdpi_tiles"
                  value: true
                }]
            }
    }

    Best,
    Günther

     

     

    #20761

    Julian

    Hey Günther,

    thanks for your reply. I tried osm, mapbox, and mapboxgl. All with the same result. To show the issue even better I just took the Felgo Showcase app, run it as Desktop application, where everything is fine:

    https://www.dropbox.com/s/y06brgi61a37yhj/Screen%20Shot%202018-12-17%20at%2019.15.26.png?dl=0

    And ran it in Android emulator, where the text is super small:

    https://www.dropbox.com/s/q0k844920zjy398/Screen%20Shot%202018-12-17%20at%2019.23.35.png?dl=0

    Here are some details about my env if it helps:

    macOS 10.13.6

    NDK: android-ndk-16b

    SDK: Android build platform: android-27

    Emulator: Pixel_2_XL_API_27 (ABI: x86, Target: Android 8.1 (Google APIs))

    This also happens on a Huawei P20 Pro.

    Can you reproduce it with the Showcase app?

    Best regards,

    Julian

    #20766

    Günther
    Felgo Team

    Hi Julian,
    thanks for the follow-up!

    I am able to reproduce the problem – I’ve added the issue to our bug-tracker for further investigation.

    As a workaround, you can apply additional scaling based on the screen density on Android like this:

          AppMap {
            id: map
            anchors.fill: parent
    
            // fix map scaling on android
            scale: Theme.isAndroid ? dp(1) : 1
    
            
            plugin: Plugin {
              name: "mapbox"
              // configure your own map_id and access_token here
              parameters: [  PluginParameter {
                  name: "mapbox.mapping.map_id"
                  value: "mapbox.streets"
                },
                PluginParameter {
                  name: "mapbox.access_token"
                  value: "pk.eyJ1IjoiZ3R2cGxheSIsImEiOiJjaWZ0Y2pkM2cwMXZqdWVsenJhcGZ3ZDl5In0.6xMVtyc0CkYNYup76iMVNQ"
                },
                PluginParameter {
                  name: "mapbox.mapping.highdpi_tiles"
                  value: true
                }]
            }
    }

    Note: The scale setting on AppMap also applies to e.g. custom MapQuickItem objects you place on the map. To not scale them along with the actual map, you can reverse the scale for these items:

    MapQuickItem {
                // reverse scale for correct sizing
                scale: 1 / map.scale
    
               // other configurations
    }

    Best,
    Günther from Felgo

    #20778

    Julian

    Hey Günther,

    thanks for you reply. That indeed worked around the problem. Just for future readers, instead of using anchors.fill: parent I had to apply some math:

    -        anchors.fill: parent
    +
    +        // reverse scale for correct sizing
    +        anchors.bottom: parent.bottom
    +        anchors.left: parent.left
    +        anchors.bottomMargin: (page.height - (page.height / map.scale)) / 2.0
    +        anchors.leftMargin: (page.width - (page.width / map.scale)) / 2.0
    +        width: page.width / map.scale
    +        height: page.height / map.scale

     

    Otherwise the map is over- or underflowing the parent.

     

    Best,

    Julian

    #21748

    Micu

    Any news for this bug?

    #22146

    Micu
    #22161

    Alex
    Felgo Team

    Hi Micu,

    does applying a manual scale to the map on Android not work for you?

    Cheers,
    Alex

    #22384

    Micu

    Hi Alex,

    Thanks for your answer!

     

    does applying a manual scale to the map on Android not work for you

    Not really, unfortunately. Well, if I choose the solution suggested above, it does make the fonts have the right size on Android.

    But

    a) the gestures on the maps are clunky then (pinch and zoom, panning etc.),

    b) the upscaling is pixel based, i.e. the map looks pixelated,

    c) and, after all, this solution is a hack.

    If I use auto_screen_scale_factor everything works perfectly — except for the issue mentioned by Julian of the navigation bar having twice its height then (on some devices, not on all though BTW).

    Is there a way to fix the navigation bar size issue?

    Or is there another way to mitigate the font size issue?

     

    Any help would be highly appreciated.

    Cheers,

    micu

    #22568

    Micu

    Hi folks,

    Still no news on that front?

    If I try out the FELGO demo applications using maps and if I look at the attached screenshots https://felgo.com/doc/felgo-appdemos-maps-example/, it seems to me that the problem is not just local to our app, but present in every FELGO application.

    With FELGO apparently wanting to become the goto Qt for mobile solution, and maps being a pivotal feature for mobile applications, I am a bit perplexed that this issue does not take a higher priority, as it renders the map more or less unusable on Android.

    #23812

    Micu
Viewing 13 posts - 1 through 13 (of 13 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded