Posts

Get local active IP address

Image
The active IP address would be the one actually used to communicate on the network. In most cases a PC has the ethernet port used as primary and the wifi network used as secondary (or vice versa). If you switch from one to the other you create a situation where both network devices have a valid IP but only one of the two is actually used based on the active connection at that time.

QWebSocket synchronous communication

Image
QWebSocket can send or receive packet with text or binary contents. As all other Qt components everything works asynchronously. However, there may be cases where it is necessary to work asynchronously waiting for the reply to a given message before moving on. Here an example for a synchronous communication that you can use in your project.

QML: Emboss effect

Image
QML have some components allowing to draw a shadow over an item. The InnerShadow draw a shadow only in one side of the item, but for have the emboss effect we need to habe both sides with light/dark color. The solution is very simple, use two InnerShadow combined.

QML: CheckBox and RadioButton with description field

Image
Restarting from this post explaining how to add the word wrap feature to the CheckBox and RadioButton controls here will propose to add a description field under the main control text. This will be useful to give a short explanation concerning the use of the control itself.

Git on Windows and custom SSL proxy certificate problem

Image
Modern proxies, usually used on a companies, check each downloaded data for malicious code. For allow check of SSL connections the proxy provide a custom SSL certificate to use from inside company PCs. Use this custom certificate in a browser is a very easy operation since all modern browser can manage them by internally install the certificate. However with some other tool like Git the procedure is a bit more complicated.

Qt: Request Android app permissions

Image
Each Android app, based to the "interaction" with system, have to declare what resources need to access through some special info called permissions . Normally these permission are declared inside the AndroidManifest.xml and this was enough. However, from android version 23 (Marshmallow) and above some part of these permissions (classified as more "critical") have to be manually requested to the user who have to accept for authorize the app to use it.

QML: CheckBox and RadioButton with word wrap feature

Image
Standard QML CheckBox and RadioButton controls can be used in a very easy way but, at least until the current date, it have the problem if the text go over the parent control container is not automatically moved to the next line but is simply cutted out. This missing feature is called word wrap .

Linux: Translate virtual to physical addresses in user space

Image
Each memory allocated in a process use a special address system called virtual address. This is a special address used inside the process space. However, sometime, could be necessary to know the real physical address in system memory for different purposes in user space. Here a short snippet showing how to do.

Android: Remove system app from adb command line

Image
In case you want to remove from your android a system app is possible to use few commands using adb but remember you need to have a rooted device for get it working

Qt Installer: show uninstall window only

Image
Qt Installer Framework is the multiplatform installer solution provided by Qt team. Is a powerful tool but customization is currently not so easy cause no visual tool has been provided and all the customizations have to be done by code.

QML: Get Android apk package info

Image
All the information stored inside apk AndroidManifest.xml file can be extracted using dedicated Android API. Using JNI through C++ Qt layer is possible to get these info and pass them to the QML level.

QML: Mixed native Android and QML animated splash screen

Image
In this blog two methods for show a splash screen has been proposed. One is based to pure QML code and show animations and the second is native Android way but static. Now a third method mixing both previous solution by allow a partially animated splash screen is proposed.

Merge multiple Subversion repositories into a single Git repository

Image
If you want to move your subversion repository to a git repository already exist tools make this porting in an easy way. But if you want to move and merge more than one subversion repositories into a single git repository you have mo make some manual steps.

Qt Creator: set dependencies between subprojects

Image
In case your project is divided in some subprojects like, the typical case, a main app plus a library you have to be sure, when you make some change into the library, also the main app is automatically recompiled for "integrate" the new changes of the library. This operation can be done by set a dependency between the library and the app.

Qt: Load resources from static or shared library

Image
Usually Qt resource file (.qrc) is embedded inside the main executable file for automatic access without any additional operation. Just compile and you have access to the resources from any point of the code by using the special path prefix required for the resource virtual file system. However, if required, is also possible to load resources from static or shared libraries with a minimal efforts.

QML: Change Android screen orientation programmatically

Image
In case your Android app require to dynamically set screen orientation for some particular interface is possible to directly call the system API allowing to choose one of the two standard orientations LANDSCAPE or PORTRAIT.

Visual Studio 2015 required executable runtime libraries

Image
Once finished to develop your software final step is start to release the installation package. Executable generated by Visual Studio compiler require some additional libraries called runtimes allowing to software to run correctly. You have to provide these libraries in your installation package for allow your software to run in each machine without problems.

Android: adb push and read-only file system error

Image
If you want to copy a file from your PC to the connected android device the fasten way is to use adb tool with push command. This command get as params the path of the local file and the remote path to copy in the device. Sometimes, especially if you use adb from Windows or MacOS, and error about read-only file system show up and you can not copy any file.

Java and https invalid certification error

Image
In case you are working under a restricted network with some particular proxy who have its own secure certificate system is possible you experiment some problem when Java runtime try to download something from an https address. Developing with Android Studio can show the problem cause try to download gradle package at first compilation.

Make Android/iOS resized icons package online

Image
Major mobile systems require you provide a set of image of same icon resized to support different DPI screens. This is a very boring step in develop your app but fortunately it exist some tool able to automatically make the job for us.