onsdag 6 oktober 2010

monodroid - bringing .net to android

There's one thing I really like with .net. And that's the hard work the guys over at novell do with bringing .net to all these non-windows platforms. I'm an old penguinista guy myself, actually since the day Red Hat released version 5.0. Thats.. a long time ago. I used to spend hours playing in the bash shell and developed small scripts in languages like awk, tcl, python .. and whatever the name was. I then started with Java for more serious applications, but at the same time got to know .net at work. Up until .net 3.0 I used to think Java was the superior, but today I don't. Perhaps because I'm using C# a lot more than Java, but I do feel that C# has evolved lightning fast while Java is kind of stuck. That is, of course, my personal opinion (and my grannys, not to forget)

Anyway, the Novell guys have brought .net to unix/linux/mac with the great mono project, and with monodevelop there's a nice IDE for all the hacking also. Now they've taken it even further with monotouch for iPhone and monodroid for the Android phones. Since I'm the proud owner of a HTC Desire, I simply need to take it for a spin.

So, I signed up for the beta, waited a day and downloaded the android-sdk for windows and installed the monodroid plugin for Visual Studio. Note that there are no tools for monodevelop yet, though it's clearly high priority to get one. I then followed the nice, you guessed right, "Hello World" tutorial over at their site, and voilá.


Pure art! And such an interesting world that evolves!

tisdag 5 oktober 2010

Lightswitch - quick screen customization

One quite nice thing with LightSwitch is the quick hack to do easy standard customization without stopping the debugger. All you need to do is click the "Customize" screen in your running application.


This will open up the customization screen where you can easily add and remove visual components from your screen. For example, it's a breeze to add simple standard buttons this way. 


And when your done, you just have to save it and pop back to your running form. Easy as .. pie!


söndag 3 oktober 2010

Lightswitch - adding relations

So, there's that old LightSwitch application of mine. Not that fancy, when do you ever need to have a frontend for an application containing only one single table?

To make the application more interesting, let's start with adding a new table. Right click the "Data source" in the Solution Explorer and choose "Add table". Give the table a good name, like "Project" and add some relevant columns like before. Also, add a column called "Category" (or whatever you prefer) and make it Int16. This one will be our "choice list". To create it, choose "Choice List" in the properties view.


A choicelist consists of a predefined value (an int in this example) and another value that will be displayed on the screen in a combobox.


Relations
When your table is ready - save all the files and start thinking about the relationship between the two tables. In my example, an administrator will administrate many projects, but to keep things simple, every project will only have one responsible administrator.
Start by clicking the "Relations" button in the top toolbar.



Design your relationship as you want it. Note the describing text at the bottom of the window, this one helps you understand the desired behaviour.


Now, after you saved your extremely intelligent relationship you will notice a new column in the "Project" table, namely "Administrator". (That is, if you created a solution like mine. If not, I won't have a clue to whatever the new column is called in your table..)
Now, we will need a better screen for displaying our application. Right click the "Screens" folder and add a new "List  and Detail" screen. Give it a good name, set the "Screen Data" to Projects and let it free!


If everything is well, you should be able to add projects with pre-defined categories and Administrators from the "Administrator" table. (Make sure to put some guys (or girls) in there).

And that's  it for today. The application is not very advanced, but is definietly closer to solve a real world scenario. Next time, I'll add some more logic into the soup!!