Archive for the ‘Platform’ Category

How to develop augmented reality apps with Vuforia for Windows 10

Windows 10 can be run on Raspberry Pi!

This is great movement by MS.

Unix programming on this kind of one board PC is interesting enough to people like me, but for most of people, if things can be developed as Windows app, it can attract more audience!

Now, because MS Windows has a build for ARM, they finally allowed to run Windows 10 on Raspberry Pi AND you can develop app with Visual Studio!

It’s great!!!!

it can be also great ‘learning’ kit for Windows device developers.
Well, I know, I know. There is no good reference book for developing Windows device drivers. MS’s own one is too old, and some info there can’t be even applied.
However, at work, your managers can be people who don’t major in Engineering or Computer Science. So, they would think like “This is S/W program, and you are a S/W engineer. Why can’t you implement it?”
it’s not usual case S/W developers put their hands on device drivers. It’s usually done by people who major in EE, not CS or CSE.
(Well, nowadays, even CSE folks can do it, because embedded programming was now included in their curriculum.)
Also, device driver development requires information about target H/w. For example, when you want to write your own mouse driver for some logitech mouse, You may not be able to get information about the target device. there are some common interface, but may not.
(Think of web cams, for which standard was not fully prepared or even though there was standard, it was difficult to get informaiton on it. – remember MACAM? )
Also, a person who never developed device driver don’t know what information he needs.

But anyway, with this kind of device, at least people can try and play. Well.. yes. You can also study such stuff with normal PC box, but Raspberry Pi would encourage you to do so more because it would not have device drivers you want use with the raspberry pi. :)

Google and their web initiatives

What I don’t like about Google is that they try to kill or diminish interest in platform native development.

At first, they weren’t. They introduced picasa program and picture-sharing chatting/SNS program. I was amazed by their insight for GUI and elegant/cute GUI design. However, they shortly decided to kill the picture sharing chatting program ( the rationale was that the program was not quite popular, as far as I remember.)
Then they reduced expose of Picasa program and promoted Picasa web service. Then they started to encourage web development and delayed their SDK development for C/C++.

I don’t like such direction. I know how current generation of developers think about native programming. However, C/C++ programming is fun and you can learn about computers and how it works more. Script language is easy to use, but also they are resource hogs and slow. Well, nowadays CPU is very fast and cost of memory goes down. Also, Google enhanced JavaScript engine and hs tried to fine tune TCP protocol for Web for better efficiency.
So, people can say web programming is the way to go.
However, I still feel limitation in web programming paradigm.
Also, although many web frameworks hides the ugly face of HTTP, but HTML/CSS/JavaScript is not really created for interactivity. Well, AJAX solves it. But still it’s like to find a way to introduce native-app like interation on top of a layer which was not designed for that.

I was a long time web developer. When one tried to become everything, it usually failed in the history of computer.

Currently, AJAX based trend looks to be better than that of PL/1 and Java, but basically I see lots of inefficiency with web based development.

Moreover, when tried to integrate Google services to a native app, it’s cumbersome, and Google don’t provide good document or sufficiently good behavior of API.
Some people would shout what I’m talking about.
Yes. Google’s documentation looks pretty and looks thourough until you actually start to work on them. You see lots of missing information and missing link, or not-so-clear explanation.
It’s better than MS documentation, but it lacks in other area.

I wish Google introduce more C/C++ based platform independent SDKs for integrating their service into native apps.

Great sample code and explanation on Text Layout with DirectWrite

When MSDN document doesn’t answer your question on how to handle DirectWrite text layout, this great blog post can help you.

What is even better is that it has fully working sample project.
The solution file can be built using Visual Studio 2013.

Marg Gregoire’s Blog : Introduction to DirectWrite




Does Windows 10 still have ‘start screen’?

On most PC tech magazines and tech blogs, they say Windows 10 brought Start menu back and got rid of ‘Start Screen’.

However, actually the answer should be ‘Yes’ and ‘No’.
Most English-speaking people I have met so far tend to consider only surface of issues, not the implication of an issue or another aspects under the surface.
I know what kind of answer they want. But if I just answer so, I know that they will not understand things correctly. On the other hands, Koreans ( not current young generations, but till the generation I’m in ) tend to understand by applying individual case which is mentioned in broader way. In other words, if one things is explained, Koreans tend to apply it for broader case and tries to figure out if it can be true for that broadened case. Then they find the optimal boundary where it can be applied.

Back to the Windows 10 stuff..
The Start menu have integrated Start Screen. So, depending on how you see it, you can say it’s still there or there is no Start Screen.

Start menu and integrated Start screen

Start menu and integrated Start screen

There is another aspect.
On desktop, you can set “Tablet mode” forcefully.
Then the Start Screen appears like Windows 8.x.

Changing to tablet mode

Changing to tablet mode


Resurrected Start screen

Resurrected Start screen

However, the reason MS brought its Start menu back in Windows 10 and thus put the precedence of Start Screen backward is that users complaint about the awkwardness of Start screen on desktop and inconvenience of not having Start menu.
So, I don’t think there will be more people to turn on tablet mode on desktop environment.
So, although the Start Screen is there, it will be more rational to say “there is no Start Screen” for most users.

Probably it’s the reason most magazines and blogs for PCs describe that Windows 10 ( for desktop ) don’t have Start Screen and superseded by new Start menu on steroid.

Android UI problem

Android Kitkat has very confusing UI. Actually, Android UI has been like this so far.

There is a ‘turn around’ button on the bottom. it means “Go back”.
However, on top of the screen there is also ‘<‘ button. Usually there was so-called a hamburger button.

Both means “Go back”. However, there is difference where it goes back. The bottom one goes back to its immediate previous screen, while the top one goes way back to a list screen.
Probably from there different view controller was spawned ( if using iOS terminology )

Isn’t it confusing?

Can’t Android Studio 1.0.1 find your JDK?

Well, as usual, I tried the latest Android toolset again.
I’ve used Eclipse with ADT so far and tried Android Studio a while ago.

