Android/iOS Best Practices

  • 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.

  • @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 \
                           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

    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!

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

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.