Wrap Akka Future With PlayFramework Promise
Just another quick code snippet to show how to handle a Future as a Promise in PlayFramework 2.0.3.
If you create some code in a reusable library and you want to call it from your PlayApplication you have to convert the Future to a Play Promise. Here is how to do just that.
Akka Future Code.
PlayFramework code to wrap Akka Future
PlayFramework 2.0, MongoDB and UniqueField Validation
I could not find much information on making sure a field on a mongdb document was unique when validating a playform so here is some quick code that does the job.
Im using Play-Salat to do the lookup but you could just as easily do the lookup directly.
Appcelerator Titanium Native Module Development First impressions
I was recently asked to review Appcelerator's Titanium platform to see how it compares to native iOS application development. I figured the best way to do that would be to create an iOS module for the Titanium Market Place I had a quick look and decided that I would make the UIActivityViewController available as a Titanium Module called BDActivityViewController. In a follow up post I will show how I went about creating the module along with some of the issues I encountered and some neat tricks to help with your own module development. But back to the topic at hand. How does Titanium development compare to native iOS development? I have broken it down into the areas that affect me as a developer.
Getting Started
Having given up Eclipse in favour of Intellij for my Scala development I was not looking forward to going back,
However I took the plunge and installed Titanium Studio.
Once installed you are presented with some options to install pre-configured application as samples or as templates for your own applications I found it very easy to get these applications up and running. In addition the documentation for getting started on the website is very good but a little outdated. So this process was not as painful as I thought it was going to be. However creating a module application was a little more involved. I followed the iOS Module Development Guide to create a simple template application and I was up and running in no time. I especially liked the ease with which you can quickly test your modules by simply calling >titanium run from the terminal.
Libraries
Titanium seem to have most of the iOS libraries covered but there are still some gaps in functionality and you normally have to wait up to 30 days for an official new release.
On the plus side using the Titanium Market Place means that you can access modules for platforms that you have no coding knowledge about! and if you do have the knowledge then you can create modules that fill the gaps and allow others to benefit.
IDE
The recommended way to do development is to use Titanium Studio, having used Eclipse for several years I was quickly able to get up and running, debugging and all that entails day to day development. If you have ever used Eclipse then you will feel right at home here. In addition to Eclipse you can do your coding in any editor you like and I even ended up doing most of my module test application in Sublime Text only switching over to Titanium Studio when i needed to do some debugging.
Learning Resources / Documentation
There is a lot of learning resources on the Titanium Website with good example applications and even video's. In addition there seems to be a good community on the Questions and Answers board with lots of questions being answered and not just ignored by the community. I did have some issues with exposing custom CONSTANTS as well as iOS enums to JavaScript but with some digging I was able to work it out.
Performance
From what I understand there is a slight performance penalty in using Titanium to manage your application. However if you have performance critical or bottleneck code then that is where Native Modules can help. For example if you have a computationally expensive application that needs to draw many charting components to screen whilst updating them in real time, you may not want to opt for some JavaScript library, but actually get one of your Native iOS developers to create the charting components using a native technology like OpenGL or CoreGraphics to do the rending and then expose a JavaScript API to your Titanium Application.
Community
I mentioned the Q&A forum above but appart from that I found it difficult to find much information on development. Maybe this is due to the fact you can code in plain old JavaScript, HTML and CSS so that has stopped many people blogging about it. However I was hoping for more information on Module development especially as thats the part that interests me the most.
Conclusion
I actually enjoyed developing for the Titanium platform it was a lot simpler than I initially thought it was going to be. I have experience developing a NativeAlert cross-platform module before in ActionScript to iOS and that was truly a challenge. In a follow up post I will again create a NativeAlert class but this time for Titanium covering some of the issues I had whilst creating the BDActivityViewController allowing with some helpful productivity tips to make the workflow a little easier.
If you know of any good BlogPost, Git Repositories or Tutorials for Titanium Development please leave a comment!
You can also follow me on Twitter @omnipitence
Liquid-Photo only £0.69 this week!
Liquid-Photo for ios will be at the reduced price for this week only! Get it while you can. And please retweet or share with anyone you think would like the application.
Liquid-Photo Free This weekend ( 18 May – 21 May 2012 )
To celebrate my Liquid-photo website getting hacked i have decided to give away Liquid-Photo for iOS for free this weekend. Please download and let me know what you think about the application. Also please retweet, facebook or otherwise let everyone know about the offer. You can download it here for free
Malware attack on Liquid-Photo site
I recently received a malware notification from google for my domain liquid-photo.com. It seems that somehow a malicious script managed to make it's way onto the site. I am in the process of cleaning the entire site and as such I am redirecting here to my personal Blog until I can be assured that I have totally eradicated the issue from liquid-photo.com.
I am terribly sorry if this has caused anyone issues and I hope to have the site back up and running as soon as possible. I may even take this as an opportunity to redesign both sites.
On a plus side i did find some old images I created when I was at University for some Applications, 3D Models and info graphics.
Enjoy
Liquid-Photo 1.1 for iOS brings thermal imaging and night vision
New Post over at Liquid-photo
Liquid-Photo 1.1 for iOS brings thermal imaging and night vision
LiquidPhoto Finally Available on the IOS App Store!
New Post over at Liquid-photo
LiquidPhoto Finally Available on the IOS App Store!
Liquid-Photo now available for iOS!
New Post over at Liquid-photo
Liquid-Photo now available for iOS!




