Tag Archives: Development

Apache ant – fixing “can’t locate tools.jar” error

3 Jun

If you have “can’t locate tools.jar” error when trying to run “ant”, you’ve come to the right place. The fix is apparently very easy, you have to properly set up the “JAVA_HOME” environment variable to Java JDK. The tools.jar is found in the bin folder of the JDK but you only need to point the JAVA_HOME to your JAVA SDK installation and you should be all set!

Easy, right? Go get them!

How to speed up Eclipse on OS X 10.6 Snow Leopard

28 May

If you’ve been experiencing horrendous performance of Eclipse on OS X, or maybe you even did not know that Eclipse actually can run very fast, you’d be surprised to learn that apparently it is very easy to make Eclipse run 4-5 times faster  on OS X with proper settings to your eclipse.ini file.

First I will give you a bit of  background. If you want the gist of it or how to make it fly – just go the end of the post.  So a few days ago, PSU fried on my main desktop development machine. It is a newer Quad Core i5 2.6 machine with 4GB 1066Mhz memory and a standard 7200 RPM drive. Since the machine is dead and I am waiting for a replacement power supply, I had to move to my new and shiny MacBook Pro, which I have recently purchased and which is from the latest batch of the updated MacBooks and is quite powerful. It is also i5 (only dual core though) with the same 4GB of 1066Mhz memory and 5400 HD.

So, yeah, I would say that the systems are pretty close right. Nevertheless, working with Eclipse on OS X felt horrendously slow! I had already noticed this nuance in the past and I thought that the Eclipse is just not meant to fly on Mac-s (oh well…), especially when there are so many different distributions for OS X, it signals that the project is in a shifting phase basically (it is shifting from Carbon to Cocoa) and that you should expect all kinds of problems. I bet many people

(more…)

Motorola Droid driver for Windows 7 64 bit

23 May

I’ve got the Motorola Droid from Google through their device seeding program a while ago. Which is nice although Nexus One would be much better since then I would have been actually using as my phone. The Droid has to be tied to Verizon and I am a T-Mobile lad all the way.

Anyways, I’ve tried a few times to get adb debugging talk to my Droid on my Win7 64 bit and I could not get it to work for a long long time. I tried to search around for the solution, but none of the drivers that I’ve found worked until today I started the search again and found the Win7 64 bit Droid drivers from Motorola here which worked perfectly fine!

Don’t forget to go to “Settings->Applications->Development” and enable “USB Debugging”

Using Amazon S3 to serve JAD files for BlackBerry OTA distribution

4 Apr

If you don’t want the preamble of why I wanted to serve JAD files from Amazon S3, skip to the second paragraph.

I have recently came across the need to push OTA update of the DailyHoroscope application for BlackBerry. I conjectured that OTA updates have different behavior and thus different impact on the web server. There are still many people using their smartphones in general and BlackBerries in particular over the slower EDGE connections as opposed to 3G, not to mention 4G and/or WiMax. So to download 300K file over EDGE connection in the real usage example can take anywhere between 10 seconds to couple minutes. All this time the webserver’s thread serving this specific client will remain running. So it seems like you (or rather your server) can be in a nasty situation when 1000 users simultaneously or almost simultaneously decide to do the OTA update. Also quick calculation with Amazon WS calculator shows that serving files from S3 would be rather cheap even comparing to renting a cheap VPS for that purpose. My estimate was that the whole upgrade process (considering the fact that almost all the users update from S3) will cost me about $15. And this is independent of the time span. For $15 you could get a very cheap VPS for one month (if you are lucky). So it seemed like a no brainer. It indeed was until I faced a few problems with setting this up which I will cover here so that you don’t have to spend much time looking for solutions if you want to do the same.

Setting up S3 is a breeze. Using it – not so much. It is just like any other service pretty much – when you want to sign up and call sales you are answered immediately but if you have a problem and need customer service, well, you can be on hold quite a while. If you have Amazon account already set up, you can use this account. You will have the option to opt for the payment to any of the payment options (now it seems that this is only credit cards) already on file with Amazon or you could add a new credit card so that your S3 bill is billed separately.

When you signed up, you are almost ready to begin using S3. Once you receive confirmation email which can take a few minutes until your request is processed and billing information verified, you are set to go.

  • Open your Amazon account dashboard and login with your Amazon account you had or just created
  • Click on Security Credentials
  • Under the Access Credentials table, look at the first tab – Access Keys
  • Next to your access key, will be a column Secret Access Key which will have the secret key hidden from the screen.
  • Press the Show and your secret access key will be revealed

