Power Apps Exchange

Please login or click SIGN UP FOR FREE to create your PowerAppsUG account to join this user group.
Expand all | Collapse all

Not a mobile app warning

  • 1.  Not a mobile app warning

    Silver Contributor
    Posted Jun 02, 2020 08:54 AM

    I have a Canvas app in Tablet layout and a user reported that it doesn't render well on Mobile. It wasn't intended for this purpose and I've added a message to deter users but TBH, trying to get a simple screen+label to display sensibly was a bit of a nightmare. There are multiple mobile formats also and I's like to display the message suitably centered for any mobile users.

    Has anyone come up with a simple solution?

    I thought App.Height, App.Width would be that but it doesn't work for me

    Thanks



    ------------------------------
    Bill Young
    Power Apps Support
    ------------------------------


  • 2.  RE: Not a mobile app warning

    Top Contributor
    Posted Jun 02, 2020 08:53 PM
    Hi Bill,
    You can check a couple of things unique to mobile devices - I run this at App OnStart as I have deep linked apps and need to force-launch them in the app rather than a browser.
    Set(
       vMobile,
       Location.Altitude > 0 || 
       Acceleration.X > 0
    )​


    ------------------------------
    Warren Belz
    Queensland Australia
    ------------------------------



  • 3.  RE: Not a mobile app warning

    Silver Contributor
    Posted Jun 03, 2020 01:55 AM
    Hi Warren
    Thanks again for your reply
    Sorry but I didn't explain my problem very well

    I've identified the mobile experience but am having trouble displaying a screen and message which looks good on all formats

    At the moment, I've only got a HTMLText box with:
    "<div style='margin: auto;text-align:center;font-size:24px;color:white;margin:10px;position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(-90deg);'><strong><p>AppName</p>
    <p>This App is not suitable for use via a mobile phone.</p>
    <p>Please open the App on your tablet or laptop</strong></p></div>"

    I was hoping that someone has already worked out a ubiquitous solution
    Cheers

    ------------------------------
    Bill Young
    Power Apps Support
    ------------------------------



  • 4.  RE: Not a mobile app warning

    Top Contributor
    Posted Jun 03, 2020 02:17 AM
    Hi Bill,
    As it would only display on mobile devices, I would probably to a pop-up label in the middle of the screen with a transparent full-screen background (RGBA 128,128,128,0.5) and a close button.

    ------------------------------
    Warren Belz
    Queensland Australia
    ------------------------------



  • 5.  RE: Not a mobile app warning

    Silver Contributor
    Posted Jun 03, 2020 10:21 AM
    Hi Warren
    Thanks again for the response
    perhaps I'm overcomplicating this but it's the "in the middle of the screen" that I had trouble with and ended up with a similar label of width 629px x height: 319px
    This looks fine on my mobile but I'm concerned about the other form factors
    Have I, perhaps,got the wrong end of this stick?

    Cheers
    Bill

    ------------------------------
    Bill Young
    Power Apps Support
    ------------------------------



  • 6.  RE: Not a mobile app warning

    Silver Contributor
    Posted Jun 05, 2020 03:40 AM
    Edited by Bill Young Jun 05, 2020 03:39 AM

    Hi Warren
    Thanks for the suggestion to Center align a label
    Although this looks like it should work, it doesn't, I think because its getting its directions from the screen size, so perhaps I need a specific Mobile Screen and navigate there
    Your suggestions are great, though! :)

    I wonder when we'll be able to build fully responsive apps?

    Cheers
    Bill



    ------------------------------
    Bill Young
    Power Apps Support
    ------------------------------



  • 7.  RE: Not a mobile app warning

    Posted Jun 08, 2020 04:03 AM
    Hi Bill,

    I have a fully responsive app. The way I did it (and I am not sure if this is the best way) was:

         -> On App start:
                  - Set (varWidth,App.Width)
                  - Set (varHeight,App.Height)
                  - Set (varOrientation, If(varWidth >= varHeight, "Landscape","Portrait"))
                  - Set (varDevice, If(varWidth <= 700 ,"Phone", varWidth >700 && <= 1500, "Tablet", varWidth > 1500, "Desktop"))
                  - Set (varTextSize, Switch(varDevice, "Phone", 12, "Tablet", 15, "Desktop",18))

    Then it is just the case to reference your variables on your inputs. If you want the label to be centralized, on "X" you add varWidth/2-label.width/2 and on "Y" varHeight/2-label.height/2.

    This way does not matter the screen size, it will always be at the centre of the screen. Like I said, I do not know if this is the best practice, but so far it is working....hehehe

    Regards,

    ------------------------------
    Christiano Landgraf
    +447495544135
    ------------------------------



  • 8.  RE: Not a mobile app warning

    Silver Contributor
    Posted Jun 09, 2020 11:46 AM
    Thanks Christiano
    That's sounds great :)
    I haven't had the chance to test this yet but will post back with my findings

    Thanks for the feedback
    Cheers
    Bill


    ------------------------------
    Bill Young
    Power Apps Support
    ------------------------------