Posts

Showing posts from March, 2015

Linux Snippet: include a static library inside another static library

Image
The linux static library format .a is basically only an archive of compiled object files. If you are developing a linux static library that use external functions coming from another static library you need to release both libraries (your library just developed and the second library you get functions from) for allow the final executable to compile correctly.


Qt android: interface C++ and java through JNI

Image
The latest revisions Qt framework allow to port application developed in C++ code to run in Android OS also. For standard app the Qt framework provide all the required features but in some case is necessary to interact with the system using native java code. For make such task Qt provide some specific objects able to allow a more easy work.

Linux tool: convert binary file to C/C++ source code array

Image
In case you are programming under Linux and have a binary file that want "import" inside your C/C++ code is there an useful linux utility tool called xxd able to make such conversion in a very easy way. This tool is usually installed by default in all major linux distributions.


Qt Snippet: random number generator

Image
In case you need to get a random number Qt provide the "classic" pseudo random generator based to an initial seed number. A pseudo random number is a simply algorithm able to generate a list of different numbers based to an initial number value called "seed".


Android: take a screenshot of a view

Image
There are some different ways to take a screenshot of a view. Here some code snippets ready to use in your app. The basic concept consists in render the content of the view into a bitmap.