Now you can use this information to log in to S3 and start uploading files. To access S3 you can use S3Fox from any platform since it is FireFox plugin. You can use CyberDuck if you are on Mac which is an excellent free general purpose FTP client which also supports WebDav and SFTP. If you are on Windows, there is also free and feature rich client CloudBerry. S3Fox is very nice and fast and you do not have to install anything on the system, only plugin for FireFox, but I will be using CloudBerry since we will need to set custom Content-Type for the JAD and COD files and CloudBerry is more feature rich than S3Fox.

  • Open CloudBerry
  • Enter your credentials and open your S3 account
  • Create a bucket – it has to have unique system wide name like a domain name (actually subdomain, because after it is created it is references by http://yourUniqueName.s3.amazonaws.com)
  • Enter into the bucket and create folders, or just upload the files you want to serve. If you like me want to serve OTA BlackBerry application, you probably want to create a separate folder for each release
  • After you create the folder, use the ACL (access control levels/list) menu button to open the ACL controls

  • Using the ACL controls, give “Read” access to “All Users” (note that if you place check mark on the bottom “Apply for all subfolders and files” the permissions will propagate down the tree)

Now the whole world can read the files you uploaded. The problem with BlackBerry OTA distribution is that Amazon does not send the right mime-types in the HTML Content-type header. And this is something that you will need to get fixed before people can actually install your application over the air directly from S3.

The right content types for the the JAD and COD are:

  • jad -  text/vnd.sun.j2me.app-descriptor
  • cod – application/vnd.rim.cod

So using the custom HTTP headers menu button we will be setting those types for JAD file and all the COD files respectively.

  • Select your JAD file and click on “Set HTTP Headers” button

You will get the custom HTTP headers dialog:

  • Select the “Content-Type” field and replace it with the text/vnd.sun.j2me.app-descriptor for the value

Now you can repeat the above step for each COD file individually, or you can select all the COD files and set the headers at once but then you would need to add the “Content-Type” header manually for the right COD mime type – application/vnd.rim.cod. Just use “Add” and in the HTTP-Header enter “Content-Type” and in the Value enter “application/vnd.rim.cod”. You should see something like the following dialog

***IMPORTANT to check the “Keep existing headers” or you will loose all your default defined headers which is not good in most cases.

That’s it, you are DONE! Check that you did everything right by pointing your BB browser to http://yourUniqueName.s3.amazonaws.com/yourReleaseFolder/AppName.jad and make sure that you can install the application from there. If you did everything right it should work.

Overall S3 seems like a very nice (and apparently very cheap) service and anyone who serves lots of static content should consider using it for that purpose. But not everything seems so pink in the world of S3 and I am sure you will face many other small problems and nuances while setting it up as I did for my task. But hopefully if serving BlackBerry application is all you want, you should now have everything to get you started.

BlackBerry Eclipse plugin 1.1 will fix some of the annoying problems

29 Mar

The next version of the BlackBerry Eclipse plugin will fix most of the annoying things about blackberry development.

Some of the most important things are:

1) No need to restart emulator for new build to be loaded to the emulator (Hallelujah!!!)

The new build should be just loaded onto the already started simulator, pretty much as on Android and iPhone.

2) Ability to add external libraries i.e. *.jar files to the project

This is actually pretty peculiar since RIM was pushing hard 3-d party (external library) integration as one of important concepts and obviously it would be very beneficial for the BlackBerry ecosystem but if you did not want to use JDE, there was pretty much no clean way to add external library. That is until the 1.1 plugin comes out from beta, or at least that what was promised at the New England BlackBerry developers meetup.

3) The BlackBerry plugin would follow the “Eclipse way”

The 1.1 plugin is very different from previous version. Instead of following the “JDE way” it will be much more the natural “Eclipse way”. This is both good and bad. This is very good for developers that have experience with Eclipse and just now start to develop for BlackBerry. This will however be somewhat painful for the seasoned developers who got used to the old plugin and will need to discover many things from scratch. (I personally felt quite lost with the new 1.1 plugin and decided to stick with the old one until 1.1 comes out of beta).

You can download the beta of 1.1 from here (you would need to have BlackBerry developer account which is free and can be obtained with simple sign up immediately)

Super App webcast Q&A follow-up

29 Mar

During the Super App webcast Mike Kirkup covered many questions from the attendees. I have gathered many of those in the webcast summary. He did not get through all of the questions and promised to answer all of the questions on blackberry development forum. He did just that and here is the Q&A extracted:

[Q] The problem I found with a super app that was tightly integrated with the address book is that people were looking to see an icon and not something that was just part of the existing BlackBerry UI.

[A] A good point.  Many users will still expect a simple icon for the application whether only to provide information on how to leverage the application or how to manipulate settings.  Fixmo is a really good example of this point.

[Q] Is there a way for my app to get notified when new notifications are shown on the device?

[A] Unfortunately, no.  But this sounds like a great feature request you should log via the BlackBerry Issue Tracker.

[Q] Is there a way to include full camera control in the application?

