Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android/iOS Best Practices
QtWS25 Last Chance

Android/iOS Best Practices

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
designandroidios
3 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pppgogogo
    wrote on 1 Aug 2016, 20:56 last edited by
    #1

    My apologies ahead of time if this is not the correct forum category to be posting in. I am tasked with getting designs together for an application that will be built on Qt and pushed to both platforms: Android and iOS. Specifically with this framework, I am struggling to find any best practices when approaching from the design side of things. Are the same principles that are outlined from each platform the same when approaching it with Qt or are there things to take into consideration when designing?

    The application will be on both tablets and phones, but in some examples I've seen, the phone version was just stretched to fit the tablet version. Ideally, an independent design for tablet/phones would be ideal. As you can tell by my questions, I am a bit new to this, but I want to make sure I am going about things correctly.

    Any advice is appreciated. Thanks in advance.

    D 1 Reply Last reply 2 Aug 2016, 13:14
    0
    • P pppgogogo
      1 Aug 2016, 20:56

      My apologies ahead of time if this is not the correct forum category to be posting in. I am tasked with getting designs together for an application that will be built on Qt and pushed to both platforms: Android and iOS. Specifically with this framework, I am struggling to find any best practices when approaching from the design side of things. Are the same principles that are outlined from each platform the same when approaching it with Qt or are there things to take into consideration when designing?

      The application will be on both tablets and phones, but in some examples I've seen, the phone version was just stretched to fit the tablet version. Ideally, an independent design for tablet/phones would be ideal. As you can tell by my questions, I am a bit new to this, but I want to make sure I am going about things correctly.

      Any advice is appreciated. Thanks in advance.

      D Offline
      D Offline
      DRoscoe
      wrote on 2 Aug 2016, 13:14 last edited by
      #2

      @pppgogogo We recently went through the same transition. We ported our Windows application to Linux and iOS. It's a steep curve.

      Learn and take advantage of the Qt Resource system. This will dramatically simplify management of your binary resources such as icon images, bitmaps and audio files. If done right, Qt will do most of the heavy lifting for you.

      Also, seriously consider using QML. If you want a tablet app that is more than just a stretched phone app, QML is gold. You can define your pages and adjust them automatically for the environment you are building for. Its based on JSON, so it should be easy to pick up. We use it to manage display nits between Windows/Linux and iOS. You can virtualize fonts and screen resolutions to match your platform and also deal with issue such as screen orientation. It will make your life much easier.

      There is no way around dealing with issues that are platform specific, such as bundle data for iOS (which does not exist for Windows) but the qmake build system via the .pro files gives you convenient ways of implementing the platform specific portions with predefined platform identifiers for example:

      ios {
        SETTINGS_BUNDLE_DATA_ROOT.files += $$PWD/Root.plist
        SETTINGS_BUNDLE_DATA_ROOT.path = Settings.bundle
        SETTINGS_BUNDLE_DATA_LANG.files += $$PWD/Root.strings
        SETTINGS_BUNDLE_DATA_LANG.path = Settings.bundle/en.lproj
      
        ios_icon.files += $$files($$PWD/ios/icons/*.png)
        launch_image.files += $$PWD/tap_display_launch_screen.xib \
                              $$files($$PWD/ios/launch-images/*.png)
        QMAKE_BUNDLE_DATA += SETTINGS_BUNDLE_DATA_ROOT  SETTINGS_BUNDLE_DATA_LANG \
                             ios_icon  launch_image
        QMAKE_INFO_PLIST = tap_display_app-Info.plist
        LIBS += -F /Library/Frameworks/UTCTIMAccess -framework "UTC TIM Access" \
                -framework ExternalAccessory \
                /usr/lib/libz.dylib /usr/lib/libxml2.dylib
      
        INCLUDEPATH += /Users/atoltest/Documents/UTAS_SDK/TIMRepositoryAccessHeader
      
        QMAKE_IOS_DEPLOYMENT_TARGET = 8.2
      }
      

      This portion of the .pro file is only invoked on iOS platforms setting up necessary bundle data for iOS but ignored for other platforms. The remainder of the script is identical on all platforms.

      Good luck!

      P 1 Reply Last reply 4 Aug 2016, 22:56
      3
      • D DRoscoe
        2 Aug 2016, 13:14

        @pppgogogo We recently went through the same transition. We ported our Windows application to Linux and iOS. It's a steep curve.

        Learn and take advantage of the Qt Resource system. This will dramatically simplify management of your binary resources such as icon images, bitmaps and audio files. If done right, Qt will do most of the heavy lifting for you.

        Also, seriously consider using QML. If you want a tablet app that is more than just a stretched phone app, QML is gold. You can define your pages and adjust them automatically for the environment you are building for. Its based on JSON, so it should be easy to pick up. We use it to manage display nits between Windows/Linux and iOS. You can virtualize fonts and screen resolutions to match your platform and also deal with issue such as screen orientation. It will make your life much easier.

        There is no way around dealing with issues that are platform specific, such as bundle data for iOS (which does not exist for Windows) but the qmake build system via the .pro files gives you convenient ways of implementing the platform specific portions with predefined platform identifiers for example:

        ios {
          SETTINGS_BUNDLE_DATA_ROOT.files += $$PWD/Root.plist
          SETTINGS_BUNDLE_DATA_ROOT.path = Settings.bundle
          SETTINGS_BUNDLE_DATA_LANG.files += $$PWD/Root.strings
          SETTINGS_BUNDLE_DATA_LANG.path = Settings.bundle/en.lproj
        
          ios_icon.files += $$files($$PWD/ios/icons/*.png)
          launch_image.files += $$PWD/tap_display_launch_screen.xib \
                                $$files($$PWD/ios/launch-images/*.png)
          QMAKE_BUNDLE_DATA += SETTINGS_BUNDLE_DATA_ROOT  SETTINGS_BUNDLE_DATA_LANG \
                               ios_icon  launch_image
          QMAKE_INFO_PLIST = tap_display_app-Info.plist
          LIBS += -F /Library/Frameworks/UTCTIMAccess -framework "UTC TIM Access" \
                  -framework ExternalAccessory \
                  /usr/lib/libz.dylib /usr/lib/libxml2.dylib
        
          INCLUDEPATH += /Users/atoltest/Documents/UTAS_SDK/TIMRepositoryAccessHeader
        
          QMAKE_IOS_DEPLOYMENT_TARGET = 8.2
        }
        

        This portion of the .pro file is only invoked on iOS platforms setting up necessary bundle data for iOS but ignored for other platforms. The remainder of the script is identical on all platforms.

        Good luck!

        P Offline
        P Offline
        pppgogogo
        wrote on 4 Aug 2016, 22:56 last edited by
        #3

        @DRoscoe Thanks so much, I really appreciate you taking time to respond!

        1 Reply Last reply
        0

        3/3

        4 Aug 2016, 22:56

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved