So, if you want to get paid by a U.S. company and you don’t want the U.S. government withholding 30% of it – then you need to fill out two forms:

  • W-8BEN (to declare to the U.S. why you shouldn’t be taxed at 30%)
  • SS-4 (to get an Employer Identification Number [EIN] which is used in your W-8BEN)
The EIN number is relatively easy to obtain. Simply fill out the SS-4 form here http://www.irs.gov/pub/irs-pdf/fss4.pdf  (detailed instructions are here http://www.irs.gov/pub/irs-pdf/iss4.pdf).

You can then call the IRS on a special number for international applicants on 001 267 941 1099 and a little old lady will guide you through the form.  She will give you your EIN number there and then although the paperwork will take three weeks to arrive in the post.

For the W-8BEN form (http://www.irs.gov/pub/irs-pdf/fw8ben.pdf), here is a cheat sheet:

Part I

1. <Your Company Name>
2. United Kingdom
3. Tick “Corporation”
4 <Your Company Address>
5. Postal Address (if different from above)
6. Your EIN number (as obtained from the little old lady) and tick the “EIN” box
7. Optional (I ignored this)
8. Ignore

Part II

9a – Tick and enter “United Kingdom” in the space provided
9b – Tick
9c – Tick
Ignore the rest.

Part III

Ignore

Part IV

Sign, date (in U.S. format MM-DD-YYYY) and enter “Director” as capacity in which acting
That’s it. Write me a nice message if I saved you a shed load of time 🙂
Advertisements

The new Android market is a great step forward. Finally, we are able to provide links to our apps on the web, customers can browse and search for applications and install them directly to their devices from the web.  Overall, it looks great.

There are some improvements that could be made though and I’m sure that Google will iterate on the user experience over the coming months. Here are some constructive criticisms / suggestions for improvements that I hope they will take into consideration

  1. The beautiful styling of the page is somewhat ruined by the default Google navbar at the top of the page which looks like it was constructed in FrontPage.
  2. When viewing a screenshot for an app, I would like to be able to view the next image in the sequence without having to close the one that I’m currently looking at and manually selecting the next image! That is a useability fail.
  3. I know (because I’m a savvy Android user/developer) that the Square app (squareup.com) is only available in the U.S. With the new market, I can search and view details for the square app but I’m not able to install it. For a general user I think that it would be nice if an explanation was given as to why this app is not available for installation rather than a bog standard message that says “This item is not available on your carrier”. Or better yet, since I’m logged in and you already know that I can’t download the app – why not just hide it from my search results like you do on the phone?
  4. Android buyer currency support is most welcome, but I feel that Google are trying to be too flexible. Apple have really nailed this one by providing tiers of charges so if you set your price at £0.59 then in the U.S. it will be charged at $0.99 and so on.  Enabling Android devs to set their own prices for each country gives total flexibility but adds way too much complexity.

I’ve been toying with the idea of writing a blogpost about my experience of freelancing over the past few months but this morning I stumbled across this fantastic post and I don’t think I could capture the wit or sentiment any better so enjoy:

http://mocko.org.uk/b/2010/10/11/so-you-want-to-go-freelance/

An interesting blog post on the subject here:

http://goldengekko.blogspot.com/2010/09/what-are-costs-of-developing-mobile-app.html

NB. The numbers are pretty accurate in my opinion.

Update: Also of interest are some of the comments in this stackoverflow question. Some frank estimates of time by some of the developers for well known apps such as twitterific.

http://stackoverflow.com/questions/209170/how-much-does-it-cost-to-develop-an-iphone-application/3926493#3926493

I recently encountered this problem while trying to develop a WebView that is supported on Doughnut (1.6) and above. When presented with a https url the WebView just renders a blank page.

It seems that until Froyo, Android didn’t provide a public API to let you manually decide if you wanted to proceed to an untrusted web site via a WebView.

Note that in this case it is not even that the web site was untrusted (in the conventional sense) – it is because Thawte is not in the default list of trusted certificate authorities on Android. If you use the standard web browser on Android, the browser presents a typical warning dialog (as presented below) that enables you to accept the certificate and carry on.

Invalid certificate warning

If you are using Froyo as the target SDK then you can use:

engine = (WebView) findViewById(R.id.my_webview);
engine.setWebViewClient(new WebViewClient() {
 public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
 handler.proceed() ;
 }
}

However, if you are not using Froyo then it seems you are out of luck. After some research, I concluded that I had the following options:

a) intercept all page requests and forward to external web browser if url begins with https (not a clean or nice user experience and totally unnecessary for Froyo and above)
b) add certificate of website to local keystore (in this case I am serving multiple web pages and the origin of many of these is not known until runtime)
c) make Froyo the minSDK and discard previous versions of Android (not a suitable option)
d) hack and use some private apis (the option described below)

