<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Programming in a small software company</title>
	<atom:link href="http://igraphicsgroup.com/blogwp/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://igraphicsgroup.com/blogwp</link>
	<description>It&#039;s all about making my customers happy</description>
	<lastBuildDate>Thu, 06 Oct 2011 17:52:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>First time using WPF for a real application</title>
		<link>http://igraphicsgroup.com/blogwp/2011/10/06/first-time-using-wpf-for-a-real-application/</link>
		<comments>http://igraphicsgroup.com/blogwp/2011/10/06/first-time-using-wpf-for-a-real-application/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 17:52:46 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2011/10/06/first-time-using-wpf-for-a-real-application/</guid>
		<description><![CDATA[Last month I was given a task to create a small application for viewing and marking up graphical data.&#160; This data is provided by a set of web services. This is a Windows only application, so I decided to use C# and WPF.&#160; The C# web service support was the deciding factor; I’ve used it [...]]]></description>
			<content:encoded><![CDATA[<p>Last month I was given a task to create a small application for viewing and marking up graphical data.&#160; This data is provided by a set of web services.</p>
<p>This is a Windows only application, so I decided to use C# and WPF.&#160; The C# web service support was the deciding factor; I’ve used it in the past and it’s quite painless.&#160; If I had decided on C++, I would have spent several hours building soap wrappers.</p>
<p>The pleasant surprises were how quickly the WFP UI came together and the ease that background operation integrated with the UI.</p>
<p>I really enjoy editing the UI in XML as opposed to using the GUI.&#160; It kind of reminded me of the dark old days when we would hand craft Dialog Boxes in the .rc files.&#160; Overall, the development experience was very nice.</p>
<p>The worker thread integration was my second nice surprise.&#160; My Click Events simply create a delegate, and then call BeginInvoke.&#160; </p>
<p>The only gotcha is that updating UI Object from the BG thread is a no-no.&#160; Here is the pattern that I used to handle it:</p>
<pre class="csharpcode"><span class="rem">// Update a TextBox Message</span>
<span class="kwrd">private</span> <span class="kwrd">delegate</span> <span class="kwrd">void</span> UpdateTextBoxDel(<span class="kwrd">string</span> strText);
<span class="kwrd">private</span> <span class="kwrd">void</span> UpdateTextBox(<span class="kwrd">string</span> strText)
{
    txtView.Text = strText;
}
<span class="kwrd">private</span> <span class="kwrd">void</span> DoUpdateTextBox(<span class="kwrd">string</span> strText)
{
    <span class="kwrd">if</span>(txtView.Dispatcher.CheckAccess())
    {
        UpdateTextBox(strText);
    }
    <span class="kwrd">else</span>
    {
        <span class="rem">// Invocation required</span>
        UpdateTextBoxDel del = <span class="kwrd">new</span> UpdateTextBoxDel(UpdateTextBox);
        txtView.Dispatcher.Invoke(DispatcherPriority.Normal, del, strText);
        }
    }</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Not too bad, and works like a champ!</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2011/10/06/first-time-using-wpf-for-a-real-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows x64, a story about porting</title>
		<link>http://igraphicsgroup.com/blogwp/2011/07/14/windows-x64-a-story-about-porting/</link>
		<comments>http://igraphicsgroup.com/blogwp/2011/07/14/windows-x64-a-story-about-porting/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 19:40:23 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2011/07/14/windows-x64-a-story-about-porting/</guid>
		<description><![CDATA[We’ve finished a “port” of one of our larger Windows/Linux projects from Visual Studio 2003, to Visual Studio 2010(sp1) in order to create a Windows x64 version. We had stayed with Visual Studio 2003 due to the performance advantage.&#160; Visual Studio 2005, and 2008 both generated slower binaries.&#160; Also, we were required to maintain support [...]]]></description>
			<content:encoded><![CDATA[<p>We’ve finished a “port” of one of our larger Windows/Linux projects from Visual Studio 2003, to Visual Studio 2010(sp1) in order to create a Windows x64 version.</p>
<p>We had stayed with Visual Studio 2003 due to the performance advantage.&#160; Visual Studio 2005, and 2008 both generated slower binaries.&#160; Also, we were required to maintain support for Windows 98 and 2000!</p>
<p>Now we’re finally biting the bullet and saying that Windows XP(SP3) (or XPx64 SP2) is the minimum supported platform.</p>
<p>Performance Numbers for our “rule of thumb” benchmark:</p>
<ul>
<li>Visual Studio 2003 (x86)</li>
<ul>
<li>Time: 117.497235 ms</li>
<li>Time: 1136.909457 ms</li>
<li>Time: 126.083901 ms</li>
<li>Time: 1133.747273 ms</li>
</ul>
<li>Visual Studio 2010 (x86) with PGO</li>
<ul>
<li>Time: 112.262443 ms</li>
<li>Time: 893.446397 ms</li>
<li>Time: 129.282765 ms</li>
<li>Time: 882.757780 ms</li>
</ul>
<li>Visual Studio 2010 (x64) with PGO</li>
<ul>
<li>Time: 108.315252 ms</li>
<li>Time: 880.750309 ms</li>
<li>Time: 137.448487 ms</li>
<li>Time: 885.515196 ms</li>
</ul>
</ul>
<p>Without PGO, the execution times for Visual Studio 2010 are 25% longer.&#160; So, PGO is well worth doing!</p>
<h2>How we did the port</h2>
<p>The process itself was fairly painless.&#160; We started by updating all out 3rd party libraries: boost, Qt, etc.&#160; Then we converted each of our projects to VS2010.&#160; After converting them, we reviewed the project files to ensure that we understood each and every setting that was being applied.&#160; This seemed to be the longest part of the process!</p>
<p>We did think about using qmake to abstract the build process another level.&#160; The rewards just didn’t outweigh the effort.&#160; We have a set of makefiles for Linux already, and we’re stuck with VS2010 for the conceivable future.</p>
<p>After the x86 projects were converted, we built and fixed a handful of issues from VS2003 being a bit more forgiving than VS2010.&#160; We also added a number of #pragma’s around code blocks to prevent warnings that were understood, but not wanted.&#160;&#160; </p>
<p>Adding a x64 Target was accomplished by several clicks, followed by another trip through the project files.&#160; </p>
<p>Building the x64 version ended up being fairly painless.&#160; We had to replace some x86 assembly:</p>
<pre class="csharpcode">align 16
    <span class="kwrd">public</span>  _AFTOL@8
_AFTOL@8:
    fld     qword ptr FVAL
    fistp   dword ptr IVAL
    mov     eax, IVAL
    ret     RETSIZE

inline <span class="kwrd">int</span> iFTOL(<span class="kwrd">double</span> d)
{
    <span class="kwrd">return</span> _mm_cvttsd_si32(_mm_load_sd(&amp;d));
}</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>We also discovered that fopen() under VS2010 is much more strict than fopen() under VS2003 (unit tests are worth their weight in gold).&#160; Yes we still use FILE’s, our testing shows that they are faster than HANDLE’s for file IO (likely because they buffer in User mode memory).</p>
<p>The entire process was fairly easy, but also time consuming.&#160; Our codebase is over 1 MLOC.&#160; From start to beta was 6 man weeks including unit testing, manual testing, and building the PGO scripts.</p>
<p>The wisdom I can pass along is to plan your port, take your time, and invest in unit tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2011/07/14/windows-x64-a-story-about-porting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt, what next?</title>
		<link>http://igraphicsgroup.com/blogwp/2011/05/31/qt-what-next/</link>
		<comments>http://igraphicsgroup.com/blogwp/2011/05/31/qt-what-next/#comments</comments>
		<pubDate>Tue, 31 May 2011 18:54:04 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2011/05/31/qt-what-next/</guid>
		<description><![CDATA[My experiment with Mono for Android was going quite well when Attachmate decided to fire the entire development team.&#160; That didn’t scare me, I had a feeling that they would pop up again.&#160; What made me pause was the thought of what Nokia might do.&#160; I realize that this is old news.&#160; At the time [...]]]></description>
			<content:encoded><![CDATA[<p>My experiment with Mono for Android was going quite well when Attachmate decided to fire the entire development team.&#160; That didn’t scare me, I had a feeling that they would <a href="http://ostatic.com/blog/mono-continues-without-novell-attachmate" target="_blank">pop up again</a>.&#160; What made me pause was the thought of what Nokia might do.&#160; </p>
<p>I realize that this is old news.&#160; At the time it happened I hadn’t been giving Qt much thought.</p>
<p>Nokia purchased Trolltech (the makers of Qt) a while ago.&#160; The vision was to use Qt to provide an enterprise wide SDK for all the Nokia mobile OS’s.&#160; This was to include the old Symbian, as well as MeeGo.&#160; </p>
<p>The Nokia/Microsoft press release read: “Microsoft development tools will be used to create applications to run on Nokia Windows Phones, allowing developers to easily leverage the ecosystem’s global reach. “</p>
<p>IMHO, there is absolutely no business reason for Nokia to hang on to Trolltech.&#160; Qt makes it entirely too easy to create multi-platform applications for Windows, Mac, Linux and Mobile Platforms; but not Windows Phone 7.</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2011/05/31/qt-what-next/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android: MonoDroid and Sybase UltraliteJ</title>
		<link>http://igraphicsgroup.com/blogwp/2011/05/03/android-monodroid-and-sybase-ultralitej/</link>
		<comments>http://igraphicsgroup.com/blogwp/2011/05/03/android-monodroid-and-sybase-ultralitej/#comments</comments>
		<pubDate>Tue, 03 May 2011 20:25:45 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/?p=51</guid>
		<description><![CDATA[Yes, it would be easier to use Java.&#160; This is research, which means I’m not getting paid for it, so I can do what I like. The main reason for using MonoDroid is that several of my OEMs know C# and have large code bases.&#160; Providing a path to reuse the existing code is a [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, it would be easier to use Java.&#160; This is research, which means I’m not getting paid for it, so I can do what I like.</p>
<p>The main reason for using MonoDroid is that several of my OEMs know C# and have large code bases.&#160; Providing a path to reuse the existing code is a big win.</p>
<p>My goal is to use the Sybase UltraliteJ (SQL Anywhere v12) with a MonoDroid application.&#160; This will include Connecting, Querying, Adding records and syncing with a PC Database server.&#160; This will show an ability to load data to the device from a Database Server, go offline, edit the data, reconnect and sync the data back to the Server.</p>
<p>This is useful for “airplane mode”, going into the field where there is limited to no connectivity, and data security.</p>
<h2>Getting started</h2>
<p>I have the Java, Android SDK, Visual Studio 2010, MonoDroid and Sybase 12.01 installed.</p>
<p>Create a MonoDroid Project, build it and make sure that it runs!&#160; I’m using an Android Tablet for my testing, though an emulator would work fine.</p>
<h2>Setup Sybase UltraliteJ</h2>
<p>Copy the files from “C:\Program Files\SQL Anywhere 12\UltraLite\UltraLiteJ\Android” to my project folder.&#160; Yes, I didn’t have to do this.&#160; I want to have everything in the same place so I can stuff it into subversion.</p>
<p>Rename the ‘ARM’ folder to ‘armeabi’.&#160; This is important!&#160; By doing this, we inform the Mono compiler that the ABI for the shared libraries is armeabi.</p>
<p>Add a folder to the Visual Studio project named armabi, and add the shared object to it.</p>
<p>For each shared library, set the properties: ‘Build Action’ to AndroidNativeLibrary.</p>
<p>Add the UltraLiteJNI12.jar file to the project.&#160; Set the properties: ‘Build Action’ to AndroidJavaSource.</p>
<p>Create a new Java file.&#160; I named mine jni_helper.java.&#160; Add this to the project and Set the properties: ‘Build Action’ to AndroidJavaSource.</p>
<p>Now we’re ready to start adding code.</p>
<h2>Build the JNI Layer</h2>
<p>At some point in time MonoDroid is going to have a tool for using arbitrary Jar files.&#160; There isn’t one now, so we’ll have to use JNI to talk to UltraliteJ.&#160; Greg Shackles has a good <a href="http://www.gregshackles.com/2011/02/using-admob-in-a-monodroid-application/" target="_blank">blog entry</a> about this.&#160; I used the same style (and shameless copied his code!), which is using class static methods.&#160; My test application is database driven, so this is a good model.</p>
<p>To start, I created a Java class with connect, disconnect and isConnected static methods.</p>
<pre class="code">package monoultralite.helper;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.util.Log;
import com.ianywhere.ultralitejni12.*;

public class jni_helper {
    private static final String TAG = &quot;jni_helper&quot;;
    private static Connection conn_ = null;

    private jni_helper()
    {}

    public static void connectDB(android.app.Activity act)
    {
        Log.v(TAG, &quot;connectDB: E&quot;);     

        try {
            Log.v(TAG, &quot;connectDB: DatabaseManager.createConfigurationFileAndroid&quot;);
            ConfigFileAndroid config = DatabaseManager.createConfigurationFileAndroid(&quot;MonoUltralite.udb&quot;, act);

            // Connect, or if the database does not exist, create it and connect
            try {
                Log.v(TAG, &quot;connectDB: DatabaseManager.connect&quot;);
                conn_ = DatabaseManager.connect(config);
            } catch (ULjException e) {
                Log.v(TAG, &quot;connectDB: DatabaseManager.createDatabase(config)&quot;);
                conn_ = DatabaseManager.createDatabase(config);
            }
        } catch (ULjException e) {
            conn_ = null;
            Log.v(TAG, &quot;connectDB: **catch** cannot create DB&quot;);
        }

        Log.v(TAG, &quot;connectDB: X&quot;);
    }

    public static void disconnectDB()
    {
        Log.v(TAG, &quot;disconnectDB: E&quot;);
        if (null != conn_) {
            Log.v(TAG, &quot;disconnectDB: DatabaseManager.release&quot;);
            try {
                DatabaseManager.release();
            } catch (ULjException e) {
                Log.v(TAG, &quot;disconnectDB: **catch** DatabaseManager.release&quot;);
            }
            conn_ = null;
        }
        Log.v(TAG, &quot;disconnectDB: X&quot;);
    }

    public static boolean isConnected()
    {
        Log.v(TAG, &quot;isConnected: E&quot;);
        boolean fConnected = false;
        if (null != conn_) {
            fConnected = true;
            Log.v(TAG, &quot;isConnected: IsConnected&quot;);
        }

        if(fConnected)
            Log.v(TAG, &quot;isConnected: Return true&quot;);
        else
            Log.v(TAG, &quot;isConnected: Return false&quot;);
        return fConnected;
    }
}</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>This will be used by this C# class:</p>
<pre class="code"><span style="color: blue">public static class </span><span style="color: #2b91af">MonoUltraliteHelper
    </span>{
        <span style="color: blue">private static </span><span style="color: #2b91af">IntPtr </span>_helperClass = <span style="color: #2b91af">JNIEnv</span>.FindClass(<span style="color: #a31515">&quot;monoultralite/helper/jni_helper&quot;</span>);

        <span style="color: green">//  Generate Sigs with: javap -classpath &quot;C:\Program Files (x86)\Android\android-sdk\platforms\android-8\android.jar;UltraLiteJNI12.jar&quot; -s -p jni_helper
        </span><span style="color: blue">public static void </span>connectDB(<span style="color: #2b91af">Activity </span>act)
        {
            <span style="color: #2b91af">IntPtr </span>methodId = <span style="color: #2b91af">JNIEnv</span>.GetStaticMethodID(_helperClass, <span style="color: #a31515">&quot;connectDB&quot;</span>, <span style="color: #a31515">&quot;(Landroid/app/Activity;)V&quot;</span>);
            <span style="color: blue">if </span>(<span style="color: blue">null </span>!= methodId)
                <span style="color: #2b91af">JNIEnv</span>.CallStaticVoidMethod(_helperClass, methodId, <span style="color: blue">new </span><span style="color: #2b91af">JValue</span>(act));
        }

        <span style="color: blue">public static void </span>disconnectDB()
        {
            <span style="color: #2b91af">IntPtr </span>methodId = <span style="color: #2b91af">JNIEnv</span>.GetStaticMethodID(_helperClass, <span style="color: #a31515">&quot;disconnectDB&quot;</span>, <span style="color: #a31515">&quot;()V&quot;</span>);
            <span style="color: blue">if </span>(<span style="color: blue">null </span>!= methodId)
                <span style="color: #2b91af">JNIEnv</span>.CallStaticVoidMethod(_helperClass, methodId);
        }

        <span style="color: blue">public static </span><span style="color: #2b91af">Boolean </span>isConnected()
        {
            <span style="color: #2b91af">Boolean </span>ret = <span style="color: blue">false</span>;
            <span style="color: #2b91af">IntPtr </span>methodId = <span style="color: #2b91af">JNIEnv</span>.GetStaticMethodID(_helperClass, <span style="color: #a31515">&quot;isConnected&quot;</span>, <span style="color: #a31515">&quot;()Z&quot;</span>);
            <span style="color: blue">if </span>(<span style="color: blue">null </span>!= methodId)
                ret = <span style="color: #2b91af">JNIEnv</span>.CallStaticBooleanMethod(_helperClass, methodId);
            <span style="color: blue">return </span>ret;
        }
    }</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<div class="csharpcode">&#160;</div>
<p>The method signatures are generated via javap: </p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<pre class="csharpcode">javac jni_helper.java
javap -s -p jni_helper
Compiled from <span class="str">&quot;jni_helper.java&quot;</span>
<span class="kwrd">public</span> <span class="kwrd">class</span> monoultralite.helper.jni_helper extends java.lang.Object{
<span class="kwrd">private</span> <span class="kwrd">static</span> final java.lang.String TAG;
  Signature: Ljava/lang/String;
<span class="kwrd">private</span> <span class="kwrd">static</span> com.ianywhere.ultralitejni12.Connection conn_;
  Signature: Lcom/ianywhere/ultralitejni12/Connection;
<span class="kwrd">private</span> monoultralite.helper.jni_helper();
  Signature: ()V
<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> connectDB(android.app.Activity);
  Signature: (Landroid/app/Activity;)V
<span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> disconnectDB();
  Signature: ()V
<span class="kwrd">public</span> <span class="kwrd">static</span> boolean isConnected();
  Signature: ()Z
<span class="kwrd">static</span> {};
  Signature: ()V
}</pre>
<p>This keeps us from having “method not found” exceptions!</p>
<h2>First GUI</h2>
<p>I added a few buttons that call the static methods to test the App-&gt;JNI-&gt;JAR-&gt;Shared Object.</p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<pre class="code">[<span style="color: #2b91af">Activity</span>(Label = <span style="color: #a31515">&quot;MonoUltralite&quot;</span>, MainLauncher = <span style="color: blue">true</span>, Icon = <span style="color: #a31515">&quot;@drawable/icon&quot;</span>)]
    <span style="color: blue">public class </span><span style="color: #2b91af">UltraliteActivity1 </span>: <span style="color: #2b91af">Activity
    </span>{
        <span style="color: blue">int </span>count = 1;
        <span style="color: #2b91af">JValue </span>obj = <span style="color: #2b91af">JValue</span>.Zero;

        <span style="color: blue">protected override void </span>OnCreate(<span style="color: #2b91af">Bundle </span>bundle)
        {
            <span style="color: blue">base</span>.OnCreate(bundle);

            <span style="color: green">// Set our view from the &quot;main&quot; layout resource
            </span>SetContentView(<span style="color: #2b91af">Resource</span>.<span style="color: #2b91af">Layout</span>.Main);

            <span style="color: green">// Get our button from the layout resource,
            // and attach an event to it
            </span><span style="color: #2b91af">Button </span>button = FindViewById&lt;<span style="color: #2b91af">Button</span>&gt;(<span style="color: #2b91af">Resource</span>.<span style="color: #2b91af">Id</span>.MyButton);
            button.Click += <span style="color: blue">delegate </span>{ button.Text = <span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;{0} clicks!&quot;</span>, count++); };

            <span style="color: #2b91af">Button </span>buttonConnect = FindViewById&lt;<span style="color: #2b91af">Button</span>&gt;(<span style="color: #2b91af">Resource</span>.<span style="color: #2b91af">Id</span>.MyButtonConnect);
            buttonConnect.Click += <span style="color: blue">delegate
                </span>{
                    <span style="color: blue">if</span>(!<span style="color: #2b91af">MonoUltraliteHelper</span>.isConnected())
                        <span style="color: #2b91af">MonoUltraliteHelper</span>.connectDB(<span style="color: blue">this</span>);
                };

            <span style="color: #2b91af">Button </span>buttonDisconnect = FindViewById&lt;<span style="color: #2b91af">Button</span>&gt;(<span style="color: #2b91af">Resource</span>.<span style="color: #2b91af">Id</span>.MyButtonDisconnect);
            buttonDisconnect.Click += <span style="color: blue">delegate
                </span>{
                    <span style="color: blue">if </span>(<span style="color: #2b91af">MonoUltraliteHelper</span>.isConnected())
                        <span style="color: #2b91af">MonoUltraliteHelper</span>.disconnectDB();
                };

            <span style="color: #2b91af">Button </span>buttonSync = FindViewById&lt;<span style="color: #2b91af">Button</span>&gt;(<span style="color: #2b91af">Resource</span>.<span style="color: #2b91af">Id</span>.MyButtonSync);
            buttonSync.Click += <span style="color: blue">delegate </span>{ button.Text = <span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;{0} clicks!&quot;</span>, count++); };
        }
    }   </pre>
<p><font face="Arial">As you see, the Query and Sync buttons don’t do anything yet.</font></p>
<p>Building any running confirms that the C# code may easily call into Java code, which may use a native library.&#160; It ended up being fairly simple to build this.</p>
<h2>Update May 6:</h2>
<p>The Disconnect Native method was not implemented in the 12.0.1 release of UltraliteJ, I’ve reported it to Sybase and they tell me it’ll be fixed.</p>
<p>The bigger news is that MonoDroids’ future may be in doubt.&#160; The Novel sale has resulted in an unknown number of Mono developers being let-go.&#160; This leaves the future of MonoDroid in doubt to me; until their is an official announcement I’m going to hold off on my MonoDroid research.</p>
<p>I have no doubt that I can get the UltraliteJ database syncing to a Sybase server and executing local queries and such.&#160; The JNI part is the “magic” that makes this go.&#160; Even that isn’t too challenging with the help of javap.</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2011/05/03/android-monodroid-and-sybase-ultralitej/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Mono, MonoDroid and Windows</title>
		<link>http://igraphicsgroup.com/blogwp/2011/03/30/c-mono-monodroid-and-windows/</link>
		<comments>http://igraphicsgroup.com/blogwp/2011/03/30/c-mono-monodroid-and-windows/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 17:43:17 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2011/03/30/c-mono-monodroid-and-windows/</guid>
		<description><![CDATA[Woot! had a sale on Viewsonic gTablets last week and I couldn’t resist.&#160; The gTablet is built with the NVIDIA Tegra 2 and has a dual core A9 processor.&#160; Battery life is “ok”, I see about 4 hours with Wi-Fi enabled. My previous tablet (a wow! pad) was unable to connect to my development system [...]]]></description>
			<content:encoded><![CDATA[<p>Woot! had a sale on Viewsonic gTablets last week and I couldn’t resist.&#160; The gTablet is built with the NVIDIA Tegra 2 and has a dual core A9 processor.&#160; Battery life is “ok”, I see about 4 hours with Wi-Fi enabled.</p>
<p>My previous tablet (a wow! pad) was unable to connect to my development system via USB.&#160; This coupled with a Google Wi-Fi ADB bug prevented me from debugging MonoDroid using the Visual Studio debugger.&#160; DDMS worked, but wasn’t nearly as nice to use.</p>
<p>Anyway, I moved forward on a proof of concept to see just how much code I could share between Windows, Linux and Android.</p>
<p>My testing was done using Visual Studio 2010, .NET 4, Mono 2.1 on Suse, and MonoDroid (9779).</p>
<p>I was extremely pleased on the code sharing between Windows and Linux.&#160; I managed to share 99.9% of my UI (Windows Forms), Network (SOAP calls), and Rendering (using OpenTK).&#160; The only issue I ran into was the Microsoft generated web service wrapper, which would not run under Mono unless I set the Nullable = false.</p>
<p>I had high hopes for the MonoDroid version, but these died fast.&#160; </p>
<p>The Android Activity is different enough to require custom code.&#160; This wasn’t too bad, I kind of expected that.</p>
<p>The SOAP code worked, which was nice.</p>
<p>The rendering code is where I got a dose of reality.&#160; I expected OpenTK to provide the same interface for OpenGL ES as it provided for the standard OpenGL (in hindsight, I should have known better).&#160; Well, that isn’t the case.</p>
<p>For example; if I want to render a yellow triangle using OpenTK under Windows or Linux, I would do this:</p>
<div class="csharpcode">
<pre class="alt">GL.Color3(Color.Yellow);</pre>
<pre>GL.Begin(BeginMode.Triangles);</pre>
<pre class="alt">    GL.Vertex2(0.0, 0.0);</pre>
<pre>    GL.Vertex2(1.0, 0.0);</pre>
<pre class="alt">    GL.Vertex2(0.5, 1.0);</pre>
<pre>GL.End();            </pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>Using OpenGL ES, you would do something like this:</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">float</span>[] vertices = {</pre>
<pre>    0.0f, 0.0f,</pre>
<pre class="alt">    1.0f, 0.0f,</pre>
<pre>    0.5f, 1.0f };</pre>
<pre class="alt">&#160;</pre>
<pre>GL.Color4(255, 255, 0, 255);</pre>
<pre class="alt">GL.VertexPointer(2, All.Float, 0, square_vertices);</pre>
<pre>GL.EnableClientState(All.VertexArray);                        </pre>
<pre class="alt">GL.DrawArrays(All.Triangles, 0, 4);</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p>So, the rendering code would need to be specialized for the ES API.&#160; This is a bit of a bummer.</p>
<p>I checked back into the Qt Lighthouse (Android) project it has progressed a bit.&#160; For example Qt Creator is up and running, and there is a system wide shared Qt .so installer.&#160; But, it still seems a bit young for commercial development right now.</p>
<p>My current mindset is that MonoDroid will <strong>help</strong> get a Desktop App over to Android, but will require a great deal of custom code (which means more testing).</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2011/03/30/c-mono-monodroid-and-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Visual Studio 2010</title>
		<link>http://igraphicsgroup.com/blogwp/2011/03/18/fun-with-visual-studio-2010/</link>
		<comments>http://igraphicsgroup.com/blogwp/2011/03/18/fun-with-visual-studio-2010/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 10:39:23 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2011/03/18/fun-with-visual-studio-2010/</guid>
		<description><![CDATA[Last week the *first* service pack for Visual Studio 2010 (VC10) has been released.&#160; This is exciting because now we can (finally) build a working x64 Qt with it!&#160; The initial release of VC10 would create buggy x64 release binaries. As a background task, we’re porting a large codebase from Visual Studio 2003 (VC7.1) to [...]]]></description>
			<content:encoded><![CDATA[<p>Last week the *first* service pack for Visual Studio 2010 (VC10) has been released.&#160; This is exciting because now we can (finally) build a working x64 Qt with it!&#160; The initial release of VC10 would create buggy x64 release binaries.</p>
<p>As a background task, we’re porting a large codebase from Visual Studio 2003 (VC7.1) to VC10 in order to create a x64 version.&#160; Yes we could have used Visual Studio 2008, but we wanted to use the latest and greatest.</p>
<p>We’ll still build the x86 version using VC7.1, since we have customers who use Windows 2000.&#160; Actually, the code base still supports Windows 98!</p>
<p>The actual VC7.1-&gt;VC10 work hasn’t been too bad.&#160; We are using “/D_CRT_SECURE_NO_WARNINGS” to disable the warnings about the “_s” functions.&#160; There were a handful of C++ classes that needed fixing to build, but nothing really bad so far.</p>
<p>The PITA for us has been getting the performance of the x86 versions to be as good as the VC7.1 x86 binaries.&#160; To do this, we’ve needed to use profile guided optimization (PGO).&#160; I don’t want to have multiple configurations within the project file, so we’re using a feature of MSBUILD to create the PGI binaries, run the profiling applications, then do the final build using PGO.</p>
<p>In our “rebuild.cmd” file we do something like this:<br />
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<pre style="width: 454px; height: 178px" class="csharpcode">SET OPT_LINK=/property:OPT_LINK=/LTCG:PGI
msbuild /m /p:Configuration=<span class="str">&quot;Release&quot;</span>;Platform=Win32 %OPT_LINK% Project.vc10.vcxproj
del *.pgc
del *.pgd
benchmark.exe
SET OPT_LINK=/property:OPT_LINK=/LTCG:PGO
msbuild /m /p:Configuration=<span class="str">&quot;Release&quot;</span>;Platform=Win32 %OPT_LINK% Project.vc10.vcxproj</pre>
<p>In the Project Settings: Linker-&gt;Command Line we have added: $(OPT_LINK).</p>
<p>So, the batch file will pass the PGI setting into MSBUILD to create the first binary.&#160; Run the benchmark to generate the .pgc files, then do the final build.</p>
<p>I view this as a much better solution than having separate targets for Release/PGI/PGO.</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2011/03/18/fun-with-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt Lighthouse and MonoDroid</title>
		<link>http://igraphicsgroup.com/blogwp/2011/01/06/qt-lighthouse-and-monodroid/</link>
		<comments>http://igraphicsgroup.com/blogwp/2011/01/06/qt-lighthouse-and-monodroid/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 05:16:48 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2011/01/06/qt-lighthouse-and-monodroid/</guid>
		<description><![CDATA[Over the past few weeks I’ve spent time with the Qt Lighthouse branch.&#160; I’m still very impressed, but, it feels to be about a year away from being useable for end-user software.&#160; This may have to do with the speed of the new Android Releases.&#160; Honeycomb (v3) should be out by the middle of April! [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few weeks I’ve spent time with the Qt Lighthouse branch.&#160; I’m still very impressed, but, it feels to be about a year away from being useable for end-user software.&#160; This may have to do with the speed of the new Android Releases.&#160; Honeycomb (v3) should be out by the middle of April!</p>
<p>As a software developer, deciding on the supported platforms and OS versions is always difficult.&#160; Obviously the more OS’s you support, the bigger the market.&#160; But, every OS adds a development, maintenance and support cost.&#160; Even supporting multiple versions of the different OS’s leads to some pain.&#160; </p>
<p>Most of the applications we develop cannot be replicated via web pages.&#160; They require fairly snappy graphics and local computation ability.&#160; We’ve have some success with rich client + fat server development; but that doesn’t scale as well as we would like.&#160; Maybe in another year or two when the cloud space settles down it’ll be a better choice.</p>
<p>The lure of Qt is the ability to rebuild and run it on multiple platforms without the configurations issues of Java (I *like* Java on the Server side, but not on the client).</p>
<p>When I started trying out Qt under Android, I was hopping that it was further along.&#160; Also, it seems that the Qt iPad branch is even farther behind.</p>
<p>In any case, this brings me to the next experiment.&#160; I had put together a proof of concept using Python as a meta language for development.&#160; The Application core would be an existing (or new) statically typed module, and the UI and business logic would be in a dynamic language.&#160; I was working in Python, so that was a good place to start.</p>
<p>I used SWIG to generate binding for a C++ module, and used Python to drive it.&#160; This ended up being a huge pain to get working.&#160; I also tried using Iron Python and an ActiveX module.&#160; This ended up being extremely easy to put together, and it worked very well.</p>
<p>Back to platform support; I decided it was time to check out MonoDroid.&#160; I cloned a VM, installed the Visual Studio 2010 plugin, and had an Android 2.2 apk running about 5 minutes later.&#160; I ran into an issue trying to deploy via the IDE, but was able to manually install and run it on a device.</p>
<p>I’ve been leery of Mono, mainly because I don’t know many (any) companies that use it for commercial software.&#160; I’ve read the <a href="http://www.mono-project.com/Companies_Using_Mono">list</a> on the mono website, and haven’t used any of that software.</p>
<p>Assuming that mono works “well enough”, it would allow us to create common modules across all the platforms that we care about:</p>
<p>
<table style="width: 240pt; border-collapse: collapse" border="0" cellspacing="0" cellpadding="0" width="320">
<colgroup>
<col style="width: 180pt; mso-width-source: userset; mso-width-alt: 8777" width="240" />
<col style="width: 60pt; mso-width-source: userset; mso-width-alt: 2925" width="80" /></colgroup>
<tbody>
<tr style="height: 15pt" height="20">
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; width: 180pt; height: 15pt; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid" class="xl65" height="20" width="240"><font color="#000000" size="3" face="Calibri">Windows XP</font></td>
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext; background-color: transparent; width: 60pt; border-top: windowtext 0.5pt solid; border-right: windowtext 0.5pt solid" class="xl65" width="80"><font color="#000000" size="3" face="Calibri">Microsoft</font></td>
</tr>
<tr style="height: 15pt" height="20">
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; height: 15pt; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65" height="20"><font color="#000000" size="3" face="Calibri">Windows 2003, Vista, 2008, 7 x86/x64</font></td>
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext; background-color: transparent; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65"><font color="#000000" size="3" face="Calibri">Microsoft</font></td>
</tr>
<tr style="height: 15pt" height="20">
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; height: 15pt; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65" height="20"><font color="#000000" size="3" face="Calibri">Windows CE</font></td>
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext; background-color: transparent; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65"><font color="#000000" size="3" face="Calibri">Microsoft</font></td>
</tr>
<tr style="height: 15pt" height="20">
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; height: 15pt; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65" height="20"><font color="#000000" size="3" face="Calibri">Windows Mobile</font></td>
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext; background-color: transparent; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65"><font color="#000000" size="3" face="Calibri">Microsoft</font></td>
</tr>
<tr style="height: 15pt" height="20">
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; height: 15pt; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65" height="20"><font color="#000000" size="3" face="Calibri">Max OS X x86/x64</font></td>
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext; background-color: transparent; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65"><font color="#000000" size="3" face="Calibri">Mono</font></td>
</tr>
<tr style="height: 15pt" height="20">
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; height: 15pt; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65" height="20"><font color="#000000" size="3" face="Calibri">Linux x86/x64</font></td>
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext; background-color: transparent; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65"><font color="#000000" size="3" face="Calibri">Mono</font></td>
</tr>
<tr style="height: 15pt" height="20">
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; height: 15pt; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65" height="20"><font color="#000000" size="3" face="Calibri">Android</font></td>
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext; background-color: transparent; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65"><font color="#000000" size="3" face="Calibri">MonoDroid</font></td>
</tr>
<tr style="height: 15pt" height="20">
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext 0.5pt solid; background-color: transparent; height: 15pt; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65" height="20"><font color="#000000" size="3" face="Calibri">iPad/iPhone</font></td>
<td style="border-bottom: windowtext 0.5pt solid; border-left: windowtext; background-color: transparent; border-top: windowtext; border-right: windowtext 0.5pt solid" class="xl65"><font color="#000000" size="3" face="Calibri">MonoTouch</font></td>
</tr>
</tbody>
</table>
<p>The major drawback is that the mobile platforms would not be able to share common UI modules (note: this was the big win for Qt).</p>
<p>But it does allow us to share the business logic, database, and network code.&#160; It also handles the 32/64 bit for us.</p>
<p>We’re definitely not going to move this way until we’ve done more homework.&#160; The story is tempting though.&#160; To imagine that a small team can leverage .Net to support just about every platform out there…</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2011/01/06/qt-lighthouse-and-monodroid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup android-lighthouse (Qt for Android)</title>
		<link>http://igraphicsgroup.com/blogwp/2010/12/07/setup-android-lighthouse-qt-for-android/</link>
		<comments>http://igraphicsgroup.com/blogwp/2010/12/07/setup-android-lighthouse-qt-for-android/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 18:42:41 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2010/12/07/setup-android-lighthouse-qt-for-android/</guid>
		<description><![CDATA[I haven’t had much time to work on interesting development projects for a while.&#160; This weekend I updated my phone to Android 2.1, and decided to try creating a simple application.&#160; I wanted to leverage my Qt experience, so I decided to try the android-lighthouse project. Development Setup I want to run apps on my [...]]]></description>
			<content:encoded><![CDATA[<p>I haven’t had much time to work on interesting development projects for a while.&#160; This weekend I updated my phone to Android 2.1, and decided to try creating a simple application.&#160; I wanted to leverage my Qt experience, so I decided to try the <a href="http://code.google.com/p/android-lighthouse/wiki/Compile">android-lighthouse</a> project.</p>
<h2>Development Setup</h2>
<p>I want to run apps on my actual phone, so I setup my development VM locally using VMware Workstation (vSphere won’t connect to a local usb device).&#160; </p>
<p>I choose Suse 11.3 as my development distro because the Android SDK needs new versions of glibc which Centos doesn’t have.</p>
<p>Once I had all the tools installed, Java configuration was a chore for some reason, I installed the Android SDK.&#160; <strong>Important: I had to install an older version of the Android SDK to get android lighthouse to work.</strong>&#160; I installed <strong>android-sdk_r06-linux_x86.tgz,</strong> then ran android and updated to SDK Platform Android 2.1-update1, API7. revision 2.</p>
<p>I can’t stress enough the importance of getting the Android SDK properly configured before starting any work with Qt Android Lighthouse!</p>
<h2>android-lighthouse</h2>
<p>I followed the instructions from <a href="http://code.google.com/p/android-lighthouse/wiki/Compile">android-lighthouse</a>.&#160; I configured my qmake.conf:</p>
<pre class="csharpcode">NDK_ROOT = /usr/local/qadk-r4

#NDK_ROOT = $(ANDROID_NDK_ROOT)

NDK_TOOLCHAIN = arm-eabi-4.4.0

ANDROID_PLATFORM = android-5 # 4 - android 1.6
                             # 5 - android 2.0 &amp; 2.1
                             # 8 - android 2.2</pre>
<h2></h2>
<p>I also updated my .basrc:</p>
<pre class="csharpcode"># Android SDK
export PATH=/usr/local/AndroidSDK/tools:/usr/local/AndroidSDK/platform-tools:$PATH

# Custom NDK
export NDK_ROOT=/usr/local/qadk-r4

# Qt <span class="kwrd">for</span> Android
export PATH=~/qt.lighthouse/bin:$PATH</pre>
<p>Then I built Qt.&#160; An hour later I was ready to test it out.</p>
<p>I edited the create_android_lighthouse_project.sh with my local paths.&#160; Next I create a folder “qttest”, and built a test app.</p>
<p>That built with no errors, so I pushed up my Qt .so’s and ran into a problem.&#160; The instructions for pushing the so’s were not actually pushing the so’s.&#160; I discovered this when the test failed on the emulator due to a missing so file.&#160; The Android ddms utility is <strong>quite</strong> helpful&#160; for seeing what is happening on the emulator! </p>
<p>My next attempt resulted in an “out of space” error.&#160; I fixed that by starting the emulator via: “emulator -avd my_avd -partition-size 512”.&#160; After that I had plenty of space on my device.</p>
<p>The small sample ran, but was boring.&#160; I copied the “examples\dialogs\tabdialog” to my test, built that, and here is the result:</p>
<p><a href="http://igraphicsgroup.com/blogwp/wp-content/uploads/2010/12/qt-android-1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="qt-android-1" border="0" alt="qt-android-1" src="http://igraphicsgroup.com/blogwp/wp-content/uploads/2010/12/qt-android-1_thumb.png" width="244" height="173" /></a></p>
<p>I shut down my emulator, and plugged in my phone (a Motorola cliq).&#160; I restarted adb as root so it could talk to my device, and ran my test successfully there.</p>
<h2>Conclusions</h2>
<p>Getting this configured and running took much longer than I expected.&#160; Getting a working development environment took me a couple of days!&#160; This was due to several factors:</p>
<ol>
<li>My choice of the Linux distro.&#160; Centos will not work, Ubuntu had strange issues with Slickedit 2009, and Suse always takes longer to configure then it should.</li>
<li>Using the current Android SDK bit me in the ass.&#160; Maybe it can be used without problems, but I couldn’t figure that out.</li>
<li>Qt Build speed.&#160; It takes 1-2 hours to build Qt before you can try a sample.&#160; Also, I had errors due to <a href="http://code.google.com/p/android-lighthouse/issues/detail?id=19">libcloog</a>, missing –lQtOpenGL, etc.&#160; These were cleaned up by re-giting the source and building from scratch.</li>
<li>Getting Sun Java 1.6 JDK configured under Suse seemed much harder than it needed to be.&#160; The whole “update-alternatives” seems like a train wreck waiting to happen.&#160; I’m sure if I did Java development I would use and like it, but I just wanted a single JDK and it bit me.</li>
</ol>
<p>Once I had it built and configured, I was impressed.&#160; At one level it’s just a library built for Arm using the NDK, at another level it’s a cross platform solution that lets me create native applications for Windows, Linux, Mac, and now Android.&#160; That’s old school impressive.&#160; </p>
<p>I had hoped that Silverlight would be this solution, but Microsoft managed to bungle that by dropping the ball on the cross platform support.&#160; If the solution is Qt, that isn’t too bad at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2010/12/07/setup-android-lighthouse-qt-for-android/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vSphere and Veeam one week later</title>
		<link>http://igraphicsgroup.com/blogwp/2010/12/04/vsphere-and-veeam-one-week-later/</link>
		<comments>http://igraphicsgroup.com/blogwp/2010/12/04/vsphere-and-veeam-one-week-later/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 17:17:43 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2010/12/04/vsphere-and-veeam-one-week-later/</guid>
		<description><![CDATA[My issue with Veeam Backup not sending emails was resolved by using a different email server.&#160; Veeam support was OK; they responded to my emails, but they don’t see too technically savvy.&#160; They do respond within a few hours though!&#160; In todays world, that makes them top 10%. Veeam is running nightly and backing up [...]]]></description>
			<content:encoded><![CDATA[<p>My issue with Veeam Backup not sending emails was resolved by using a different email server.&#160; Veeam support was OK; they responded to my emails, but they don’t see too technically savvy.&#160; They do respond within a few hours though!&#160; In todays world, that makes them top 10%.</p>
<p>Veeam is running nightly and backing up 6TB of VM’s.&#160; The ESX “dirty block” tracking does a good job, so this is taking between 30 min and 2 hours to complete.&#160; The resulting files are fairly small.</p>
<p>I tested Veeams “instant recovery”; note: this is the feature that disables NFS shares on Windows Servers.&#160; It allows you to select the backup date of the VM that you want to restore, then you pick your vSphere Server and say go.</p>
<p>After it’s restored, the VM runs off the Veeam image via NFS (read only) and you may use it directly.&#160; There is an option to store disk edits locally or on your vSphere server.</p>
<p>The restored VM runs a little slower, as you would expect, but it does work.&#160; It’s a very nice feature.</p>
<p>Sure Backup is the primary reason that I picked Veeam as my vendor.&#160; What is does is mount the backup image, boot it up inside of a private network, and verify it works (ping and script).&#160; </p>
<p>I’m running into issues with some of my VM’s because they have static IP’s.&#160; I’ll get those figured out one by one.</p>
<p>The second issue I ran into was a group of broken disks I received from Newegg.&#160; I should be getting replacements next week, so once they are in, the backup server will be fully populated.&#160; I do have confidence that the disks in the drive array now are fine.</p>
<p>The end of all this IT work is in sight now!</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2010/12/04/vsphere-and-veeam-one-week-later/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring vSphere 4.1 Backups</title>
		<link>http://igraphicsgroup.com/blogwp/2010/11/26/configuring-vsphere-4-1-backups/</link>
		<comments>http://igraphicsgroup.com/blogwp/2010/11/26/configuring-vsphere-4-1-backups/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 22:56:57 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igraphicsgroup.com/blogwp/2010/11/26/configuring-vsphere-4-1-backups/</guid>
		<description><![CDATA[Over the holiday, I finished the big office reorganization. VMware ESX (vSphere) 4.1 has operated nicely on the new Dell Server.&#160; The search for useable ESX Backup software is not going that well. Veeam Backup I started with Veeam.&#160; I’ve used their fastSCP tool, and decided to try their backup software first. Getting a price [...]]]></description>
			<content:encoded><![CDATA[<p>Over the holiday, I finished the big office reorganization.</p>
<p>VMware ESX (vSphere) 4.1 has operated nicely on the new Dell Server.&#160; The search for useable ESX Backup software is not going that well.</p>
<h2>Veeam Backup</h2>
<p>I started with Veeam.&#160; I’ve used their fastSCP tool, and decided to try their backup software first.</p>
<p><strong>Getting a price quote is next to impossible</strong>.&#160; I emailed them 3 times, and even after calling them and being assured I would have a quote – nothing.</p>
<p>Installing Veeam on my spare server went smoothly.&#160; The first backup went well, then I wanted to test the speed of the nightly backup.&#160; That failed with a strange network error.&#160; The next several tries also failed, even when I rebooted.</p>
<p>Their support department was fairly quick to respond to my request, but did not have any good solutions for the error I was seeing.</p>
<p>I moved the software to run on my backup server, that way there would not be any network issues.&#160; My backup server hosts a 12TB disk array, and that is all it does.&#160; However, it exports shares via SMB and NFS (using the Windows NFS Server).&#160; Veeam grabs UDP port 111, which prevents the Microsoft NFS Server from running.&#160; So, <strong>if you want to run Veeam on a system that exports NFS shares, you are out of luck</strong>.</p>
<p>Veeam support said that they need the port for their own internal NFS Server – so I can’t host NFS Shares on the same system that Veeam is installed on.</p>
<p>That’s aggravating, but not a deal killer.&#160; I was using the NFS share for a different backup solution (ghettoVCB).</p>
<p>Anyway, I’m about 20 hours into my first backup and only 61% complete.&#160; I have a feeling that my backup server doesn’t have the horsepower to run Veeam.</p>
<p>In any case, I’ll run the incremental backup using the block-change detection and see how long that takes.&#160; I’m hoping it’ll be useable.</p>
<h2>ghettoVCB</h2>
<p><a href="http://communities.vmware.com/docs/DOC-8760">ghettoVCB</a> is a <strong>free</strong> script that uses the ESX host to backup VM’s to a different datastore.&#160; Because you may mount a NFS share as a datastore, you have a great deal of flexibility.</p>
<p>It operates by taking a snapshot of the VM, then cloning the base disk, then rolling back the snapshot.&#160; So, you can backup running VM’s without any problems.</p>
<p>Configuration and setup is very easy; just edit the script.</p>
<p>Running it is also easy, and it’s fast.</p>
<p>This is my fallback solution.&#160; I really want to get a “professional” backup solution that uses the block-change API.</p>
]]></content:encoded>
			<wfw:commentRss>http://igraphicsgroup.com/blogwp/2010/11/26/configuring-vsphere-4-1-backups/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.692 seconds -->
<!-- Cached page served by WP-Cache -->

