Wednesday, 22 October 2014

Qt Creator Tutorial Z2 - What to choose?

Problem

Qt and Qt Creator has many options for cross platform applications. It can be hard to choose from a large selection :
  • Qt Widgets
  • QML
  • Qt Webkit
  • Qt Webengine
  • Qt Console

Definitions



Solutions


Qt Creator Android Tutorial A3 - QML Basics

If you have trouble install and configuring Qt Creator for Android see this: Qt Creator Android Tutorial A1 - Install.


QML


Tuesday, 21 October 2014

Qt Creator GNU/Linux Tutorial L1 - First Project

Installation

There are a lot of GNU/Linux distributions. So the tutorial only covers the my favorite distributions.

Arch Linux
pacman -S qtcreator gdb cmake base-devel git
Ubuntu
add-apt-repository ppa:alexey-ivanov/qtcreator
apt-get install qtcreator qbs
If all else fails use Docker
docker pull base/archlinux

Qt Creator



Android Studio Tutorial P3 - Run First Project

Run

Wait for the project to load.


Run -> Run 'app'

Choosing a device

There are many ways to run an app.



Real devices will appear when you plug them into a USB port.

Emulated devices 

Emulated devices need to be downloaded by SDK Manager. You can find how to use SDK Manager here: Android Studio Tutorial P2 - First Project.

To start AVD Manager go to Tools -> Android -> AVD



Create a new AVD.








Android Studio Tutorial P2 - First Project

If you had trouble installing see this: Android Studio Tutorial P1 - Install.

Configure

On some platforms Android Studio won't work out of the box.

Environmental variables(Windows)

System Properties -> Advanced -> Environmental variables

Add New Variable

Variable name: JAVA_HOME
Variable value: C:/Program Files/Java/jdk1.8.0_25


Android Studio Configuration

Open up Android Studio.



Select Configure.


Select SDK Manager.


Install the correct SDK build tools and corresponding SDK platform. This tutorial is targeting Android 4.3.1 and above.


Now select Project Defaults.


Select Project Structure and make sure the settings are correct.



First Project

Go back to the Quick Start and select New Project.


Select the target platforms and API. The tutorial uses API 18 Android 4.3.


Select the type of activity.



Finally, Finish!

Next

Android Studio Tutorial P3 - Run First Project

Android Studio Tutorial P1 - Install

Introduction

Android Studio is an experimental(at the time of the writing) IDE for Android SDK. Android Studio allows the creation of Android applications. Android Studio's main programming language is Java.



Installation

This will help with the installation of Android Studio.

Install USB drivers
If you are testing on a real Android device install the USB drives.


Download and Install JDK
Download package:
Java SE Development Kit 8 Update 25



Download and Install Android Studio
Download package:
android-studio-bundle-135.1339820

Monday, 20 October 2014

Qt Creator Android Tutorial A2 - Configure

Configuring Qt Creator for Android

Open Qt Creator.


Tools -> Options


Select Android.


Input the paths. If the paths are correct then no error messages will appear.


Select Build & Run -> Kits and Build & Run -> Qt Version. Verify Qt Creator detects Android tool chain.



Now the configuration is finished.

Next

Qt Creator Android Tutorial A3 - QML Basics

Qt Creator Tutorial Z1 - Licenses

Warning: This just a briefing. If you want legal advice consult a real lawyer. Qt trademark belongs to Digia.


Licenses

Qt and Qt's libraries have few licenses. This might help you decide which license to use.

GPLv3
GNU General Public License v3 by Free Software Foundation. The flagship Free Software Foundation license for free software.

Advantages:
Free(cost)
Do almost anything to the source code
Sell source code or binaries
Modify source code or binaries

Disadvantages:
Must release source code for anything that uses the source code 
Any statically or dynamically linked software must be under GPLv3


LGPLv2.1
GNU Lesser General Public License v2.1 by FSF. Similar to GPLv3. However, LGPLv2.1 allows dynamic linking(e.g Qt libraries) .

