Qt-UI

Running Qt On A Samsung Galayy Ace 2

Android Qt GPS Example | | Further Reading

First off, we need to see if the Android Debug Bridge recognizes any Android device plugged in via USB. So plug in your phone and run:

 adb devices

If you see it listed, then you are almost done:

  • install Ministro on your device
    • adb -d install <path to Ministro apk>
  • install your App on your device
    • adb -d install <path to your apk>

If you do not see it listed, make sure that it is actually connected by running “lsusb”. If you see a Android device connected on the USB bus, then we adhere to Google’s instructions on setting up a hardware device.

Let’s see how it works out for the Ace 2 with OpenSuse 12.1:

> adb devices
List of devices attached 

So adb does not see my Ace 2, yet.

> lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 004: ID 058f:a014 Alcor Micro Corp. 
Bus 001 Device 005: ID 0bda:0139 Realtek Semiconductor Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0cf3:3005 Atheros Communications, Inc. AR3011 Bluetooth
Bus 003 Device 003: ID 04e8:6860 Samsung Electronics Co., Ltd

But it is connected to Bus 3 Device 3, good!

So we follow the Google instructions:

  1. Enable USB debugging on your device.
    On most devices running Android 3.2 or older, you can find the option under Settings → Applications → Development. On Android 4.0 and newer, it’s in Settings → Developer options.
    Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings → About phone and tap Build number seven times. Return to the previous screen to find Developer options.
  2. Also allow Mock locations on your device.
> adb devices
List of devices attached 
9E3838FEF88FEBEA47D7DCE99F168BE device

Here we go :)

> adb -d install ~/Projects/Ministro\ II.apk 
145 KB/s (542653 bytes in 3.631s)
        pkg: /data/local/tmp/Ministro II.apk
Success

Now run your application in QtCreator and it will automatically recognize the attached Android device. Don’t forget to check “Deploy local Qt libraries”!

Some indoor screen shots /wo and /w GPS switched on:

Android-GPSoff Android-GPSon

Access the full GPS-Spot example via WebSVN:

Checkout the Qt Mobility example via SVN:

svn co svn://schorsch.efi.fh-nuernberg.de/qt-examples/GPS-Spot


Android Qt GPS Example | | Further Reading

Options: