Thursday, October 24, 2013

I have moved.

This blog will no longer be active, you can visit my new blog Here. Thanks! John

Monday, September 23, 2013

Create blurred backgrounds with iOS 7 and Xamarin.iOS

UPDATE: This is outdated and broken. Visit my new blog here for an update on how to do this with a binding project I made.
I found this a pretty cool part of the UI in iOS 7, and here is how to do it with Xamarin.iOS.

1. The Code

Setup our UI with a controller for our initial screen, background image, and a button. We haven't added the ApplyBackgroundToButton() method yet, so don't worry. Here is what we have so far:


You can barely see the button in the center, but next we will improve that with a blur. Lets add the ApplyBackgroundToButton() to take care of that. Add this below the FinishedLaunching method. Now the real magic happens in the ApplyLightEffect method, which was originally provided by Apple as an obj-c Category. I have converted that for use within Xamarin.iOS. Warning: Scary Code You can find the original code from Apple here: http://pastebin.com/6cs6hsyQ In order for this method to work, you'll need to add a few extra bits that are not part of Xamarin.iOS. Add these somewhere in your project Because the code requires some pointers and general "unsafe" code, you'll need to add the -unsafe compiler flag to your iOS project for it to build. I bet there is a nicer way to do this, but using the method Apple provided makes for a really close copy of the what they are doing. Here is the final result:


A button with a nicely blurred background of what is underneath. You can download the project here:

Friday, July 12, 2013

OpenCork - iOS App using Xamarin.iOS and C#

Over the past few months I have been working with the Xamarin.iOS tools that I mentioned in my previous post. A colleague and I decided to create an application and get it into the market. We came up with a few ideas, but settled on what is now OpenCork. 

I like to go to wine tastings (beer too). If you have ever been to any type of tasting event, you normally receive some pamphlet to mark down your scoring of a particular beverage.  This is great because you can learn what you like and what you don't like. The problem we both have is that we always loose or discard these pamphlets and therefor loosing all of the data we had on which drinks we liked. The next time we visit a Wine & Spirits store, I never have any clue what to get, because I have no idea what I like! This is where OpenCork comes in. 

OpenCork is a tool that allows you to create a tasting for a location, build your drink selection, and if you enjoy it you can mark it as "Liked". Thats the basics in a nutshell. Now you have a traveling "pamphlet" of what you have tasted around different locations and the next time you want to grab something from a store you have tried, you just can just open the app up and look at your list of "Liked" drinks. 

Here are some screen shots of the application so far:


The app searches for a location near you and displays the results. We are slowly building our database of places that are participating with OpenCork. Eventually we would like to have a way for users to request/submit a place that is not available. 

A web service provides the data from the back end on all of the locations we currently have participating. 






Here I started a new Tasting for a location, and selected 2 drinks that I am interested in. The drinks are loaded into a database on the device, and the information is provided by the business. 















Once you are done selecting the drinks, you are ready to start rating the drink. Once you go through the tasting, you can tap the heart icon to "Like" the drink or leave it un-tapped if you do not like it. We didn't include a rating system because we felt it was more appropriate to know if you liked it (plan on buying it now or later) or you don't.






We have also included a barcode scanner so you can scan a bottle at a store and see if you have it in your "Likes" or not. You could also scan a bottle at the winery/brewery/etc to generate a barcode on your device so you wouldnt have to carry around bottles to purchase.


OpenCork is being beta tested now by some family and friends. It should be in the market soon!


Friday, May 3, 2013

C#, iOS, Android and Windows Phone. OH MY!