Advantages:
Free(cost)
Do almost anything to the source code
Sell source code or binaries
Modify source code or binaries
Dynamically link software(e.g Qt libraries) without needing to use LGPLv2.1

Disadvantages:
Must release source code for anything that is statically compiled to it
Any statically software must be under LGPLv2.1

Digia Qt LGPL Exception version 1.1
Similar to LGPLv2.1. However, you can statically link software to other software if you don't modify the source code.

Advantages:
Free(cost)
Do almost anything to the source code
Sell source code or binaries
Modify source code or binaries
Dynamically and statically link software(e.g Qt libraries) without needing to change licenses if you don't modify source code

Disadvantages:
Must release source code if statically link and modify source code

Qt Commercial License
Qt Commercial License by Digia. Allows creation of proprietary or non-free software with Qt. Offered along with Qt support services.

Advantages:


Sell binaries without restriction


Modify source code without restriction

Disadvantages:
Costs money


For more information consult Qt's wiki.


Qt Creator Android Tutorial A1 - Install

Installation

This tutorial uses Windows as the development environment.

Install USB drivers

If you are testing on a real Android device install the USB drives.

Download and Extract Apache Ant

Download the binary:
apache-ant-1.9.4-bin.zip

Apache Ant download page.

Extract to any location. The tutorial uses C:/apache_ant/

Download and Install JDK

Download the installer:
jdk-8u20-windows-x64.exe
or
jdk-8u25-windows-i586.exe

Download ,Extract, and Install Android ADT Bundle

Download the bundle:
adt-bundle-windows-x86_64-20140702.zip
or
adt-bundle-windows-x86-20140702.zip

Android ADT Bundle download page.

Extract to any location. The tutorial uses C:/adt_bundle/

Run C:/adt_bundle/SDK Manager.exe.


Install the correct SDK build tools and corresponding SDK platform. This tutorial is targeting Android 4.3.1 and above.


Download and Extract Android NDK

Download the installer:
android-ndk-r10c-windows-x86_64.exe
or
android-ndk-r10c-windows-x86.exe

Android NDK download page.

Extract to any location. The tutorial uses C:/android_ndk/

Download Qt Creator for Android

Download the package:
Qt 5.3.2 for Android (Windows 32-bit, 817 MB) (Info).

Qt Creator download page.

Install Qt Creator for Android

Open up the setup.


Select the folder to install.


Select Components. 
Make sure to install Tools -> MinGW 4.8.2. 
Also select targets for Android x86 or Android armv5 or Android armv7(Recommended)


Select the License Agreement. If have trouble selecting read this: Qt Creator Tutorial Z1 - Licenses.


Name the application.


Finally install.


Saturday, 18 October 2014

Simple Tutorials - Qucs DC Simulation

Qucs

Qucs is an open source integrated circuit simulator. The tutorial is just a simple DC simulation.

Tutorial

Open up Qucs!


Select Components on the left tab.


Drag components you want.


Edit components properties by double clicking.



Select sources from drop down on top left.


Add DC voltage sources or DC current sources.


Complete the circuit by selecting wire on the top tool bar.



Select simulations from drop down on top left.


Add DC simulation.


Start simulation by clicking Simulation -> Calculate DC bias.




Qt Creator Tutorial P2 - Install

Installation

First figure out what target platform you want. This might help you: Qt Creator Tutorial P1 - Introduction


Targeting Android
This tutorial will help you deploy applications on Android with QML and C++. The tutorial is designed for a Windows development environment. An Android device is required.

Qt Creator Android Tutorial A1 - Install


Targeting IOS



Targeting GNU/Linux
This tutorial is about Qt Widgets and C++ on GNU/Linux. The tutorial is not specific to any GNU/Linux distribution.

Qt Creator GNU/Linux Tutorial L1 - First Project

Thursday, 16 October 2014

OS Adventures - Haiku OS