[A] Yes.  Check out JSR 135 (MMAPI) for more information on how to include the camera field within your application including the ability to modify zoom and flash settings.

[Q] With the definition of a “Super App” being one that you cannot live without, can a game be a super app?

[A] Great question!  Yes, a game definitely can be a “Super App” or take on many of the characteristics of a Super App including being notification driven, contextual (even location based), integrated with other applications and so on.  It isn’t hard to imagine having a game that you love so much that you can’t live without it.

[Q] Can I make a Super App by developing a BlackBerry Widget?

[A] Yes, definitely.  One of the most important attributes of the our Widget technology is that you can fully integrate your Widget into all of the same APIs that are available to Java applications whether exposed already through Javascript APIs or through your ability to write Javascript to Java APIs.

[Q] Do you plan on setting up a program to certify applications as Super Apps?

[A] No, we do not currently have any plans for certifying applications as a Super App today.  The concept here is to help people really understand not only the capabilities of the BlackBerry platform but also the possibilities on better engaging your users.

[Q] We have developed a collaboration application which works on a “pull” basis.  How can we leverage push?

[A] Check out our newly launched Push Services page for more information on how you can start leveraging push in your application whether for the enterprise or consumers.

[Q] Is it possible to add a custom menu item in any third party application?

[A] Yes, although not in a granular fashion today.  As part of the ApplicationMenuItem API you can specify that you want your menu item included in all applications on the device but you do not get to pick which applications if you don’t want all apps.  Can you submit a feature request in the Developer Issue Tracker if you think this is a good use case.

[Q] Suppose the application flow is such that screen 1 pushes screen 2, screen 2 pushes screen 3 and from screen 3 the user needs to go to screen 1.  Should the application push screen 1 again or pop screens to get to screen1?

[A] You should definitely maintain the proper ordering of the screens on the stack for the user such that your application will automatically pop off the top screen on the stack when the user presses the escape key.  So, in this case, it depends on your ultimate goal of the screens.

[Q] This is a great presentation but it gives very little to seasoned developers.  Will you have additional presentations with more details and more code samples? (Editor: this, I think is actually my question slightly rephrased)

[A] Yes, definitely.  This is the introduction to the concept of Super Apps and you will see additional webinar presentations that go into substantially more detail on all of the key aspects of bringing Super Apps characteristics to your application.  The Big Ideas, Little Screens UI Webinar from Brian this month is a perfect example of more involved webinars.

[Q] What are the OS or device requirements for the Javascript examples provided?

[A] These are part of the new BlackBerry Widget technology and require v5.0 handheld software.

[Q] You mentioned the Super Apps website.  Where is that?

[A] www.blackberry.com/developers/superapps

He also promised to keep posting answers so see the original forum thread here for more information

Building Secure Mobile Applications – AT&T free webcast

29 Mar

AT&T will host a webcast about building secure mobile applications on April 1-st. It’s interesting to see how the mobile ecosystem is going crazy right now, every brand  trying to get as much people involved as possible.

The MotoDev, Verizon Developers portal and AT&T developer center being promoted to potential developers very aggressively lately. Those companies (carriers, manufacturers etc…) understand that the platform value shifted to having quality consumer applications. Those, supplied by small companies and indie mobile developers.

The webcast  info:

Who Should Attend:
Developers who are building applications with networking or messaging functionality.

When:
Thursday, April 1, 10:00-11:00 AM Pacific Time

What you will learn:

  • Evaluate threats to your mobile applications
  • Prioritize security features that should be enabled in your applications
  • Minimize risks to your applications

You can sign up here for the webcast

As an added bonus AT&T smartphone will get drawn between participants in the webcast.

All actual attendees can enter to win an AT&T Smartphone. Winner will be notified via email after the Webcast.

How to find out your iPhone or iPod Touch device ID or UUID

18 Mar

You may need to know your iPhone or iPod Touch device ID (or UUID) for many reasons. Whatever reasons those are there are couple of very easy ways to find out what is your iPhone or iPod Touch device ID.

Mac or Windows:

  1. Connect the device to your Mac or PC.
  2. On the “Summary” tab in iTunes, click the “Serial Number” label. You’ll notice “Serial Number” changes to “Identifier”.
  3. Click on “Edit” in the menu at the top and select “Copy”.
  4. Now you can paste the device ID into an email.

Mac + XCode

  1. Start XCode
  2. Go to “Organizer”
  3. In the “Summary”  tab you will see the connected iPhone or iPod Touch’s ID under the “Identifier

There is also a free Hmm UUID app that will show you your iPhone or iPod Touch device id.

How to do a remote programming interview with code review

17 Mar

I’ve just read a post at Coding Horror – Jeff Atwood’s popular blog where he goes into the problem that many candidates applying for a programming job simply can not program. He claims that it’s almost all of the applicants, which I find hard to believe. I tend to think that their resume evaluation techniques are just not good enough, which is surprising since Jeff is good friends with Joel Spolsky who had an interesting article about screening resumes.

