Skip to Content
avatar image
Former Member

SAP Design studio device recognition

Hi All,

We are building an application using SAP Design studio SP6. One of our requirements is to be able to hide a component (such as export button) depending on whether the person is looking at the dashboard via desktop or ipad.

Our application is built using responsive UI and all but do we have any examples of identifying users device on the fly?

Any inputs will be highly appreciated. Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Mar 23, 2017 at 01:33 AM

    Hi Alok,

    You could try using the APPLICATION.getUserAgent() script method which returns a string containing information such as Operating System and Browser, which could help you differentiate between device types. If this approach doesn't provide enough device information then I suggest you consider using the SDK Development Community Client Information Component which provides more detailed information.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 23, 2017 at 07:19 AM

    Hi Alok,

    Please go with "Mustafa's" Answer. I will provide you some example code which work for me.

    if (APPLICATION.getUserAgent().indexOf("Mobile") > 0) {
    // Your code here
    }
    else{
    // Your code here
    }

    Please let me know if your need more information.

    Regards,

    Vidhya.C

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 27, 2017 at 12:50 PM

    Thank you all. We are currently testing the suggestions. Will update the results to all here.

    Add comment
    10|10000 characters needed characters exceeded