This not a review. It is just a first impression.

Haiku OS

Haiku OS Alpha 4.1 is an interesting OS. Haiku OS is the open source version of BeOS(discontinued) that has a hybrid kernel. Haiku OS has large influences from BeOS and Unix. For example: Haiku OS's GUI resembles E17.



 Haiku OS's GUI. Virtualbox.


E17 on Linux.

Haiku OS has some graphical glitches with BSnow. This is the result of being in an alpha stage. On the other hand, Haiku OS's terminal seems to be working fine.

Here, I am toying around with some demos.

Wonderbrush a graphical paint program.

OpenGL teapot demo with 684 FPS.

Haiku OS has graphical potential. I only gave it 9 MB of video memory and it seems to be performing well. I would like to see more OpenGL games on Haiku OS.

Resource usage on Haiku OS.

The total memory(includes cache) used is 172.41 MiB.
This is compatible to Windows 7 Professional fresh install(950 MiB) and Debian 7.6 with E17(190 MiB).


Haiku OS has a lot of potential. Some day, it might stand up to the other open source OSes.






Wednesday, 15 October 2014

Qt Creator Tutorial P1 - Introduction

Introduction

This tutorial is based on Qt Creator 3.2.2, Qt 5.3.2.



Qt Creator is tool for building cross-platforms GUIs with C++,JavaScript, QML , ..etc.
First thing is to install Qt Creator and the dependencies. Qt Creator depends on GCC or MinGW or Visual Studio or Clang.

Compiler Choices

There are many compiler choices for Qt Creator. Here are the summaries of each compiler.

GCC
GNU Compiler Collection is GPLv3 compiler collection. It is primarily for GNU/Linux distributions.
Kernel API tied mostly to Unix or Unix-like OSes.

Licence: GPLv3
Platforms: GNU/Linux , open source BSDs (FreeBSD,OpenBSD, ...etc) , Windows (Cygwin), Mac OS X

Advantages:
Mature
GPLv3
Optimized
Fast
Available on all GNU/Linux repositories
Targets embed devices(ARM processors)

Disadvantages:
Not easy to install on Windows(Cygwin)
Large size
GPLv3

Recommendation:
Use GCC if you are on a GNU/Linux distributions or targeting embed devices.

MinGW
MinGW is the port of GCC on to Windows. Implements WinAPI instead of a Unix/Unix-like API.
MinGW w64 is the 64 bit version with a larger implementation of WinAPI.

Licence: GPL(MinGW) LGPLv2(MinGW w64)
Platforms: Windows and Wine.

Advantages:
Stable
GPL
Pre-built binaries for Windows
Smaller package than Cywgin

Disadvantages:
Incomplete implementation of WinAPI
Only supports OpenGL

Recommendation:
Install this on a Windows machine. Easiest package to install on a Windows machine.

Visual Studio
Visual Studio is provided by Microsoft as a development tool for .NET. However,Visual Studio could compile Qt applications.

Licence: Proprietary
Platform: Windows

Advantages:
Mature
.NET API
Support
Pre-built binaries for Windows

Disadvantages:
Some versions might be expensive
.NET runtime
Large package

Recommendation:
Use this route only if you require access to the .NET APIs.

Clang
Compiler suite front end for LLVM. Built specifically for llvm. Offers a drop in replacement for GCC as Clang is compatible with GCC.

Licence: LLVM "BSD" Licence
Platforms: open source BSDs (FreeBSD,OpenBSD, ...etc) , GNU/Linux Windows , Mac OS X

Advantages:
Faster compilation than GCC
Stable
Uses less disk space for compilation than GCC
IDE API (better IDE integration)
Better error messages than GCC
LLVM "BSD" Licence

Disadvantages:
Binaries run slower than GCC
Less platforms than GCC

Recommendation:
Use clang on the open source BSDs since clang is included in the repositories by default.

Next

Qt Creator Tutorial P2 - Install