Anyways, Jeff’s article is not about that. It’s about a little nifty tool that will allow you to see other person type. It’s very simple you give your interviewee a link and open a link in your browser and can see everything the other person types with a couple seconds lag. This tool is definitely nice, but hell, why not just use google wave? It’s easy, many technical people should already have it. If the programmer applying doesn’t have it and doesn’t have a good reason as to why this is so you should think twice about putting further time and effort in the interview process.

New England BlackBerry Developer Meetup group – first meetup notes

17 Mar

Last night I have attended local New England BlackBerry developer meetup group. It was a great event with nice turnout of about 50 developers with special guest – Mike Kirkup – director of developer relations at RIM.

Mike is a great speaker and a great guy in general. BlackBerry developers are truly blessed with Mike in that sense. So much has been done to ease up on the hurdles of BlackBerry development recently that it is becoming cool to be BlackBerry developer once again.

The meetup was hosted by a local software development company – SoftArtisans. They develop SharePoint solutions for BlackBerry.

Mike was give the stage and he went over the BlackBerry super app concept which was similar to the BlackBerry super app concept webcast he gave recently but a little different of course with some stuff oriented more towards developers.

The highlight was of course the free panel Q&A session which was afterwards. Mike, as usual, did a very nice job answering the questions of the many developers who brought up interesting questions.

Upcoming Products

  • BES Express (or BESX) which is the free, striped down version of the BES server. This will allow smaller businesses to put their employees on BESX without hesitation which originated from the costs of licensing associated with putting employees on BES.
  • Upcoming WebKit browser which will be blazing fast and super blazing fast for JavaScript.
  • There will be no iPad like device.

“No iPad, no BlackPad, BluePad, RedPad etc…”

  • Advertising APIs. Right now RIM is conducting a closed beta with their partners and should be soon available to all independent developers. There is no cap on the volume, meaning pretty much anyone would be able to integrate advertising in their apps.
  • Push APIs (well this is not an upcoming event actually, it went live today at 9am). Push API is available to everyone now and is free!
  • App World 2.0 will soon be launched. The next version of the app world will support not only the PayPal but also the carrier and credit cards. The share of developers will most likely be different across all the optios and across the different network operators as well. PayPal option will remain 20/80% split with 80% going to the developers.
  • In a few weeks the new Eclipse plugin for BlackBerry development version 1.1 should be released, which will address many issues existing in the older 1.0 browser. The official release of 1.1 which should go out of beta will be fully supporting 64 bit systems.

Upcoming Events

  • Very soon we would have “fast simulator experience” so painful to many developers that when announced, it was followed by applause storm. So fast simulator experience means no more restarting the simulator to load the newly compiled version. (Yey!)
  • More aggressive promotion of the App World. Mike mentioned that RIM intentionally kept the App World low profile for the first year letting the carriers figure out their distribution strategies.
  • Super App competition. The super app competition will be carried out with a different prize distribution model than previously. RIM decided instead of rewarding a few leading application with big bonuses, reward more developers with moderate bonuses. Mike mentioned that they expect 3000-4000 apps submitted to the contest (both new and existing apps can be submitted) and if your app passes the first criteria of actually being a super app, then you are already entitled to something. Mike threw out “a free device” in the air but I guess it is not yet decided. They may go with a free device or maybe discounted developer conference or maybe we could choose. Let us know in the comments what you would prefer. The prizes will be handed out at BB Dev Con in San-Francisco at fall and the submission deadline will most likely be July 1-st but this is not confirmed yet.

The painful question of over the air (OTA) OS upgrade was raised and Mike said that carriers feel  fairly confident with pushing OTA OS update starting with OS 4.6 since 4.5 being the first OS where OTA OS was introduced had some issues and bugs. He mentioned that from carrier’s experience OTA updates have a very high conversion rate. In the 80%-s while even the through browser+USB update is less than 20% conversion rate. Until most of the devices are 4.6 and up and carriers are more aggressive pushing updates to the devices, we will be stuck with the need to support older devices as old as 4.2.1. Which leads us to further interesting figures:

as of October 2009 the OS distribution is as follows:
4.2.1 97%
4.5 50-60%   – over the air update
4.6 30%
4.7 15%
5.0 5-6%
meaning supporting 4.2.1 will get you almost all the devices, while jumping to 4.5 and up will only give you about 50-60% and by going further up to 4.6, you will loose up to 30% of devices (this is due to huge number of older Curves and Pearls).
I will be wrapping up since this post is already quite long. Leave your thought in the comments!

Update

You can read additional notes summary at Chris Wong’s blog

You can download the Super Apps slides by Mike Kirkup which were presented at the meetup.