How to unzip an application running on an Android device using QT?
-
Hello, the application I developed in QT runs on Android devices. In other words, QT is actually installed on Linux, but the application is run on an Android device.
There is a database in the .zip file I downloaded from the server. I need to copy the database by unziping this zip file. I was not successful in the unzip process. I found out that it can't be done with qUnCompress. When I want to use QuaZip, after installing QuaZip-dev, I cannot reference the project with #include<quazip.h>. (quazip.h file not found)
Can you please help? -
@GulsahAkt said in How to unzip an application running on an Android device using QT?:
after installing QuaZip-dev, I cannot reference the project with #include<quazip.h>. (quazip.h file not found)
You need to tell compiler where to find header files and you have to tell the linker where to find the lib.
So, did you compile QuaZip for Android? -
@jsulm said in How to unzip an application running on an Android device using QT?:
You need to tell compiler where to find header files
Since quazip is installed on qt linux, I installed quazip-dev from the terminal. Do I need to manually compile Quazip for Android?
*You need to tell compiler where to find header files
When I specify where to find the header files as usr/include/quazip, I do not receive an error in the #include line, but when I run my application, I get the error "Undefined reference to 'QuaZip::QuaZip'Since I haven't added a Qt 3rd party library before, I'm not sure if I might have done something wrong, I'm sorry. But should I download QuaZip, compile QuaZip with the .pro extension file, and then add the library to LIBS in .pro in my own project?
-
@GulsahAkt said in How to unzip an application running on an Android device using QT?:
Since quazip is installed on qt linux, I installed quazip-dev from the terminal
And this has nothing to do with Android. You need to build this lib for Android and use that build.
"Undefined reference to 'QuaZip::QuaZip'" - this has nothing to do with header files, this is an error from the linker. I also wrote before: "and you have to tell the linker where to find the lib" -
@jsulm And finally I was able to get it working. Thank you very much for your help @jsulm, it was thanks to you. If anyone has problems like me, here's what I did: I compiled quazip for android, and a video was very helpful for me (https://www.youtube.com/watch?v=bVqVR2V3n3M&t=56s). In addition to the steps in this video, quazip .pro for android. I added this part.
android {
headers.path=$$PREFIX/include/quazip
headers.files=$$HEADERS
target.path=$$PREFIX/lib/$${LIB_ARCH}
INSTALLS += headers target
LIBS += -lz
OBJECTS_DIR=.obj
MOC_DIR=.moc
}
Then I compiled the quazip application and referenced the resulting libquazip.so file to my project and the result was successful. -
-