Reducing the size of QT Android libraries

Tried to reduce the size of the QT Android libs by separating debug info with -separate-debug-info option and skipping the modules I do not use:

set "CMAKE_ROOT=E:\PFiles\cmake-3.21.3-windows-x86_64\bin"
set "NINJA_ROOT=E:\PFiles\ninja-win"
set "JDK_ROOT=C:\Program Files\Java\jdk1.8.0_301\bin"
set "MINGW_ROOT=E:\PFiles\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin"
set "PERL_ROOT=E:\PFiles\Strawberry\perl\bin"
     
set PATH=C:\WINDOWS\system32;C:\WINDOWS
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%JDK_ROOT%;%PATH%
set PATH=%MINGW_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=E:\PFiles\Python35;%PATH%
       
rem Check if the tools are in PATH
where gcc
where mingw32-make.exe
where perl.exe
where javac.exe
where python.exe
where cmake.exe
where ninja.exe
    
set "ANDROID_SDK_ROOT=C:\Users\D-Ef\AppData\Local\Android\Sdk"
set "ANDROID_NDK_PATH=C:\Users\D-Ef\AppData\Local\Android\Sdk\ndk\22.1.7171670"
set "ANDROID_BUILD_TOOLS_REVISION=31.0.0"
     
set MY_INSTALL_PATH=E:\Qt\Qt6.2.2\android
set QT_HOST_PATH=E:\Qt\Qt6.2.2\windows
    
configure.bat -platform win32-msvc -xplatform android-clang -prefix %MY_INSTALL_PATH% -qt-host-path %QT_HOST_PATH% ^
  -android-sdk %ANDROID_SDK_ROOT% -android-ndk %ANDROID_NDK_PATH% -android-ndk-platform android-23 -android-abis x86_64 ^
  -DQT_NO_EXCEPTIONS=1 -release -force-debug-info -separate-debug-info -opensource -confirm-license ^
  -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity ^
  -skip qtdatavis3d -skip qtdoc -skip qtlottie -skip qtmqtt -skip qtnetworkauth -skip qtopcua ^
  -skip qtserialport -skip qtpositioning -skip qtquicktimeline -skip qtquick3d -skip qtremoteobjects ^
  -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtvirtualkeyboard -skip qtwayland -skip qtwebsockets ^
  -skip qtwebchannel -skip qtwebengine -skip qtwebview ^
  1> E:\temp\config-log12.txt 2>&1
(more…)

Replace a substring in source file names

For example, the command below

find -name "*android*" -exec rename 's/android/windows/' {} \;

renames the following source files:

androidinappproduct.cpp
androidinappproduct.h
androidinapppurchasebackend.cpp
androidinapppurchasebackend.h
androidinapptransaction.cpp
androidinapptransaction.h
(more…)

Compiling QT6.2.2 example with new billing library for Android

To prevent linker errors related to \Qt6.2.2\android\include\QtConcurrent\qtconcurrentrunbase.h

    void run() override
    {
        if (promise.isCanceled()) {
            promise.reportFinished();
            return;
        }
#ifndef QT_NO_EXCEPTIONS
        try {
#endif
            runFunctor();
#ifndef QT_NO_EXCEPTIONS
        } catch (QException &e) {
            promise.reportException(e);
        } catch (...) {
            promise.reportException(QUnhandledException(std::current_exception()));
        }
#endif
        promise.reportFinished();
    }
(more…)

Configuring Android NDK version in QT Creator

When I uninstalled old NDK versions including 21.3.6528147, QT Creator displayed this:

(more…)

Building QT 6.2.2 for Windows and Android

I downloaded QT 6.2.2, verified its checksum:

certutil -hashfile qt-everywhere-src-6.2.2.zip MD5

Building for Windows with MSVC2019

Configured QT for building in the system Command Prompt (but not in MSVC Developer Command Prompt) as follows:

CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
  
set "CMAKE_ROOT=E:\PFiles\cmake-3.21.3-windows-x86_64\bin"
set "NINJA_ROOT=E:\PFiles\ninja-win"
set "PERL_ROOT=E:\PFiles\Strawberry\perl\bin"
   
set PATH=%CMAKE_ROOT%;%PATH%
set PATH=%NINJA_ROOT%;%PATH%
set PATH=%PERL_ROOT%;%PATH%
set PATH=E:\PFiles\Python35;%PATH%
     
rem Check if the tools are in PATH
where perl.exe
where python.exe
where cmake.exe
where ninja.exe
 
set "MY_INSTALL_PATH=E:\Qt\Qt6.2.2\windows"
set CL=/MP
 
configure.bat -prefix %MY_INSTALL_PATH% -DQT_NO_EXCEPTIONS=1 -debug-and-release -force-debug-info -platform win32-msvc -opensource -confirm-license ^
-opengl es2 -I "C:\Program Files\OpenSSL\include" -L "C:\Program Files\OpenSSL\lib"
(more…)

I have MacBook

And it is even Pro:

System Version: macOS 11.6 (20G165)
Kernel Version: Darwin 20.6.0

(more…)

“Server certificate verification failed” error with command line Git client

Some guy described the same situation about 10 years ago on stackoverflow.com and there was another discussion about 7 years ago.

First I did:

GIT_CURL_VERBOSE=1 git clone https://git.developernote.com/examples.git
Cloning into 'examples'...
* Couldn't find host git.developernote.com in the .netrc file; using defaults
*   Trying 139.162.243.103...
* TCP_NODELAY set
* Connected to git.developernote.com (139.162.243.103) port 443 (#0)
* found 129 certificates in /etc/ssl/certs/ca-certificates.crt
* found 387 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
* server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
* stopped the pause stream!
* Closing connection 0
fatal: unable to access 'https://git.developernote.com/examples.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
(more…)

How to backup entire disk on MacOS

Open Disk Utility, select View->Show All Devices, select the disk and then Image from … :

To restore the disk from backup create a boot USB flash, boot from it and use Recovery option.

Periodically get ‘device not responding’ error on my HiveOS rig

Once a 2 or 3 minutes I get the following error in the miner log:

grep -i error /var/log/miner/gminer/gminer.log
Error on GPU6: Device not responding, check overclocking settings

and on the following message on the miner screen:

miner
GPU6: DAG has been damaged, check overclocking settings
Miner terminated, watchdog will restart process after 10 seconds

GPU temperature is about 50-60°C, but looks like the memory chips overheat, because there was NVidia error:

(more…)

Writing market data to SQLite database

SQLite utilizes up to 90% of the my SSD disk when SHIB coin riches its local peaks with more than 10.000 – 18.000 trades/min that is 166 – 300 trades/second. My C++ app inserts 64-bit values to tables like this:

CREATE TABLE trades (time INT PRIMARY KEY NOT NULL, price REAL, volume REAL) WITHOUT ROWID;

so it is only 3984 – 7200 bytes/second. Totally across all markets there can be about 30.000 trades/min that is 500 trades/second and only 12.000 bytes/second and it is enough to slow down my SQLite database.

I use WAL with 4GB cache:

PRAGMA journal_mode = WAL;
PRAGMA cache_size = -4 * 1024 * 1024;

and do all the inserts in a transaction once a 5 seconds into 500+ tables (a separate table for each market) with a prepared statement.

See the screenshots of my app below:

(more…)