Android emulator



  • Hi guys,

    Am I allowed to ask a question? Do you use a Android emulator? What AVD do you use and what processor architecture (Arm or x86)? What ever I ask no one wants to answer and solve the issue it's more than 10 days I'm involved in it. Wherever I want to ask they tell me that since I'm using Qt Creator "if I ask here I will get a better answer" but I got no answer solving my issue completely. I'm thankful of the time you consider for helping others, but here is also a forum for asking questions.
    My question is "what is THE PROBLEM with my threads"?
    Does it mean that no one uses an emulator? That is, a programmar of Qt developing Android apps should have many real devices to test each app on them?

    I'm really exhausted. If I return to my first place "I Will Never come Near to programming".


  • Moderators

    @tomy I use Android emulator, I start it from QtCreator. I use x86 there as it is faster than emulating ARM CPU. I don't have any issues with the emulator. I develop on Linux, on a PC and laptop: both work just fine. I can run my app even on my Android phone (after switching to ARM v7).
    What exactly does not work for you? Are you on Windows or Linux? If on Windows: do you have any anti-virus software running (try to switch it off temporarily)?
    You can try to start a simple Java Android app from AndroidStudio (you installed it as far as I know) to check first whether it is working there.



  • @jsulm

    Thanks for your reply. I use Windows (7 x64) and even if I stop the antivirus I always get the error:
    Error while building/deploying project QApp_1 (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.8.0)) When executing step "Deploy to Android device"

    I think the problem is exactly of the ARM AVD (and you used x86 and fortunately did not face that issue)

    Let me please ask you this: what is the philosophy of using x86 and then switching to ARM?
    Is my assumption, as follows, correct?

    • By Qt Creator we create an Android app => use x86 kit => click on Run in Debug mode => use an x86 AVD => see the result.

    • Then if the result is OK => return back to the project => change the kit (from x86 to ARM) => run in Debug mode (without using an ARM AVD) => run in Release mode (again without using an ARM AVD) => publish the app for real devices that their CPU architecture is ARM.


  • Moderators

    @tomy Actually I use x86 most of the time. Only if I want to test on ARM device (or if you want to upload your app to the app store) I switch to ARMv7. Most of the time it really doesn't matter whether you use x86 or ARMv7 while developing. You can even upload both x86 and ARM to app store as there are Android devices using x86 CPUs.



  • @jsulm said in Android emulator:

    @tomy Actually I use x86 most of the time. Only if I want to test on ARM device (or if you want to upload your app to the app store) I switch to ARMv7.

    I meant this point. You have run and app using x86 and want to re-run using ARM. Have you ever tested it? I mean, can we say that when preparing the app for ARM we don't need seeing the result on a ARM AVD (because it's very slow and also may make errors) and just run the code and fix the code errors (if any) and then publish the app?

    Most of the time it really doesn't matter whether you use x86 or ARMv7 while developing.

    But we can't run an app only using x86 kit and publish it for both architectures. Aren't I right?

    You can even upload both x86 and ARM to app store as there are Android devices using x86 CPUs.

    good point, thank you.


  • Moderators

    @tomy Sure, you should test on ARM as well. But the point is: you don't have to do it all the time.
    For most apps it doesn't matter whether they run on x86 or ARM.
    So, from my point of view it is perfectly fine to test on x86 emulator most of the time and then test on ARM (and real hardware, not only emulator!) regularly.
    To publish for both architecture you need to build for both using both Kits, yes.



  • @jsulm

    Sure, you should test on ARM as well. But the point is: you don't have to do it all the time.
    For most apps it doesn't matter whether they run on x86 or ARM.

    Frankly speaking, It makes me rather confused! Do you mean "in most of the apps", an app run by x86 will work on ARM arch either? If so, then why do we bother ourselves even with dealing with ARM system images/AVD-s etc?

    So, from my point of view it is perfectly fine to test on x86 emulator most of the time and then test on ARM (and real hardware, not only emulator!) regularly.
    To publish for both architecture you need to build for both using both Kits, yes.

    Yes, I got that part completely. Thanks.


  • Moderators

    @tomy No, not at all! What I mean is: you write your app in C++ not Assembler and as long as you do not do any low-level stuff which depends on CPU architecture you do not care whether it is x86 or ARM. You just need to build and test for each platform at the end. That means: in most cases during developing you test on one architecture (for example x86). Then later if you want to release it (upload to app store) you build it for all architectures you want to support and test.



  • @tomy

    Hey, when I first at my company, I had some serious t rouble with AVD too. My precursor only used Android-VM, he headn't heard of USB-Debugging and I was told to do so as well.

    For about a week I struggle with it,

    • The VM took forever to start
    • Mouse and Key Inouts had a serious delay
    • The App had to run with a low resolution, or everything would be worse

    in the end i put my food down, bought a Tablet and debugged on a real device.

    But thinking back on it, I might know what the problem is you have.

    I had to start the AVD before I tried to build and deploy my app. The startup of the Andorid OS took about 5 min, apparently longer than the deploy-timeout.
    Because of that, I reguarly would get errors when executing step "Deploy to Android device

    hope it helps?



  • @jsulm
    Good info, got it, thanks.
    I will make a thread on using app store (oh! sorry Google Play). :-)

    @J.Hilk

    Hey,

    Hi, welcome to thread! :)

    I, too, think starting the AVD considered for testing an app before running it, may be good and helpful. I will do that.


Log in to reply
 

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