However, it looks to me that Google put Android Studio in front of Eclipse.
That sounds like Android Studio is good enough to use. So, I decided to try it.
(Although I’ve used Eclipse for long time, I don’t like it. People who say Eclipse in favor say so because Eclipse has many good features. However, how to glue all of them is not good with Eclipse. Eclipse is all-round tool. I’ve used it with some VHDL open source compiler, have used for long time for C/C++ project on Linux and for Makefile analyzer on Windows. Because it has all functionality with help of plugins, it’s not good at anything. (each functionality is the best. But again, how to glue them are not good. If you don’t understand what I’m saying, try to open some sample project for Android. What’s weird is that you need to choose “Create” for opening a project. )

Anyway.. again.. I’m disappointed with Android Studio in terms of the 1st experience.
It couldn’t find where the latest JDK was installed and couldn’t find its matching VM.
Well, JDK is made by Sun/Oracle. So, there is such discrepancy. However, at least, Google people could make some “Read Me First” popping up after being installed and guide a user to configure any further setup.
However, it just displayed “Can’t find a matching VM.”

Ok.. I know that many GUI programs print out something when being launched from a terminal. So, I did it. It complaint that STUDIO_JDK environment variable is empty. Hmm.. it looks like it should point to where JDK is installed. But shouldn’t it be JAVA_HOME? After looking up Google, some said it could be solved by setting JAVA_HOME. But no luck. It may have been true with older Android Studio. (Well, currently one is 1.0.1 version, though.) So, I directly set up STUDIO_JDK from console like this.

export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk

And launched with : open /Applications/Android\

It worked!

Hey.. Google people! Why don’t you guys make the 1st experience with Android Studio better? You have some competition ( from MS with Visual Studio 2015, although theirs is based on Mono. )


A way to get out of the squirrel treadwheel

I was trying to figure out how to create ID2D1Bitmap1 instance which is to be mapped to memory region. But I found out that MSDN documentation put me in self-repeating cycle ( so, I call it squirrel treadwheel. ). In on document it says, the options can’t be used for bitmap instance created with ID2D1DeviceContext, while on the other page, the device context is to be used to create ID2D1Bitmap.

I posted this to MSDN page, ID2D1Bitmap1::Map page.


“These flags will be not be able to be used on bitmaps created by the ID2D1DeviceContext”

However on this “ID2D1Bitmap1 interface” page, it says :

Creating ID2D1Bitmap Objects

Use one of these methods to create an ID2D1Bitmap object.


It’s a squirrel’s wheelmill. Don’t you think so?
( this flags can’t be created by ID2D1DeviceContext => on other page, ID2D1Bitmap1 is created using those device context.)

Moreover, throughout Direct2D/DirectWrite and related technology pages, it’s not clear whether methods/functions returns using a parent class pointer ( like ID2D1Bitmap *) can actually return one for its child class instance like ID2D1Bitmap1. By trial and error, I found out that it’s strictly for the stated class. It’s better to be documented. ( Especially you guys are aware of that C++ has supported late binding.)

Secondly, for this issue on how to create ID2D1Bitmap1 with D2D1_MAP_OPTIONS_READ, and thus D2D1_BITMAP_OPTIONS_CANNOT_DRAW | D2D1_BITMAP_OPTIONS_CPU_READ specified in creating an instance of ID2D1Bitmap1, I found some answer here.

The post marked as “Answers”, he created an instance of ID2D1Bitmap1 using CreateBitmap() method of ID2D1DeviceContenxt. It’s opposite to what is mentioned on this page. ( for your convenience, I put it on the top. This document clearly said “These flags will not be able to be used on bitmaps created by ID2D1DeviceContext.” ) You can see that the ID2D1Bitmap1 is created using the device context’s CreateBitmap() method, and it has CPU_READ and CANNOT_DRAW option, and when Map() is called, D2D1_MAP_OPTIONS_READ is specified.

I will test this. But because people marked it as an “Answer”, I sort of believe that it works.

MSDN document is a squirrel treadwheel

D2D1_MAP_OPTIONS enumeration states that D2D1_MAP_OPTIONS_READ is not available on bitmaps created by ID2D1DeviceContext. Then, to figure out how to create ID2D1Bitmap1, which Map() can be used for, if we visit to ID2D1Bitmap1 interface page, it says “use one of these methods to create and ID2D1Bitmap object.


Didn’t it say that D2D1_MAP_OPTIONS_READ is not available for bitamps created by ID2D1DeviceContext?

Shouldn’t there be more way to create ID2D1Bitmap1?
Since 1990, MSDN document has never been good. However, after they adopted “community-based documentation” model, it became even worse. For example, some pages contain just meaningless vague information. Some pages contain sentences which can be understood in many different ways…

Come on, Microsoft people! What are you guys thinking about? Do you guys really think the MSDN document is good?
It’s also creating ID2D1Bitmap1 by “ID2D1DeviceContext”.

ID2D1*RenderTarget & Device/Device Context

Rendering with Direct2D on Windows 8

On Windows 7 and earlier, you use a ID2D1HwndRenderTarget or another render target interface to render to a window or surface. Starting with Windows 8, we do not recommend rendering by using methods that rely on interfaces like ID2D1HwndRenderTarget because they won’t work with Windows Store apps. You can use a device context to render to an Hwnd if you want to make a desktop app and still take advantage of the device context’s additional features. However, the device context is required to render content in a Windows Store apps with Direct2D.

  •  Windows 7 and earlier : ID2D1*RenderTarget are expected to be used to render drawing primitives/text etc.
  • Windows 8+ : Device context are expected to be used, because those ID2D1*RenderTargets don’t work for Windows Store apps.

Question 1: Why are classes/interfaces for drawing affected by Windows Store? Technically Windows Store is for selling S/W. They may require some, but is there any valid reason to prevent some drawing classes/interfaces from being used?

Question 2: If it’s that critical, shouldn’t there be any warning message on ID2D1*RenderTarget MSDN pages, at least on their 1st page?

Question 3: So, if you are not going to sell your S/W on Windows store infrastructure, you don’t have those restrictions, right? (Anyway Windows store doesn’t look to draw people’s attention as much as Apple’s app store. So, it will not serve as “People, you don’t know where to find your Windows app, come here!” role.


%d bloggers like this: