Demos



  • Silly question here- I went to the "quick hit demo" page and just can't find a way to download the project without saving individual files. I also intend to try some other demos as well. Anyone know where I can get a zip of the projects?

    Thanks!



  • If you downloaded Qt from qt-project.org and installed it then the examples on a Linux system are

    • Qt5.2.1
      @
      Qt5.2.1/5.2.1/gcc_64/examples
      @
    • Qt5.3.0-beta
      @
      Qt5.3.0/Examples/Qt-5.3/
      @

    I think that Qt follows the same structure for other OS.



  • Thanks. This demo is not in the folder though- it's only available on the website here:
    http://qt-project.org/doc/qt-4.8/demos-mobile-quickhit.html


  • Moderators

    Hi,

    That demo has not been ported to Qt 5.

    What are you interested in learning from the Quick Hit demo?



  • Hi JKSH, thanks for your question - because I want to see if it's possible for me to figure out how to get recording working on a fairly large number of devices (and playback). I'm interested primarily in android, but am hugely hoping to see this working on ios as well of course.

    Any input for me? I'm very impressed with Qt so far, but it's the details that sometimes kill you... :) I'm thinking you can just use the multimedia libraries like they use them in that sample?


  • Moderators

    Multimedia underwent a major overhaul between Qt 4 and Qt 5; that's one of the reasons the Quick Hit demo wasn't ported. If you look at the URL you posted, you'll see it says "qt-4.8", which is very old. You will need Qt 5.2 or later for Android/iOS support.

    For recording, see the "Audio Recorder Example":http://qt-project.org/doc/qt-5/qtmultimedia-audiorecorder-example.html

    For playback, see the "Media Player Example":http://qt-project.org/doc/qt-5/qtmultimediawidgets-player-example.html

    You can also download th "Qt 5 Everywhere":https://play.google.com/store/apps/details?id=com.digia.Qt5Everywhere demo app directly onto your Android devices -- it contains internet radio and video playback examples.



  • You are awesome. Your help is much appreciated, thank you!



  • Just got completely blown away by the video of Qt 5 Everywhere.


  • Moderators

    You're most welcome. :) Welcome to the world of Qt; I hope you'll find that it meets and exceeds all your expectations!

    P.S. For a comprehensive tour of multimedia features, see the "Qt Multimedia overview":http://qt-project.org/doc/qt-5/qtmultimedia-index.html page. From there, you'll find links to specific topics that you might be interested in.



  • Thanks JKSH! I just followed the instructions found here to try a little app I've started on my Samsung galaxy S4:
    http://qt-project.org/doc/qtcreator-2.7/creator-developing-android.html

    One of the requirements is OpenJDK - seems that is for Linux only - does that mean I can't deploy to Android when developing on Windows?


  • Moderators

    Hi,

    It is possible on windows.
    Have a look at "this link":http://qt-project.org/doc/qt-5/androidgs.html

    to get started


  • Moderators

    Notice that your link says "qtcreator-2.7". Again, that is an old version (the current one is Qt Creator 3.0, with 3.1 going to be released next month).

    Qt's documentation is very comprehensive, and is improved with every release. Always use the latest version of the documentation at http://qt-project.org/doc

    Go to the "Downloads page":http://qt-project.org/downloads -- you will find a package labelled "Qt 5.2.1 for Android (Windows 32-bit, 1.1 GB)"



  • Hi jksh, I'm a bit confused. I have Qt 5.2.1 for windows installed (based on MSVC2010). Am I right in thinking that Qt can compile to Android or to Windows based on the kits you have installed and that the difference between Qt for Android and Qt for Windows is just there for convenience in having the main kits you're interested already setup? Since I am interested in Android and not Windows, maybe I should uninstall the one I have...


  • Moderators

    [quote]Am I right in thinking that Qt can compile to Android or to Windows based on the kits you have installed and that the difference between Qt for Android and Qt for Windows is just there for convenience in having the main kits you’re interested already setup?[/quote]No.

    To create programs, you need to use a compiler.

    • MSVC 2012 contains a compiler to create programs for Windows.
    • MSVC 2010 contains a different compiler to create programs for Windows.
    • The Android NDK contains a compiler to create programs for Android.

    Qt is a library. The files you downloaded are a "partial program", which have already been pre-compiled:

    • "Qt 5.2.1 for Android" contains Qt libraries compiled using the Android NDK compiler.
    • "Qt 5.2.1 for Windows 32-bit (VS 2010, 518 MB)" contains Qt libraries compiled using the MSVC 2010 compiler.

    To create a program, you need compile (or build) your code into an executable file. Then, you link your executable to the pre-compiled Qt libraries. You need to make sure that the compiler you used to build your code is compatible with the compiler used to build Qt.

    A "kit" simply groups a compiler with a version of the precompiled Qt libraries. You need to download your own compiler, and then download a version of Qt that is compatible with that compiler.



  • I got something uploaded on my S4 now, thanks again for your help!



  • Now I'm having a very tough time recording something with the audio recorder example above. I have the app running on my phone and after I record something I say into the microphone, I can't find the file anywhere - I don't think it gets saved. Any idea why?

    Thanks,
    Mike


  • Moderators

    Please post your file saving code; we can't tell what's wrong otherwise.



  • I haven't modified the sample - I am thinking that this code from the sample sets the location of the file:

    void AudioRecorder::setOutputLocation()
    {
    QString fileName = QFileDialog::getSaveFileName();
    audioRecorder->setOutputLocation(QUrl::fromLocalFile(fileName));
    outputLocationSet = true;
    }

    and when you record, this file is written to?


  • Moderators

    Ah, I see.

    I haven't tried that example on Android before, but I believe you need to click "Output..." to set your save location. Then, record your sound.



  • It works! I didn't know where the files were going. Not sure why I admitted that. Although in my defense, it could have been a bit more obvious... :)

    And I'm pushing it now (again), but I can't seem to get an AVD going. I see I'm always on target API of 19 (which seems high, but that's something to look into). And ABI has 4 choices [armeabi-v7a, armeabi, x86, and mips]. I notice that I have the error message, "Qt version for architecture mips is missing". All Chinese. I'm just a guy that knows there are many different types of processors that have different instruction sets... But which one I should choose and why? Is it because Qt is compiled to each one and packaged in some mega zip that allows whichever device to get appropriate files? I know that almost as much as I know Chinese. (Or Korean - whatever looks more cryptic to you. Unless you know both already. In that case, how about Japanese)?

    In all seriousness, I'm running on Windows 7 pro, I've got an S4... What is it I want to do to get a little app on the market? (actually, I'm not asking about that procedure) - I'm really asking, what are my main areas of focus in order to get that going to develop well on Windows (debug) and what ratio of debugging would you feel reasonably safe with debugging on AVDs and actual devices? And should I try all devices possible or are they generally all very equally supported when doing things like audio?

    Tough questions! Maybe not for you. Any more help is very greatly appreciated. Please let me know if I should repost this as a new topic.

    Thanks again,
    Mike


  • Moderators

    I agree that the example could be improved. I only knew the answer because I was wrestling with the same example myself a few months ago.

    I haven't done any Android development myself though, so I can't help you with your latest questions. But since it's deviating from your original question now, I recommend starting a new thread with a new title -- people with Android experience will be more likely to spot it then.

    Good luck!



  • ok thanks JKSH for all your help!

    Cheers!
    Mike


Log in to reply
 

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