Archives For BB 10, Cascades

Development and Apps for BlackBerry 10 – native APP’s written with Cascades and C++

eclipsecon Europe 2016, Ludwigsburg, Germany

Soon available at the stores:

(can take up to 24 hours)

Android 4.3 or greater for Phones and Tablets from Google Play Store:

google-play-badge

or download the APK from here if you prefer sideloading:

itunesartwork-512x512

iOS 8.2 or greater for iPhone or iPads from Apple App Store:

just approved 2016-10-25 16:27 – can take a moment to be visible in App Store

app_Store_Badge

Amazon Fire OS or BlackBerry10 on Amazon App Store:

amazonappsbadge

Sorry – not enough time yet to also develop a native BlackBerry 10 App – hopefully for the next conference. Native BlackBerry 10 Cascades App loads faster and runs smoother on BlackBerry 10.

Also working on Windows 10 Mobile – runs in development mode on Lumia and others – haven’t finished the work to upload release to windows store yet.

You probably know that last years I always developed the BlackBerry 10 App for Eclipse Conferences. This year first I did it for Android and iOS using Qt 5.7 and brandnew Qt Quick Controls 2. Used Qt Quick Controls 2 and Google Material Style. To make my work easier, Entities (Session, Speaker, Track, Room, Conference, …) are generated using a Xtext / Xtend DSL. Started this DSL 2 years ago for BlackBerry 10 Cascades / Qt 4.8 and now I’m able also to generate code for Qt 5.7 / Qt Quick Controls 2. Hopefully at the end of year mobaDSL will be available Open Source.

Want to know more about HowTo develop Apps using Qt 5.7 for Android, iOS and Windows 10 ? The Sourcecode of my Qt World Summit Conference App is available at Github: https://github.com/ekke/c2gQtWS_x

Here some screenshots of eclipsecon Europe Conference App.

01_home

Schedule

02_schedule

Speakers

03_speaker

Session Detail

04_session_detail

Drawer

o5_drawer

xxx

Qt World Summit App at the App Stores

Android 4.3 or greater for Phones and Tablets from Google Play Store:

google-play-badge

iOS 8.2 or greater for iPhone or iPads from Apple App Store:

app_Store_Badge

Amazon Fire OS or BlackBerry10 on Amazon App Store:

amazonappsbadge

Windows Store:

english_get_it_win_10_864x312

Sourcecode at Github: https://github.com/ekke/c2gQtWS_x

Some Screenshots

01_home

Schedule:

02_schedule

Speakers:

03_speaker

Session Detail

04_session_detail

Floorplan on PixelC Tablet:

screenshot_20161014-124231

xxx

this article is work-in-progress

QtConAppIcon-180x180

Overview

This is part 8 of a series of  apps helping you to understand Qt 5.7 for x-platform development on Android and iOS. This app is not a Demo App – it’s a real life APP I developed for QtCon 2016 in Berlin. Please read the blogs about my other Examples to understand the concepts and patterns I’m using:

  1. First app with One Page
  2. StackView
  3. SwipeView
  4. TabBar
  5. Bottom Navigation
  6. Drawer Navigation
  7. Business Data APP

Download QtCon 2016 Conference App

The App is available at Google Play Store for Android Devices and from Apple Apptore for iPhones. Also work has started to provide a Windows 10 Mobile App.

google-play-badge

You don’t have a Google Account and want to side-load the App ? Here’s the APK – Download – Link.

 

app_Store_Badge

Out of the Developer Trenches

This blog will give you some insights and explain some parts of the code.

I’ll also speak at Qt World Summit about my experiences while developing this app and show what happens behind the scenes.

Here’s a short overview what I’m using to create the UI of my Qt 5.7 – QtQuickControls2 Business Apps:

qt-app

There are also StackViews on top of a single Page from SwipeView:

Conference Schedule is a SwipeView, each Day is a Page with ListView for all Sessions of the Day. From the List you can open SessionDetailPage (pushing on Stack) and so on.

Drawer and Bottom Bar Navigation

Main Navigation is done by a Drawer.

qtcon_android_02_drawer