Back in November of 2012 I attended the Philly.NET Code Camp 2012.2 as I regularly do twice a year. For those that do not know what Code Camp is, it is a day long conference put together by Philly.NET (it's like a .NET user group in the Philadelphia region) where they hosts numerous sessions about all things .NET. It's sponsored by Microsoft and many others and lots of vendors show up to advertise all their goodies, new tech and job opportunities. When I attend Code Camp I usually pick sessions (a presentation about something .NET related) about topics I don't know or maybe sound interesting. The sessions are about 1 hour and they are usually 101 type information or quick demos. 

It's been a while so I don't remember all of the sessions I chose, but I do remember two of them. The first being a session on SignalR - a web sockets framework for .NET. Jeffrey Fritz  (I believe He was with Telerik) gave a great presentation and showed a cool demo of SignalR in action with an online multiplayer game - http://shootr.signalr.net. The second session is what I am really excited to mention, mainly because it will lead me into what I really wanted to talk about: MonoTouch. The title of the next session read on the schedule "Building iOS apps with C# and MonoTouch". I thought this sounded really cool, even though at the time I was not doing anything related to mobile development and I really was not an "Apple guy". I went to the session, which was packed, and listened Al Nyveldt talk about how it was possible to create iOS apps with C# using this thing called MonoTouch. 

Throughout the hour Al showed all of us how to create a simple app really quickly using MonoDevelop and Interface Builder. Now I had a little bit of familiarity with Mono and MonoDevelop because I had been working with the Unity3d game engine and its tools. However, MonoTouch was new to me. I thought this was really cool, and since I love C# I decided to try this out for myself. 

I tinkered around for a while and got some practice projects out of the way. A few months later things ramped up in my personal life and I had to move away from my current location and quit my job. I had to relocate and find a new career. I applied for a web developer position, which was not ideal for me because I am new to that too, but I love to learn so I thought I'd give it a go. Lucky for me though, a unique opportunity came up and I found myself staring at an employer looking for a ".NET guy that has experience with Mono to work on iOS applications". I jumped on that and was soon neck deep in MonoTouch and iOS applications (I had purchased an iPhone by this time)!

Now on to the really awesome part, Xamarin.iOS! MonoTouch/MonoDevelop was soon re-launched shortly after I started working with it for a whole new refresh of products and tools. This is branded Xamarin and you can find them at www.Xamarin.com. They provide a really awesome set of tools for developing iOS and Android apps using C# and Mono Framework. It really lets any .NET developer leverage their experience/passion with .NET and enter the mobile application space in a cross platform way. 

The thing I love most about Xamarin isn't the amazing tools they are providing, or the fact that I can use C#, it's their whole design strategy: Delighting Developers. You can instantly tell that is what they are doing when you start using their tools. They look slick, sharp and gorgeous. The tools work well (considering they are new and beta and alpha versions are constantly coming out) and are easy to use. 

They seem to be growing and they just had their first conference in Texas called Evolve 2013. I wish I could have went, but had Royal Caribbean trip planned a year ahead so I missed it. They announced some really cool features coming to the Xamarin tools including C# 5.0 support, a device testing feature called Xamarin Test Cloud and their own iOS visual designer that is supported in the IDE! I will continue to use the Xamarin products as my journey with apps continues because I think its the best way to develop an app out there. I continue to post some more on here soon with some of the things I have learned and techniques and even some sneak peeks at my current projects with Xamarin. 

Get started developing an app at www.Xamarin.com!


Saturday, April 20, 2013

Roll your own - Chessboard!

Last year I started playing chess online. I have grown to enjoy it and I still play online and I have been reading The Game of Chess by Tarrasch. I like playing online, but I really enjoy playing live with another person. When the holidays rolled around I asked my wife for a Chess board. I did the research on what I wanted and settled on a set from House of Stauton. Long story short, it turned into a big mess and their product was not the quality I wanted, nor was it the quality they advertised. I returned it and decided to make my own chessboard since I couldn't really afford to buy what I wanted retail. 

I did some research on how chessboards are made, and made some quick sketches of what I wanted. Below are some pictures of what I have started so far. 

I chose black walnut and maple for the two contrasting colored woods. Started out with two, eight foot long planks of each. 

The boards cut to 2" x 16" 


The boards were glued together and then cut in a perpendicular line to create the squares
All the boards glued together. Its going t take a lot of sanding to get it smooth.

After a few pases with the sander and its looking better already.


My next steps are to get some more wood and make a border for the board. I also need to sand it some more to get it as perfect as I can.