You are browsing the archive for R. Brian Lindahl.

Using DataAbstract and the RemObjects SDK with MonoTouch

October 12, 2010 in Data Abstract, iOS, MonoDevelop, MonoTouch

One of the more interesting technologies to make its way into my brain in the last year has been MonoTouch. If you’re not familiar with it, MonoTouch is a set of tools and wrappers developed by Novell, the makers of Mono. It allows you to write apps for Apple’s iOS devices – the iPhone, iPad, and iPod Touch – in various .NET languages, including of course C# but also our own Oxygene (aka Delphi Prism).

A row from a Data Abstract table in the iPhone simulatorUp until now, there haven’t been many options for connecting to online services, or for data access. This is changing dramatically, with Data Abstract for Xcode, and coming soon to an iOS device near you, the ability to connect to your existing RemObjects SDK and Data Abstract servers with .NET and MonoTouch! The first glimpse of this new feature will be available in the next Data Abstract for .NET beta drop.

Please keep in mind that this is currently a work in progress. For example, there isn’t yet a MonoTouch-specific installer – the files you need can be found in a Windows install. Also, there are no templates or other IDE features in MonoDevelop. But hey, that’s what staying on the bleeding edge is all about, right?

This article will be focusing on writing a MonoTouch client for Data Abstract (DA). I’m going to assume that you’re familiar with the basics of MonoTouch and it’s development environment, MonoDevelop. Also, the sample is currently in C# – an Oxygene version will be available soon.

The first step is getting DA (and the RemObjects SDK) onto your Mac. Copy the entire “RemObjects SDK for .NET” and “Data Abstract for .NET” folders from your windows installation over to a convenient folder on your Mac.

Start a new MonoTouch project. Now you have a choice of which way to reference the RemObjects dlls. You can either:

  • add them as .NET assemblies – browse to the /bin/Monotouch folder in both the SDK and DA folders that you copied earlier. You need RemObjects.SDK.Monotouch.dll from the former and RemObjects.DataAbstract.Monotouch.dll from the latter.
  • add the projects to your solution, and then add them as project references – look for RemObjects.SDK.Monotouch.csproj, and RemObjects.DataAbstract.Monotouch.oxygene. Note that you have to have the Delphi Prism addin for MonoDevelop to go this route.

If you’re using a Relativity server, copy the RelativityDataModule.cs from the sample into your project folder and add it to your project; otherwise, copy the DataModule.cs.

Now to set up the connections. This is how it’s set up in the sample for Relativity:

var fDataModule = new RelativityDataModule();
{ TargetURL = fSettings.RelativityTargetURL,
  DomainName = fSettings.RelativityDomain, SchemaName = fSettings.RelativitySchema,
  UserID = fSettings.UserID, Password = fSettings.UserID};

and for custom server:

var fDataModule = new DataModule()
{ TargetURL =  fSettings.CustomTargetURL,
  ServiceName = fSettings.CustomDataServiceName,
  UserID = fSettings.UserID, Password = fSettings.UserID};

To access data, you simple need to ask for the table that you want:

DataSet lDataset = new DataSet();
fDataModule.DataAdapter.Fill(lDataset, new String[] { fSettings.TableName });

All the normal DA functionality should be there – dynamic WHERE, etc. The thing that’s missing at the moment is DA LINQ – runtime code generation is not allowed by the iOS license, so DA LINQ is on hold until we figure out how to do it’s magic a different way.

Teaser – MonoDroid with Oxygene

August 20, 2010 in .NET, Android, Elements, Mono, Oxygene, Platforms, Visual Studio

Now that the MonoDroid preview is out, I thought I’d experiment a little with Oxygene (aka Delphi Prism), so I ported the “Button” sample to Oxygene. Here’s a taste of what I came up with:

method Activity1.OnCreate(bundle : Bundle);
    inherited OnCreate(bundle);
    // Create your application here
    var button := new Button(self);
    button.Text := 'Oxygene Says: Click Me!';
    button.Click += method begin
      button.Text := string.Format('{0} clicks!', count);

As you can see, there’s not a lot of difference from the C# version.

Obviously, this won’t be in the build that we RTM’ed last week, and will soon be available from our friends at Embarcadero, but it will work with said release. So if you’re a Delphi Prism customer, or just have a fondness for Pascal syntax, keep an eye out here – more info will be available soon, including templates & other support files.

method Activity1.OnCreate(bundle : Bundle);
inherited OnCreate(bundle);

// Create your application here
var button := new Button(self);

button.Text := ‘Oxygene Says: Click Me!’;
button.Click += method begin
button.Text := string.Format (‘{0} clicks!’, count);

SetContentView (button);

Dev Diary – an Introduction to Shimmer

January 18, 2010 in .NET, Mono, RemObjects, Tools

In the Mac world, there’s a great little library called Sparkle. It uses RSS feeds to facilitate the distribution of software updates, with a minimum of code required in the application. Our illustrious CEO, marc, has been talking about it for a while, and we use it internally in several of our Mac applications.

shimmerHowever, the .Net world doesn’t have anything quite like it. After some discussion about what we needed in such a library, I decided to write shimmer. It will have much of the same functionality as Sparkle does, with some additional things that are necessary for the .Net and Windows environments, as well as being able to run on Mono on most supported platforms. For the time being, it’s an internal project, that will see the light of day first in our new bug tracking client. Will it ever be released further than that? We haven’t decided yet. Let us know if you’re interested, and we’ll consider our options.

I’ll be chronicling my adventures during the design and coding process for shimmer here over the next few weeks.  I hope you’ll find it interesting. :)

Introducing Plateau for MonoTouch

November 10, 2009 in Mono

Introducing Plateau

I’ve got a new personal Open Source project – Plateau. It’s a component library for MonoTouch. See my blog post at for more information.

Happy dance for new toy

November 9, 2009 in non-tech, Personal, Platforms

my new Droid:

Chrome has a way of getting into your head…

March 30, 2005 in Personal

and affecting the rest of your life. example: my cat, Krohm… now i’ll have to explain what his name means for YEARS…


Blog? What’s a blog?

May 27, 2004 in Personal

OK, I guess I have to figure out something to write here… Actually, I’ll just leave it like this and come back and change it when there’s something important to say.