To solve this problem we have to use a private interface (not published on SDK but present in real SDK runtime). As you can see in the Android src tree, the onReceivedSslError is indeed present (and used – it simply cancels the request) in Doughnut. However, this method is not presented to us in the SDK  – it is hidden because it contains a parameter type SslError which is located in a hidden package.  Therefore, we need to copy these src files into our project so that we can access them:

1) Copy WebViewClient.java into the package “android.webkit” within your src folder.
2) Copy SslError.java into the package “android.net.http” within your src folder.

Src files

3) Since we replicated the paths to the src files in the SDK, our code to override onSslError above now works on Android 1.6.

Caution: bear in mind that we are using a private API and Google reserve the right to change private APIs at any time – though in this case it is unlikely since they’ve now made this available in Froyo.

QR code for your business card

September 23, 2010

If you want to create a qr code that contains your contact details e.g. to include on your business card as shown in this video http://www.youtube.com/watch?v=3LkNlTNHZzE&feature=related&t=0m58s then you should head over to http://zxing.appspot.com/generator/

You’ll be able to create your own qr code (as shown below) for free. Below is a screenshot of my Android phone when I scanned the barcode.

qrcode

android save contact screenshot

I use Windows for Android development because I find Eclipse too slow and clunky on the Mac especially on the MacBook Air. Recently I started using GIT for a project having used Subversion exclusively in the past. Given these constraints (Windows and Subversion experience) TortoiseGit seemed the obvious choice for me (I’m not trying to impress my friends with my command line skills any more!).

1) Download and install the lastest TortoiseGit MSI installer from http://code.google.com/p/tortoisegit/
Google code screenshot

2) Create your repository over at GitHub (Assuming you already have an account)
GitHub create repo screenshot

3) Initialise your project as a Git repository by right clicking on your project directory and selecting “Git Create repository here” from the context menu. A .git folder with all the necessary setup will be created within your project folder.
Init git repo on filesystem screenshot

4) Open your project folder and select the files and folders that you wish to include in your git repo (you will want to exclude the /bin and /gen folders for your Android projects). Then right click on these selected items and select “Git Commit -> master …” from the context menu.
commit files screenshot

5) A commit dialog will appear. Write your commit message and select the “select / deselect all” checkbox at the bottom to ensure that all your files are selected. Press OK. It is important to note at this stage your commit is being held locally on your PC as we have not yet linked our filesystem repo with github.com.
git commit msg screenshot

6) Before we can “push” our local commits (plural because you can make many commits locally before pushing them to the server) we must create an ssh key. The easiest way to do this is to open the Git Gui.  Right click on your project folder and select “Git Gui” from the context menu.
Open Git Gui screenshot

7) In Git Gui (notice our unstaged changes on the left), select Help –> Show SSH Key.  A dialogue will appear with your SSH key (if you have one). Most likely you do not have one yet so click the “Generate Key” button and enter a passphrase/password to secure your key when prompted. Your generated key will now appear in the textbox; copy it to the clipboard.
Create SSH Key Screenshot

8 ) Now you must add your ssh key to your github.com account.

a) Sign in to your account at github.com
b) Click the “Account Settings” link (top right of page)
c) Click the “SSH Public Keys” link (left middle of page)
d) Click the “Add another public key” link
e) Give your key a name e.g. github-<your_username> (you might have keys for other things!)
f) paste your key (that you copied to the clipboard in the previous step) into the textarea.
g) click add key
github.com ssh key setup

9) Now that you have created your ssh key and shared it with your github account, we are ready to push our commit (that we made in step 5) to our online github.com repo.  Right click on your project and select “Tortoise Git” –> “Push” from the context menu.
Push to Git screenshot

10) A dialog will appear asking where you would like to push the commit(s) to.  If you navigate to your project on github (e.g. http://github.com/damianflannery/MyProject for me) you will find an ssh url for your project (git@github.com:damianflannery/MyProject.git for my project). Copy your ssh url and paste it in the “Arbitrary URL” field of the dialog and click OK.  You will be asked to enter your passphrase/password for your ssh key and then all being well you will receive a success message.
Git Push Dialog Screenshot

That’s it! Head over to github.com to see your code.