Now Google Material Style also supports Bottom Navigation I added a Bottom Navigation Bar to make it easier to navigate. To get the Drawer opened you must swipe from the left site or tap on the Menu Button on Top Left. The Menu Button on Top Left isn’t always visible: if pushing Pages on a Stack, the Button is replaced by a Back Arrow to navigate back – so in this case you must use the gesture from left side. Not so easy if you have a large display size or like to use your phone with one hand. The Bottom Navigation Bar enables you to go through the Pages faster without moving fingers a long distance.

qtcon_android_01_home__

There are buttons for Home, Schedule, Speaker and Tracks inside the Bottom Navigation Bar. You can reach these Buttons easy. There’s also a Menu Button (Hamburger) at Bottom Left position. This Button is always visible, which means you can easy switch between different parts of the App even if there are some Pages on the Stack.

The Bottom Navigation Bar is only visible in Portrait Mode – in Landscape it would eat too much space from available height.

Now there are two Hamburger Menus in Portrait and perhaps you don’t like to have the Menu Button at the bottom ?

No problem – you can customize this. GoTo Settings and select the way you like to navigate.

  • Classic Material Navigation Style ( only the Drawer is used to navigate)
  • Bottom Navigation (Bottom Navigation Bar without Menu Button in Portrait)
  • Comfort (One Hand Use) Navigation (Menu Button in Bottom Navigation Bar)
  • Use only One Menu Button (In Portrait there’s no Menu Button in Title Bar, only in Bottom Navigation

I implemented these options to demonstrate how easy it is to customize your QuickControls2 Apps.

BTW: Coming from BlackBerry 10 Cascades ? Then you already know about the Menu Button at Bottom left. So using Bottom Navigation with Menu Button there could also help to get same Navigation Workflow on different platforms. Will help you if developing Enterprise Business Apps as I’m doing.

Speed Stack Navigation

Sometimes you pushed some Pages on top of a StackView. per ex. Schedule -> Session Detail -> Speaker Detail -> Room Info.

To push Pages on stack you tapped on Buttons to navigate “forward” to the next detail you’r interested in.

To go back to the Schedule – Sessions List you must tap on the Back Button multiple times. On Android you can also use the OS Back Button at Bottom Left, but on iOS you always have to move your finger to Top Left Back Button.

To speed up this kind of Navigation I implemented “Speed Stack Navigation”: the FAB (Floating Action Button) is used to navigate back: with one Tap you jump back to the last used List below. The FAB is always at Bottom Right position so always reachable even with one-hand-use.

Here’s an example from Session Details Page:

qtcon_android_05_session_detail_b

Themes and Colors

From Settings page you can also customize the Colors and dark / light theme:

qtcon_android_10_settings_

here are screenshots using a dark theme:

qtcon_android_10_settings_dark_

qtcon_android_10_settings_dark_schedule

Dynamic Loading

There are many StackViews, SwipeViews, Pages, ListViews …

To provide a performant App it’s a good think to think about dynamic creation of Components. QtCon Conference App uses many Loaders. A Loader is only a placeholder and you must set the ‘active’ property to start Object creation.

Inspired by BlackBerry 10 Cascades TabbedPane delegateActivationPolicy I have implemented different Activation Policies:

  • Immediately
  • Lazy
  • When Active

Immediately means that the Loader is active from beginning and will remain until the end. This is used for HomePage – the first page a user will see.

Lazy means the first time a user wants to see this Page, the Loader will become active and then wil remain.

When Active means the Loader will only be active as long as the Page is in use. Closing the page will set the Loader to inactive and the Controls will be destroyed.

But that’s not the complete story – to speed up the Startup Time I’m doing it this way:

C++ classes like DataManager, DataServer, DataUtil are only created at startup – no init() is done – so it’s really fast.

In QML no Drawer and Bottom Navigation is created, because I don’t set a model. The initial Item of the root StackView (used by Drawer) is a special Page only containing a Busy Indicator:

qtcon_android_00_startup_progress

As soon as this initial Page is created I start a Timer with 300 ms delay and from the Timer I’m calling all the C++ init() methods, all the data was read from cache and if all is done I’m setting the Drawer model. Now the Pages with Immediate – Activation – Policy are created and I’m swapping the initial Page and the Home Page is visible to the user.

In most cases the Busy Indicator will only be visible for some ms.

Caching and Data Binding

For this App I’m using a JSON File Cache.

A Conference App displays Sessions, Speaker, Rooms and this kind of data was read from Cache and QObject* are created – so the complete data was in-memory for fast access.

This data wasn’t changed from normal app – use. The only data a user enters is setting favorite Sessions to create the Personal Schedule. To avoid saving all the Sessions, I’m using an extra Class to store the ID’s of Sessions marked as Favorite. Caching this as JSON will only write a File with some Bytes.

At startup I’m looping through the Favorites and set a Property for these Sessions, so in Lists and Pages I’m getting the Favorite info directly from Session Class. This Property is a transient Property for Sessions.

Closing the App or sending to background I’m looping through the Sessions and create the Favorites. Then this small file was written to cache.

Using QObject* DataBinding to QML UI is easy – most difficult part is creating all the code for Q_PROPERTY. This is done by a Code Generator – all these C++ Classes you’ll find under src/gen. This Code Generator is based on Eclipse Xtext and I’m generating different Code for BlackBerry10 / Qt 4.8 and Qt 5.7 Android/iOS. The CodeGenerator will be Open Source – expect this by the end of 2016.

Caching and Data Binding is a complex story – will blog in an extra article about this.

Screenshots

Find some more Screenshots from the Conference App below.

Some Screenshots are outdated – per ex. the Icons to swap between Personal Schedule and Conference Schedule were changed because of Beta testers Feedback.

Stay tuned for more blog articles and videos explaining patterns and concepts.

There’s an Option Menu available at Startpage. All these Options are also part of the Drawer, but to help users first time using a Drawer I placed this Options Menu to get easy access to Help and Settings.

qtcon_android_01_home__options

QtCon Conference App works in Portrait and Landscape. There are some situations where rotating back from Landscape to Portrait doesn’t work as expected. Will report this and more via Bugreports.

qtcon_android_01_home_landscape

Conference Schedule is a SwipeView with pages for each Conference Day. The List of Sessions of a Day can be long, so there’s a ‘GoTo’ Button to jump to a specific Time Slot.

qtcon_android_03_schedule_

TimePicker is a customized UI Control I created with some help from Mitch Curtis.

Use this TimePicker to jump to Sessions starting at a specific time:

qtcon_android_03_schedule_timepicker

Personal Schedule (lists only marked Sessions). Easy toggling between Personal and Conference Schedule

qtcon_android_04_my_schedule

Session Details:

qtcon_android_05_session_detail_a

Room Floorplan – you can Zoom-In / Zoom-Out or Fit-To-Window:

qtcon_android_05_session_room_

List of Speakers:

qtcon_android_06_speaker_list

GoTo Speaker where Name starts with a specific Letter:

qtcon_android_06_speaker_picker

Speaker details

qtcon_android_07_speaker_detail

List of Tracks – in the meantime Tracks are colored to match UI from Web Browser.

qtcon_android_08_tracks_list

Sessions per Track

qtcon_android_08_tracks_sessions

Venue Info

qtcon_android_09_venue_

Venue Rooms List. Tap on a Room to see all Sessions or on the Thumbnail to see the Floorplan.

qtcon_android_09_venue_room_list

Sessions per Room

qtcon_android_09_venue_room_sessions

Help Page

qtcon_android_11_help

About Page

qtcon_android_12_about

 

Sources

This Application is Open Source and available at Github: https://github.com/ekke/c2gQtCon

Bugreports

As a good Open Source Project Citizen I always report Bugs and Requests.

Here are some of the Bugs I ran into while developing this APP:

TBD

Summary

I’m waiting for Feedback from QtCon in Berlin to see what could be done better.

Next Conference App will be for Qt World Summit 2016 in San Francisco.

My personal wishlist for upcoming Qt Conference Apps:

  • Integration with Twitter, Browser, Map
  • Having Bookmarks and Favorites
  • Personal Schedule Collision Detection
  • From Session –> what’s running at Same Time
  • Fulltext Search for Sessions and Speakers
  • Update from Conference Schedule via Push
  • Update Info (what’s new, removed, timeslots-rooms changed …
  • Better Highlighting of List rows
  • List of Sponsors
  • Shortcuts for BlackBerry PRIV
  • Jump to NOW while Conference running
  • Remove short Flicker at Android Startup
  • Pinch && Zoom Overview as I did for Cascades
  • TimePicker with AM PM support
  • TimePicker better resizing small screens
  • Translate into more languages
  • Support of Android Tablets and iPads

Stay tuned for more Apps – next one will be for Qt World Summit 2016 in San Francisco.

qtws16


← Back (Business Data APP)

→ Next Article (Qt World Summit Conference APP-TBD-)

⇐ Home (Overview / Topics)

This blog is part of my blog series about Business Apps.

—work in progress / stay tuned / will tweet @ekkescorner

intermarkt_thielen

Overview Goods Receipt APP

icon_144

Goods Receipt APP (Intermarkt Thielen) (c) 2015 by ekke (BlackBerry Elite Developer)

This app is running at a german Plants Wholesale company. Plants are delivered via Trucks to stores. Before the goods are going out there’s a check if quantity and content is the same as ordered and packed. If all is OK, data will be send via EDI from Plants Wholesale company to Plants Store to avoid the time consuming work of Goods Receipt at arrival of the truck.

workflow

The challenge was to develop a mobile app to make this work of checking the goods easy, fast and avoid errors. Plants are collected as single plants or in containers, Euro Pallets etc. All Plants have a barcode (EAN13) and also the Customer’s Sales Price printed on a label. All the Goods belonging to one order can be collected on some carts / trailers where it must be possible to start the check before the complete order was packed.

So this is the workflow: Scan the barcode from the order, get quantities and units of packed data from server, cache on device, then scan all goods. If ready get expexted (packed) data again from server and compare. Show positions and mark correct data, too much or less / missing. Correct, add or remove data, add all the containers / Euro Pallets and send quantities and units back to server.

Server is connected via REST services. All work on the mobile device is cached on the device to allow working while offline.

XXXX

Hardware

The mobile App must be robust and easy to handle with large fonts and big buttons. The device will be placed inside a arm bag and all the navigation and data entry must work by tapping on the device without getting the virtual keyboard where keys are too small. Barcode Scanner will be placed on the index finger to be able to work hands-free.

So this is the Hardware:

  • Fulltouch Device: BlackBerry Leap
  • LXE 8650 Honeywell Ring Scanner
  • Custom – made arm bag for the Leap

leap

lxe8650

Image of the Arm bag will follow – it’s just in-production. The bag must work inside and outside in the sun, so must be glare-free. Wasn’t easy to find the right one so finally we decided to produce a custom made bag.

 

APP-in-action (Video)

work-in-progress

The mobile APP (Screenshots)

At startup the APP automatically switches Bluetooth ON and at the end Bluetooth will be switched OFF.

There’s no other Bluetooth APP on these devices, so it’s a good idea to be energy efficient.

After switching Bluetooth ON, the APP is searching for the last connected Scanner.

If no one found you can manage all the Bluetooth stuff without any tech knowledge from inside the app (see below at the end of this article)

we_01_start

Bluetooth is ON and Scanner is connected: you’re ready to start work for Goods Receipt.

we_02_started_MOCK

Now scan the Order number from the Picking List you want to check.

we_03_wait_for_pnr

Picking List with informations on Customer and Positions will be downloaded from server via REST service and cached inside your secure app sandbox.

Scanning the same Order number again will load the data from cache – so it’s easy to switch.

All Pages are using large fonts and designed to make it easy to read, understand and to tap on.

 

we_04_pnr_header

As soon as one of the Picking Lists (Orders) is active you can start to scan EAN13 Barcodes from the packed goods.

If a Barcode was not found inside the active Order, the APP is looking at other cached and not yet completed lists. If Barcode was found inside another Order, you’ll get the info using a Custom Dialog.

Then it’s easy to switchto another Order by a single Tap or cancel if the wrong article was scanned.

we_05_select_pnr_for_ean

Each Order Position knows allowed Barcodes, so from scanned EAN 13 Code the APP detects the Order Position and displays description, price, size, quantity and content.

You also see the amount of already scanned quantity (in the example below: 60) and you get an Icon at the right to know about the current state:

 

icon_quantity_states_down

red arrow down: less scanned then packed

 

 

icon_quantity_states_up

 

blue arrow up: more scanned then expected

 

icon_quantity_states_done

 

green checkmark: all is OK – scanned quantity same as packed

 

we_06_ean_scanned_MOCK

Tapping on the Icon you’ll get a list of all single scans for this position.

From here you can tap on on Unit (Menge) or Content (Inhalt) to edit the value.

Tapping on the trash sets quantity to 0.

we_07_already_scanned

One of the great things from BlackBerry 10 OS is the “peek-back” functionality: you always know about the context by simply swipe the current Page to the right border.

Here peeking back from an Order Position to Order Header gives easy access to Order and Customer info:

we_08_peek_back_from_scan_to_pnr

Remember: the Device is inside an arms bag and it must be easy to enter data.

Key caps from virtual keyboard are too small, so I developed a numeric keypad occupying complete space from Device in Landscape orientation.

This numeric keyboard knows about the context and so it’s optimized to enter Quantity, Content, Prices, Order Numbers or EAN13 Codes.

The screenshot below shows entering Quantity (Menge):

we_09_enter_quantity_MOCK

Want to get Info about corresponding Position data ?

Simply peek back and go on without closing / opening pages – that’s the BlackBerry 10 FLOW:

we_10_peek_back_from_enter_q

Here a quantity of 4 Containers was entered where each one contains 6 Plants = Total (Summe) of 24 Plants:

we_12_entered_quantity

If a Barcode (EAN13) is dirty and cannot be scanned it’s easy to enter the number manually.

The APP checks immediately if you entered exactly 13 digits and also validates if checksum is correct before searching the position.

Goal is always to make it as fast as possible and avoiding errors.

we_13_enter_ean

Sometimes it happens that inside an Order there are more then one positions found for a given Barcode:

in this case the employee can select if he/she’s scanning the position with a content of 6 or only 1 in each container:

we_14_select_pos_for_ean

All Lists, all Dialogs have custom big Buttons and large List Rows to make it easy to tap on.

If something went wrong, the Device does a vibration to alert the user.

we_15_pos_selected

While checking the scanned data before sending them to the Server a list with all the scanned or not scanned data is displayed.

Tapping on an entry shows the history and quantity or content values can be changed or removed.

we_16_check_positions_MOCK

If no scanned data was already entered for a specific position you can also enter data manually.

At first you must verify the Barcode – in some cases there can be more then one Barcode valid for a position, so you must select the right one:

we_17_select_barcode_from_check_pos

As last step quantities of all Empty-Containers put on the Truck must be entered.

If all is done you can send data back to server. Then in the Office data can be varified again and if all is done, the Goods Receipt will be sent via EDI to Customers IT.

we_18_enter_container

If more then one orders are active (stored in offline – cache) you can easy switch to another one:

we_19_select_from_active_pnrs

The APP also provides all Bluetooth Management from inside the APP without going to Device Settings to make this an easy stuff.

After scanning for Bluetooth Devices nearby, found Devices are grouped by Type and Scanners can be edited.

we_20_search_bt_devices

Tapping on a row shows the details and allows to Pair / Unpair or Connect / Unconnect a Scanner:

we_21_pair_and_connect

There’s also a special testpage from where you can test if the Scanner works well.

we_22_test_scanner

Over all BlackBerry 10 OS  and hands-free working makes following the workflow fun and also to be productive.

Running the Scanner in serial mode (SPP Profile) makes it very comfortable, because scans can always be done and not only while focused on entry fields as done in HID profile.

It’s some more work to implement serial connected Scanners, but Customers will thank you for this.

The Backend

Here’s a short snapshot from the backend (ERP solution): Positions ordered (bestellt)….

we_backend_01

… packed (Gepackt) and compared (Geprüft) from mobile Goods receipt APP.

The Barcode Icon at the very left shows the details of all scanned data.

we_backend_02

Take a look at the Video to get a feeling how smooth this app is working. Then you understand why my first choice for Business Apps is always BlackBerry10 OS. More of my BlackBerry 10 Business Apps can be found here.

Business Apps

November 15, 2015 — Leave a comment

BB10 vs Android Development

Often I was asked, why I’m still developing business apps for BlackBerry 10.

Why not Android – even now where BlackBerry is providing a first Device powered by Android (BlackBerry PRIV) ?

I really like the PRIV giving me a great touch screen plus keyboard plus all the apps and services from Google Play with all the security by BlackBerry on top: unbeatable in the Android world.

If you need all these apps for your daily business: use the PRIV – it’s made for you and gives you the most secure Android Device. Of course I’ll also develop business apps for the BlackBerry PRIV.

If you need the most secure OS or Push Services inside secure BlackBerry infrastructure or Apps providing the smoothest way to follow your workflows: use a BlackBerry 10 Device.

The good news: you can manage and run all together from your BES12: Android, BlackBerry10, iOS, Windows 10, Android for Work, Samsung KNOX !

To give you some infos what kind of apps can be done with BlackBerry 10 you can take a look at BlackBerry World (search for ‘ekke’) – it’s the only reason why I’m publishing some apps there. Most of my business apps are ‘hidden’: they’re running on BES12 at small, medium or large Enterprise Companies worldwide.

To give you some first impressions I’ll blog about some of the native business apps I developed for customers or BlackBerry Partners. Stay tuned …

BB10 Business Apps

  • Goods Receipt (Plants Wholesale)
  • Red Price (Closing Department Store Chain)
  • Services Property / Facility Management
  • Time Tracker Enterprise
  • Conferences / Events
  • BI, Statistics
  • Training, Event Management
  • Work Force Management

BB10 is all about Speed

BlackBerry 10 is built from ground for speed and smooth workflows to be as productive as possible esp. in Business Apps.

A good summary on this from CrackBerry by Bla1ze from an article comparing UX of Android (BlackBerry PRIV) and BlackBerry 10:

Speed – Losing the ability to fly through the OS quickly was something I was fully aware I was going lose going into the Priv. The ability to hop in and out of apps, switch windows, complete tasks, glance at the pertinent info and just get right down to business is intense on BlackBerry 10, and I’ve not yet been able to reach the same level on the Priv. I’m not saying it’s impossible on the Priv or Android in general; I’m just saying it that experience and speed were built into BlackBerry 10. On Priv, it’s going to take a bit more effort to get things set up the right way and customize the experience to get to the same point. BlackBerry had the pleasure of being able to create BlackBerry 10 from the ground up and build in those experiences. On Priv, they’re playing in someone else’s sandbox and those experiences have to be recreated.

This doesn’t help if you miss Apps important for your work on BB10 – then you should go with Android or iOS. But there are many use-cases and scenarios where missing Apps is not a problem and you should choose BB10 where possible to get the best performance. Perhaps my BB10 – Business – Apps – stories will help you to decide.

BlackBerry 10 and BlackBerry Android Devices are brothers in respect of secure devices and both are great for small and big enterprises.

mobaDSL

While developing mobile Business Apps I recognized that there are many patterns to provide Offline-Cache, to access REST Services, to transform and bind data to UI and much more. So I developed a DSL (Domain Specific Language) based on Xtext and Xtend and this DSL will become Open Source next months. Read more at mobaDSL.

mobaDSL will speed up development of mobile business apps and will be available for native BB10, Android and iOS App Development. mobaDSL is not an App generator – it’s more like a toolbox / workbench to help you to avoid all the boring copy/paste stuff and to generate Entities, Data Transfer Objects, REST Services and more.

This year first time ever I’ll attend Qt World Summit in Berlin and so I also in my spare time wrote a conference app.

Conference2Go Qt World Summit can be downloaded here

qtws15_bbw

There was only a very short timeframe, a new API and also a complete rewrite from scratch, so if you know some of my other Conference2Go apps, this first version misses some things: Calendar- , Notebook-, Foursquare – Integration, Search for Sessions / Speaker, birds-eye-view of all sessions, Shortcuts for keyboard devices and full Classic Trackpad support. I’ll add this later.

Conference2Go Qt World Summit gives you:

  • Sessions –> Details with Speaker –> Room
  • Trainings –> Details with Speaker –> Room
  • Speaker –> Details –> all Sessions of this Speaker –> Details
  • Tracks –> Sessions –> Details …
  • Favorite /set / remove from all Sites with Session data)
  • Venue
    • Floorplan / Rooms
    • Twitter Search #QtWS15
    • Location on BlackBerry Map / Navigate to…
    • Qt World Summit Homepage
  • ekkes-corner (BBM, Blogs, Mail to, Profiles)

Sessions and Trainings are segmented by Conference Day and grouped by Time.

Scheduled Items (Break, Lunch, Party, …) have a light background

Keynotes and Lightning Talks have own Icon, Session Tracks are colored.

Sessions marked as Favorite have an orange flag.

Tap on a Room / Floor and open in MediaPlayer to zoom in / out

All Screens support Portrait and Landscape

Video and more info will follow – here are some screenshots:

01_app_tabs 02_sessionlist_1 03_sessionlist_2 04_sessiondetail_1 05_sessiondetail2 06_sessiondetail_landscape 07_sessiondetail_room 08_trainings 10_spekaerlist_1 11_speakerdetail_1 12_speakerdetail_2

13_tracks 14_favorite 15_venue 16_floorplan 17_floorplan_2 18_location 19_homepage 20_ekkes_corner 21_ekkes_corner_2

See you in Berlin and have fun with the app. If there’s something wrong or missing please send feedback from ekkes-corner Tab inside the app.

(edited 2015-09-26 – see below new tests added)

This is the first part of a series about performance in mobile business apps. Developing apps for the enterprise always is a great challenge: you have to deal with servers from backend, Online / Offline – mode, complex workflows and your app should help the employees to get their work easy done. Performance is one of the keys to success. I’ll talk here about some scenarios you may run into if developing business apps.

Getting data from a server via REST or SOAP you have to rely on data sent to you and sometimes it’s not as expected. Per ex. in one of my Enterprise projects from time to time I had to sync master data where 150k records must be fetched from server and stored locally into SQLite. From API documentation there was one field as unique index declared.

Persisting bulk data into SQLite should be done in a batch transaction. (More about this in another part of this series)

Did so and suddenly SQLite reports an error: INSERT failed because of “Index not unique”. From batch transaction SQLite doesn’t tell you which records are duplicates. To verify this I inserted record by record and found 20 duplicates and could report to IT. Inserting record by record was very slow: 80 minutes instead of some seconds. So what to do ?

To verify data it would be the best to check if the indexes are unique before inserting them into the SQLite. In this case index was a String field and my first idea was to use a QStringList:

void ApplicationUI::checkIndexQStringList()
{
    JsonDataAccess jda;
    QVariantList cacheList;
    QStringList myIndexes;
    int duplicates;
    cacheList = jda.load(dataAssetsPath("fakeName.json")).toList();
    duplicates = 0;
    for (int i = 0; i < cacheList.size(); ++i) {
        QVariantMap fakeMap = cacheList.at(i).toMap();
        QString myIndex = fakeMap.value("Username").toString();
        if (myIndexes.contains(myIndex)) {
            duplicates++;
        } else {
            myIndexes << myIndex;
        }
    }
}

Unfortunately this took 13 minutes – so was no solution.

Then instead of a QStringList I tried to use a QVariantMap:

void ApplicationUI::checkIndexQVariantMap()
{
    JsonDataAccess jda;
    QVariantList cacheList;
    QVariantMap myIndexes;
    int duplicates;
    cacheList = jda.load(dataAssetsPath("fakeName.json")).toList();
    duplicates = 0;
    for (int i = 0; i < cacheList.size(); ++i) {
        QVariantMap fakeMap = cacheList.at(i).toMap();
        QString myIndex = fakeMap.value("Username").toString();
        if (myIndexes.contains(myIndex)) {
            duplicates++;
        } else {
            myIndexes.insert(myIndex, "");
        }
    }
}

Now it took only some seconds 🙂

You can check this from a project at Github: https://github.com/ekke/performance_biz_apps

There I’m using fake data of 50k records and the difference is huge:

  • 2 minutes (using a QStringList)
  • 1.2 seconds (using a QVariantMap)

performance_stringlist_map

If there’s something slow in your app – it’s always worth to search for the reason. I never would have thought that a QStringList is so much slower in this usecase as a QVariantMap.

… updated 2015-09-26 ….

thanks to feedback from twitter @ICODeRUS and @qtproject I added two more tests to make it even faster 🙂

Using a QMap<QString> instead of a QVariantMap reduces time by 10% and using QHash<QString> speeds it up to 400 mS (3 times faster as QVariantMap). see the details from GitHub project, here are the results:

bizapp_perf_contains

… more blog posts will follow: SQLDataAccess vs Qt/SQL, Threads or what else ?, Objects and Pointer in QML, Caching into JSO or SQLite ?, SQLite tuning, optimize Queries, Startup time of your app, …