What should I do to deploy run Qt SQL (PostgreSQL) application on android ?



  • I have an application via which user can view tables in database via Network . It Works on my Arch Linux . But then I compiled it for android and I get :-

    W/libFlatSystem.so(28674): (null):0 ((null)): QSqlDatabase: QPSQL driver not loaded
    W/libFlatSystem.so(28674): (null):0 ((null)): QSqlDatabase: available drivers: QSQLITE
    

    So postgreSQL driver is not available on my android system . But I have installed PostgreSQL via temux and PostgreSQL is working fine in temux,Also
    I have no intention to use Progresql installed in temux . My application connects to server and and fetch data from server .
    So what thing I need to consider ?
    Do I need to bunndle Postgresql with my Qt app ?
    or Qt provides some handy way ?

    this is my first android Qt Project and I am very new to SQL world


  • Lifetime Qt Champion

    Hi,

    You would have to cross-compile the PostgreSQL client libraries for Android and then build the corresponding Qt plugin.

    One thing you can try is to check with the termux folks whether you could re-use their client libraries build.



  • @SGaist

    As u told me I had successfully compiled postgresql (since last 12 hours ) and I have put libpsql.so in /opt/Qt/5.11.1/android_armv7/plugins/sqldrivers

    % file *
    libpq.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, with debug_info, not stripped
    libqsqlite.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped

    but still I am getting same error .


  • Lifetime Qt Champion

    Did you build the corresponding Qt plugin ?



  • No ,But will start making it now .
    Looks like I have to do a lot of reading on Qt Docs .

    Thanks



  • Do I have to compile Qt from Source ??


  • Lifetime Qt Champion

    Not the whole of Qt, just the corresponding plugin.



  • Hi,
    Did you succeed to compile the PostgreSQL plugin for android?



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