27 Mar 2011

Getting CouchDB / Couchbase Server and Flash to Play Nice Together

Flash-couchdb
I've dabble with NoSQL technology and I've found CouchDB as a very intriguing place to start. Since I mostly code in Flash I wanted to figure out a way of getting Flash to communication with CouchDB.

I was Googling and came across Todd Anderson's (blog) project on GitHub called, "as3couchdb". My only problem is that I prefer to do almost everything exclusively in Flash. I noticed Todd had an AS3 version in his example projects, but that it requires Flex because of the custom metadata at the time of compiling. So you would get an error like this,

"Error: The CouchModel instance [com.custardbelly.couchdb.example.model::ContactDatabase] must be annotated with [DocumentService] metadata tag."

I found a hack-around, so anyone else wanting to use CouchDB and within the Flash IDE can do so (assuming you have CouchDB running locally already - if not, download Couchbase Server here)...

  1. Simply create a new Flash project
  2. Download Todd's as3couchdb and getting the example BasicActionScriptExample Class under the Properties Panel -> Publish -> Class in the Flash IDE
  3. Go to your Publish Settings, and check the SWC box under Publish (make sure you do this, otherwise you will get this metadata tag error: "Error: The CouchModel instance [com.custardbelly.couchdb.example.model::ContactDatabase] must be annotated with [DocumentService] metadata tag." 
  4. The compile your project... the example should publish and work! How about that for getting started quickly?

If you have any questions feel free to leave a comment. I'm using Flash CS5 and Couchbase Server (CouchDB v 1.0.2) on a Mac.


For those interested in how I found this hack-around:


Images used above curteosy of seokchanyun & mondi

2 Aug 2010

Unable to build a valid certificate chain for the signer

Are you receiving this error, "Unable to build a valid certificate chain for the signer" when you try to compile your AIR either via Flash or the AIR SDK ADT?

I'm using a Mac running OS X 10.6.4 and Firefox 3.6.8. I've been having this issue for a few weeks now while I've been trying to sign my AIR app so I can publish it to the Adobe Marketplace. I've followed the documentation from from Adobe and Thawte on how to export my Code Signing Certificate (CSC), but I still get this freaking error, "Unable to build a valid certificate chain for the signer"!

The only official documentation I could find was lacking:

After a couple of suggestions from the fine support people at Thawte didn't work, reading countless FAQs, searching forums, trying every single Google Search trick I wasn't able to find a solution. Joe Ward at Adobe pointed me in the right direction! I finally figured it out and thought I would document it here, so it you have a similar issue, hopefully this is a well documented solution for you other Adobe AIR Developers out there. See below...

RESOLVE THE CSC ERROR:

  1. Download & unzip thawte-roots.zip from: https://www.thawte.com/roots/index.html
  2. Open Firefox and go to Preferences -> Advanced tab -> Encryption -> View Certificates
  3. In the View Certificates window, go to Authorities and click Import...
  4. Browse over to your unzipped Thawte Roots folder -> Thawte Code Signing -> Code Signing CA
  5. Select Thawte Code Signing CA.pem and click Open
  6. You should get an alert window that states this is either "successfully installed" OR "already installed
  7. Click the OK button
  8. Repeat these steps to import: Thawte Roots folder -> Additional Thawte Roots -> thawte Primary Root CA -> thawte_Primary_Root_CA.pem
  9. Re-export your certificate

I've found that both Adobe and Thawte didn't document this error/solution very well. If you have any questions about this, please feel free to contact me and I'll help out as much as possible.

9 Jun 2010

A Letter to Steve Jobs

The following is a letter I've sent to Mr. Jobs concerning Flash & AIR on the iPhone & iPad:

2962058738_59803e8ce0_o
Image from: TechShowNetwork

 

 

Dear Steve,

I agree with you... apps and content need to run well on mobiles, and they need to be developed with quality and performance in mind. With that said, I think you are possibly misplacing your blame. Tools aren't the problem, developers are! I don't have a problem with Apple curating the App Store, but by forcing developers to use only one set of tools, I must respectfully disagree. This should be the developer's choice.

I think you are missing a huge opportunity here to increase your company's revenue. This little demo proves Flash content can run really well on mobiles devices that are comparable to your iPhone & iPad if done properly.

I believe the real issue that you aren't taking into consideration is that whether an app is built with Flash, Java or even Objective-C; they can still crash. I've seen it with my own eyes with apps on my iPhone and iPad. The quality of the app is up to the developers to ensure that their app is optimized and bug-free. It is not right to blame the tools when the developer built a bloated, buggy app that crashes. That blame should fall solely on that developer for not having a mastery of his tools. Plus, there are still a large number of iPhone apps built with Adobe's AIR iPhone Packager currently in the iTunes Store, of which that majority of them function just as well as Objective-C coded iPhone apps.

BTW... I still have one app, TheProducer, that has been locked eternally "In Review" since March 15, would you at least either approve or deny it. We would like to move forward building apps for the iPhone and iPad with Flash CS5, so that we can educate people of all ages, around the world on how they can create quality media with tools such as the iPhone 4.

I ask that you at least reconsider Apple's stand on this. You could increase your enterprise and gaming developer community significantly by accepting ActionScript developers.

Warmest Regards,
Lee Graham

1 Jun 2010

Flash & Flex Developer Magazine (June 2010)

Fresh off the digital press (or PDF)... download your copy of Flash & Flex Developer Magazine for FREE!!! Also, check out my Special Report section introducing Adobe's AIR for Android!

Don't forget, the AIR for Android beta is now OPEN to developers.


Download here


 

 

Download here

13 May 2010

Adobe Fights to Set the Record Straight about Flash

Today, much to my delight, Adobe has launched a classy advertising campaign, "We HEART Choice" to counter Steve Jobs' missive, "Thoughts on Flash". The message is simple, Adobe still likes Apple, they want to set the record straight, and they just want to let developers to choose what tools they want to build with.

Anyone that it out of the loop can grab all of the details that have led up to this point by read, Apple's CEO Entered an Insanity Plea as the Reason for Banning Flash on the iPhone

 

Weheartapple1

 

Lets first take a look at "The Truth about Flash"...

Statistics_764x238
Adobe really did a nice, concise job with this counter in the way they addressed all of the issues: touch, video, performance, security, & openness.

Read the entire article "The Truth about Flash"...

 

The Co-Founders of Adobe wrote a nice letter about the internet and openness...

They really have a fabulous point...

"If the web fragments into closed systems, if companies put content and applications behind walls, some indeed may thrive — but their success will come at the expense of the very creativity and innovation that has made the Internet a revolutionary force."

Read the entire letter "Our thoughts on open markets"...

 

Marquee_792x200

 

Future of Flash...

Flash is not only available on the computer, but shortly it will available on Android mobiles & tablets and TVs as well. I'm a part of both beta testing for AIR for Android and Flash Player 10.1 for Android and its really exciting to see a mobile device handle Flash & Adobe AIR apps so well!

Check out a few exciting videos about FP 10.1 & AIR for Android:

 

Adobe_flash_ad

30 Apr 2010

The Flash on iPhone War: Flash & Flex Developer Magazine (April 2010)

 

I was just surprised to see when I was downloading the latest edition of Flash & Flex Developer Magazine, that the Special Report I wrote became the title of this month's edition: The Flash on iPhone War. Kind of nifty and unexpected! 

Click here to download the April 2010 edition of Flash & Flex Developer Magazine for FREE

29 Apr 2010

Apple's CEO Entered an Insanity Plea as the Reason for Banning Flash on the iPhone

Today, Steve Jobs, CEO of Apple, publically entered a plea of insanity on Apple.com as to why Apple is banning Flash from the iPhone.

As an Flash developer, I feel Mr. Jobs arguments are fairly weak and a bit on the side of insane and just goes to show everyone how deperate Apple is to put out these public relations fires caused by not allowing Flash on the iPhone or iPad.

First and foremost, there is a huge difference between developing apps and developing websites that are viewed on mobiles. Steve kind of blurs the two together throughout. Adobe Flash runs within browsers, while Adobe AIR has been used to develop desktop and native mobile apps which includes iPhone and iPad apps. While Flash hasn't been tested in the iPhone Safari browsers, there are over 100 apps that were built with Flash CS5 and AIR 2 that are currently in the iTunes Store. Nowhere in his post does he address how well iPhone Apps that have been developed with Flash CS5 and AIR 2 work so well on his precious little devices.

So yes, I think Steve's post is filled with shenanigans, ancient facts and many statements that are simply insane!

WARNING THIS IS A LONG POST!

 
 
Steve's Point #1 - First, there’s "Open". 
 
My Response - Yes, Adobe is "100% proprietary" and Flash is not technically an "open", but why does this matter? At least they place nice with others. Adobe's Open Screen Project is clear evidence of this. Along those lines, Adobe doesn't dictate how we can and can not use their tools. In this sense, Adobe is open. We pay for the tools, we use them however we choose.
 
HTML5 nowhere close to being complete, and it simply doesn't have the capabilites of Flash. Just take a look at the specs:http://dev.w3.org/html5/spec/Overview.html
The plugin issue is not really an issue either. Google has embedded Flash Player into Chrome and will be doing the same when Android OS 2.2 (Froyo) is released later this year.
 
 
Steve's Point #2 - Second, there’s the "full web".
 
My Response - This really has not happened until recently, more than likely because of the iPad. Most of these companies like a Netflix or a Facebook, have just recently implemented these video player that work on the iPad and iPhone. So when Adobe said majority of site run Flash video a year or so ago, yes, they were correct. I think Mr. Jobs took this statement a bit out of context to match is arguement.
The gaming point made me laugh. I'm not sure why Steve keeps referring to old comments made my Adobe. Hasn't he seen some of these Flash games (http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/) running on his iPhone? 
 
 
Steve's Point #3 - Third, there’s reliability, security and performance.
 
My Response - I personally don't recall seeing Symantec stating this. Even if it were true, Flash is like any other leading technology (like Microsoft Windows)... its will always a prime target because its on pretty much every machine. Its not like the Adobe engineers are sitting their twiddling their thumbs, they are always working to patch these security issues.
As far as Flash not working well on mobile devices. I say this is a load of crap. Again, where what decade is Steve talking about? In 1995, maybe. Devices now are powerful enough to support Flash and as Andy Rubin, Google's VP of Engineering Android, Flash will be bundles with the next version of Android. 
 
 
Steve's Point #4 - Fourth, there’s battery life.
 
My Response - I don't know all of the technical details related to this, but yet again, Steve has some of his facts possibly straight here. Flash does supports H.264, as well as many other formats. If its a matter of Flash accessing the hardware, that problem should be fairly easy to resolve if Apple opened up the platform a bit. Just last week, Apple conveniently opened up the Mac operating system, so that Adobe could use hardware acceleration for decoding H.264 on Macs. Seems to me, that this is an Apple issue, if it is anyones.
 
 
Steve's Point #5 - Fifth, there’s Touch.
 
My Response - This was his most comedic comment in this post. Yes, most website created 3, 4, 5 years ago, whether created with Flash or HTML/CSS/JavaScript used rollovers. This is more of a change in mentality for the developer when they design apps and websites in general, NOT a specifc Flash issues. Today, I can take my iPad or iPhone and access HTML website that have issues because they were designed with rollovers.
 
 
Steve's Point #6 - Sixth, the most important reason. (Adobe also wants developers to adopt Flash to create apps that run on our mobile devices)
 
My Response - Um... yeah! And what is wrong with that? It would be extremely valuable from a developer's point of view to have access one tool that allows me to write apps with one language that can run on a desktop, netbook, iPhone, iPad, Android mobiles, webOS, etc... 
I've developed an app with Adobe Flash CS5 & AIR 2 that runs on my iPhone, my iPad and my Google Nexus One. The beauty of what Adobe is doing is that is takes very minor code changes to repurpose your app to run on another device. My app runs extremely well on all three devices. So I'm not sure what Steve is talking about. 
He mentioned, "We know from painful experience that letting a third party layer of software come between the platform and the developer ultimately results in sub-standard apps and hinders the enhancement and progress of the platform." What painful experiences is he referring too? I'm clueless here.
I could see a potential issue where if Apple wasn't working with 3rd parties, it would take a little bit of time for them to adapt their tools to be up-to-date with the latest APIs and features from Apple. The developers wouldn't be upset with Apple over this 3rd party not having their tools up-to-date. 
Just look out at all of the APIs that are out there today. Say a 3rd party company builts an app based on the Twitter API, then Twitter making a change to the API, and then the company's app stops working because the company didn't update their code to be in sync with the latest updated from the Twitter API. The consumer couldn't blame Twitter for this 3rd party developer not keeping his app up-to-date, they would have blame the 3rd party developer.
In response to Steve's comment about the lowest common denominator. As a developer, I would prefer initially to have a limited features at first, in exchange for being able to develop apps for a variety of platforms, as opposed to having to learn ActionScript 3, then JAVA, then Objective-C, etc...
 
 
Concluding Thoughts...
  • Flash will be a leader in the mobile era just as it has been in the PC era with or without the iPhone/iPad. Google has been it very clear that they are working with Adobe to include both Flash & AIR in Android.
  • Apple needs to grow a set and simply come out and say that the reason for all of these shenanigans is because they now view Adobe Flash as a competitor. I could comfortably live with that confession.
  • I would like to see Apple at least give a little ground and allow developers to use, Flash CS5 to build iPhone and iPad app. We've already proven this can be done effectively.
  • My suggestion to to Steve, if you really want to improve his iTunes/iPhone/iPad/iWorld he should remove all of the stupid iFart apps.  

 

 

 

*    DISCLAIMER 1 - I proudly make my living as a Flash Developer

**  DISCLAIMER 2 - I'm a part of the Flash CS5, AIR 2 & AIR for Android Beta Program

*** DISCLAIMER 3 - I'm a Mac Boy through and through. I typing this on my iMac, I'm on my second iPhone upgrade, bought an iPad before they were shipping, and my next computer will more than likely be a Macbook Pro.

Lee Graham's Posterous

Hi! I'm Lee Graham. I'm a GOAT (Geek Of All Trades)! I'm also a Flash Platform Developer, eLearning Developer for BB&T University, Android fanatic,  & husband to the world's most beautiful girl!


Connect with Lee Graham


DISCLAIMER: The information contained on this site are strictly my personal views and doesn't reflect the views of my current employer.