Android deployment with Necessitas on Sony Ericcson XPeria X10 Mini Pro
I've just deployed my first Android app using Qt/QML to my XPeria X10 mini pro using Necessitas and Ministro and it works just fine. However, I had to use a very strange deployment method and I'm sure there must be a better way and I wonder if somebody could tell me what it is please?
When I build and run the app in Qt Creator, the IDE only ever finds the virtual android devices - not my actual phone (which is connected via USB). I have switched on the debugging setting in the phone (Settings/Applications/Development/USB Debugging) which I've read elsewhere is necessary but it made no difference.
I tried copying the app to the phone (by dragging and dropping) but then couldn't figure out how to install it.
In the end I uploaded the app to my website and used a browser on the phone to download and install it. It worked like a charm but I can't help thinking there's a better way!
You should create a virtual android device.
Tools --> Options --> Android --> Start Android AVD manager --> Add
(I prefer using AVD manager)
Tools --> Options --> Android --> Add
You can create an emulator or your phone (screen resolution, memory, etc...)
In this way, at each time you compile the emulator will start, app will be uninstalled/installed and executed.
For the time being, I didn't find a solution to execute the app directly on a connected phone/tablet.
Hope it helps.
Thanks Seba84 but I already have it running just fine on the virtual devices - it's the real one that is causing the problem. However, since you have the same problem, perhaps you can tell me this:
If I transfer my app to the phone via USB directly to the flash card, how can I then install it?
firstly, Necessitas Qt Creator will launch your app on the first available device/emulator, which this is the default behavior of the Android SDK. So if it starts another emulator instance there must be a problem with your USB connection. You can check the state with
(should output "device" if there is one connected and recognized).
Regarding the installation of an apk on device: If you transferred it to a flash card you can use apps like "appInstaller":https://play.google.com/store/apps/details?id=com.IQBS.android.appInstaller&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5JUUJTLmFuZHJvaWQuYXBwSW5zdGFsbGVyIl0.. The easier way is however again the debug bridge:
@adb install path/to/your.apk@
Many thanks Alex. I will give those things a try next time I need to transfer a new version of my app.
"adb get-state" shows "device" by Qt Creator still launches the emulator and will not deploy to phone. I can't figure out why. I'd like to deploy to phone, not the emulator.