Windows Phone 7 development

Archive for the ‘Windows Phone 7’ Category

How to get MAC adress on Windows Phone 7 device.

There had been an issue with MAC adress on WP7 – the MAC wasn’t exposed. As a result, there phone can’t be connected to MAC-secure WIFI.

After March update, the MAC is in About page.

 

Go Setting -> About -> More info.

voila.

Advertisements

Changing namespaces in WP7 project

It seems that VS 2010 screws the project properties when namespaces are changed.

I posted it on SO.

And the solution is:

Check the “Startup Object” in the project properties page. The sometimes requires manually being set/corrected when the namespace of the app is changed.

Thx Matt ūüėČ

How to get Individual Taxpayer Identification Number (ITIN) if you are not a U.S. citizen

I would like to share a quick tutorial how to get ITIN number for tax purposes. I is a bit of PITA (pain in the ass), especially for those who do not have access to a proper tax advisor, that is why I share this.

I am Non U.S.-based Developer developer that makes app for WP7 and I will focus on Zune marketplace, but this tutorial is also helpful for any person that would like to get ITIN.

What is ITIN?

According to wikipedia:

An Individual Taxpayer Identification Number (or ITIN) is a United States tax processing number issued by the Internal Revenue Service. It is a nine-digit number that begins with the number 9 and has a 7 or 8 in the fourth digit, i.e. 9xx-7x-xxxx or 9xx-8x-xxxx. The IRS issues ITINs to individuals who are required to have a taxpayer identification number but who do not have, and are not eligible to obtain, a Social Security Number.

Basically, we need this number to do small business, open an account, for royalties income etc. There is also Employer Identification Number (EIN), which is also useful for tax issues, but it is meant for sole proprietors, not individuals.

Why do I need it?

To take advantage of the tax treaty your country could have with the U.S. and avoid being subject to an automatic 30% U.S. tax withholding. In other words, to pay less taxes, but this is not mandatory to get paid.

What do I need to get it?

You will have to have:

  1. Filled W-7 form.
  2. Document that proves your ID (must have a foto of you).
  3. Letter confirming that you need an ITIN.

W-7 form how to.

Remember, this may vary depending upon country, gender, purpose.

Ok, so let’s start step-by-step.

Section 1 – Reason you are submistting:
Check A – if you are not the U.S citizen/resident
Check H with “Exception 1(d) – Royalty Income
Treaty Country (Your country goes here) Treaty Article Number (number of the article Рyou can find it here)

Royalty Income Exception if for WP7 developer as well as for inheritance (passing on property, titles, debts, and obligations upon the death of an individual)

Section 2 – Name:

Fill 1a if you have not changed your name.

Section 3 – Applicant’s Mailing Address:

If you have mailing adress diffrent than your current adress.

Section 4 – Foreign (non-U.S.) address:

Your current business address/home address

Section 5 – Birth Information:

Your birth city. Mind the weird american date notation MM/DD/YYYY (Why months first? no idea ūüôā )

Section 6 – Other Information:
6a – Your country.
6b – Tax number if you have one.
6c – If you have visa enter date, otherwise ignore it
6d – check Passport, because it is the only document that proves you are foregin and proves your ID.
6e – Check No and ignore 6f, 6g if you didn’t have any US tax numbers.

Section 7 – Signature:

Remeber to sign ūüôā (And mind the date!)

Document that proves your ID:

I suggest the passport (the only document that proves you are foregin and proves your ID). Since sending them a passort is a stupid idea (and I think illegal), you need to certificate it. Thera are many ways to do it, like post office, yet to make sure it will not be rejected go to the nearest embassy/consulate and ask for certification. It costs 50$, but kind lady will do it straight away.

Letter confirming that you need an ITIN.

You may need to provide a letter from Microsoft confirming that you need an ITIN. Click here to download the Microsoft letter, which is provided in PDF format and only in English. The following information must be entered in the Microsoft letter for it to be considered valid:

  • Date: The date you print the form in MM/DD/YYYY format.
  • To: The developer‚Äôs full name in first name + last name format.

If you have done all put it in a envelope and send to

Mail service

Internal Revenue Service
ITIN Operations
P.O. Box 149342
Austin, TX 78714-9342

Curier service

Internal Revenue Service
ITIN Operations
Mail Stop 6090-AUSC
3651 S. Interregional, HWY 35
Austin, TX  78741-0000

Phew!

It took 2 months in my case.  Then send the W-8BEN to MS (it will be validated when you reach the payout threshold Р200$).

Readings

information about W-7

second info with sample

References:

AppHub FAQ

AppHub Froums

How to play music across pages.

Silverlight for Windows Phone 7 is based on the page  navigation system. Key point is the lifetime of pages Рeach page is deleted while you navigate to another. To have an object(singleton f.e.) during the whole application life it could be placed in App class (App.xaml.cs file). MediaElement is definitely an object that should be one (there must be only one music player). The best and simple solution is place the MediaElement in XAML(it needs to be a part of visual tree), I have used application resources:


<!--Application Resources-->
<Application.Resources>
   <MediaElement x:Name="mediaPlayer" Source="/Sound/horrorSong.mp3" AutoPlay="False"  />
</Application.Resources>

Then you can get it from any page:

MediaElement player = null; // get the media element from App resources
if (App.Current.Resources.Contains("mediaPlayer"))
{
   player = App.Current.Resources["mediaPlayer"] as MediaElement;
}
if (player != null)
{
   player.Play();
}

MediaElement can’t play the music while Zune is connect, it is good to prompt the user about it.

if (NetworkInterface.GetIsNetworkAvailable())
{
   if (NetworkInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
   {
      zuneTextBlock.Visibility = System.Windows.Visibility.Visible;
      return;
   }
}
zuneTextBlock.Visibility = System.Windows.Visibility.Collapsed;

This code does not guarantee if Zune is on (User sill can have the plugged phone) but is very likely that Zune is running(Zune starts while you connect the phone).

New versions of Apps

Spirit Level

Classic Metronome

Tip Calc

njoy!

What does not WP7 have.

WP7 missing

  1. Copy and paste text.
  2. Preview of back button stack.
  3. Socekts.
  4. Battery api.
  5. Camera – movie api.
  6. Silverlight integration with XNA.
  7. Exposed MAC address of WIFI.
  8. Tile tap and hold option to unintall the app.

There are rumors that Copy and paste will be fixed on February. Will see.

WP7 Tip

to enter extra sign like < press and hold ( sign.

%d bloggers like this: