Saturday, November 29, 2014

.Net 4.5 Async Await for a more responsive design

Writing this so I'll remember the details. There is a good resource on the Await and Async keywords in MSDN:

The key thing is that the execution is released back to the event loop until the async method is executed and completed. So there is no blocking of the event loop causing rendering problems in the GUI.

There is a lot of arrows in the sample in MSDN but the summary is that code will go back and resume executing the "continuation" after the async method has completed. This is great for long-running processes like downloading resources.

Saturday, November 22, 2014

Installing the Android Studio Beta

Google is moving to new IDE, Android Studio. it's only in Beta right now but when released it will be the preferred IDE and you will need to merge from Eclipse.

You have to install the java development kit 6 (JDK 6) the 32-bit and the 64-bit version, it that can be found here:

Installer for the Android Studio can be downloaded here

After installing the Android studio you have to add the JDK JAVA_HOME Environment variable setting if the installer script failed to do so, follow the instructions on the site. (the path should be to 32-bit or 64-bit depending on if studio.exe or studio64.exe will be used)

Also install the Android SDK, by downloading "Get the SDK for an existing IDE" Start the SDK Manager and download according to the instructions on the web site.

Start the Studio.exe in the Android Studio unzipped folder. Set the path to the Android SDK by clicking configure | project setting | project platform and setting the path.

Now you will be able to start a New project... By creating a project you start the IDE:

Found a tutorial that describe the Android Studio here:

The UX when installing the Android Studio is really bad, hopefully it will be a lot easier to install with all the dependencies when released.

Sunday, November 02, 2014

Compiling Qt code gave: multiple definition of ...

Got an error when compiling our code:

In Windows 7 and visual studio, I at first did not notice the problem, but it was giving a warning:
LNK4042: object specified more than once; extras ignored

In Linux and gcc it gave an error, so I could not compile the code:
multiple definition of `<constructor of class>'
collect2: ld returned 1 exit status

I took som time to figure it out, but turned out to be a bad merge in subversion, 
the *.pro file had the same class twice in

HEADERS += \ Class1.h /
SOURCES += \ Class1.cpp /

Rremoving the second time the class name where entered in the *.pro file solved the problem. See