Friday, May 31, 2013

Using Developer License for iPhone development

I should say my start was bumpy. I was hoping to be up and running in an hour and it took me entire morning. Yes I am dumb and agree English is my third language but stumbled upon provisioning was no fun.

So started with applying the developer license and activating it. I was pretty happy to think I am all set to develop.

1) Downloaded and installed latest version of XCode 4.6.2.
2) Upgraded to latest version iOS 6.
3) Downloaded and Installed PhoneGap latest API for iOS.

Using below command created my HelloWorld application.

./phonegap-2.7.0/lib/ios/bin/create ~/Documents/toyspace/HelloWorld com.toy.HelloWorld HelloWorld

Install iOS Simulator components by choosing. XCode -> preferences -> Downloads -> Components.

Double click on HelloWorld.xcodeproj project to open and try running it using Simulator. Should run without any hassle.

Now I wanted to deploy the same HelloWorld application on my iPhone. Very simple desire of mine. Boom encountered

"No iOS Development certificate was found. However, there is already a certificate request pending. An Agent or Admin must approve this request before you can download your certificate."

Searched the error on google and found couple of useful links. Then I realized just activating the license which was issues to me is not enough.

One should create following things to get started.
1) Login to https://developer.apple.com using your apple id.

2) Choose -> iOS-> Development -> Certificates, Identifiers & Profiles. Create a new certificate using your mac Keychain store and register it under Certificates -> Development options.
 
3) Create a App ID for the package name of your application. Otherwise you will encounter
 "Code Sign error: The identity 'iPhone Developer: x Xxxxx' doesn't match any identity in any profile" error. i.e. in our case it will be com.toy.HelloWorld.

Once you have done above things on developer website. Come back to XCODE and open the Organizer to setup your device.  On XCODE menu options choose Windows - > Organizer.

Click on Add icon on Provisioning Profile option. Provide a profile name , select the App Id which we created and select the device where you want it to be deployed and choose the certificate to register your device with XCODE.

Now select the device as target and run the application again. Hopefully you should not see any error.


Cheers!
Manisha

Saturday, May 25, 2013

Another reason to use Java 7 - Tiered Compilation


I had my Ahhhaaa moment last week when I was reading about Tiered compilation, which was introduced in Java SE 7. It combines the goodness of client and server startup. In short client startup speeds to the server VM. 

Check below graph. 



Isn't this awesome performance benefit? For more details read this documentation. So start using java 7 if you haven't already done it. Or I would say go for java 8. I know lots of big companies where java 6 is still de facto standard. Question is how can we make these companies adapt quickly. May not be appropriate for this blog post. I need another blog for my all my rants ;).

Take a look and let me know your thoughts.

Will share more
Manisha