drupal hit counter
Jerry Huang | All posts by jerry

Jerry Huang apps and developing apps

The first Windows Phone 7 Nokia Lumia 800 released to HK

18. November 2011 22:27 by Jerry in Windows Phone
  • Price at HK$4,398
  • online pre-order starts from Dec 2
  • deliver at Dec 12
  • free Nokia WH-920 Purity earphone offer to the first 2000 orders
  • 3 colors available: Blue, Pink and Black
  • built-in local Apps include WhatsApp (well, this is not local), OpenRice, MyTV, TownGas, AAStock, HK Weather (mango update)
  • Internet Sharing will not be available initially, but will be avaialbe through update or download


WP7 push notification summary

7. November 2011 17:04 by Jerry in Windows Phone Development

First of all, here is a high level briefing how push notification works and what have been involved.

1) your phone application: register push service; receiving notifications
2) your server: sending messages
3) the so-called "Windows Azure": microsoft server (MPNS, Microsoft push notification services), assignning token to your application; forwarding alerts (sent from your server) to your application

Now let's see how it actually works.

step 1) Your application will first register with Azure, and will be assigned back an URI (token) if the registration is successful. P.S: the token is unique per application per device, so that one token would be able to tell the Azure which app on which phone.

step 2) Your application must tell your own server that what URI has been returned (by calling a web service would be classic). It's your job to maintain the subscriber list on your server side. Once a condition is met for sending out an alert to a device, your server application will then use the URI (that previous notified by your app) to send a message (which its format is pre-define by Microsoft) to Azure service.

step 3) Eventually the message will then be transfered to target device via Azure service.

For the details of implementing these steps, I'm pretty sure you would be able to find a bunch of samples and resources via Mr. Google. So, go for itwink

Next, there are 3 types of notification currently supported by WP7.0 and 7.1:

1) Raw. Custom format, maximum 1KB for the message. The message will be discarded ("Suppressed" status) by Azure if your app is not currently running on the phone.

2) Tile. User must "pin to start" your app, otherwise, the message will be discarded ("Suppressed" status) by Azure. The image URI could be pointing to remote (internet) or local (within the phone), as long as it's valid. For remote image, the size must be less than 80KB and the download time has to be less than 1 minute.

3) Toast. If the phone is switch off, the message will have the connection status "TempDisconnected"

What else you may need to know? Here you go...

1) MSDN: http://msdn.microsoft.com/en-us/library/ff402558(v=vs.92).aspx

2) 500 messages per application per device per 24 hours if your server doesn't use SSL to communicate with Azure. By using SSL, you will need to upload your cert via your developer account, and then this limitation is not applicable on your apps. details: http://msdn.microsoft.com/en-us/library/ff941099(v=VS.92).aspx. Last but not least for this issue, a very stupid action is required that you must upload the cert every 4 months if the post here is ture (which most likely is): http://forums.create.msdn.com/forums/t/85207.aspx

IP CAM Controller now has free trial

27. October 2011 14:35 by Jerry in IP CAM

From v1.11 version, the IP CAM Controller will support free trial, and what's more? Price drops to $2.99 for saleyes

You can actually try if the app works for your camera without paying in advance.

As always, in case it doesn't work or has any question, click the "Contact" link above to leave me a message.

For those WP7er who is expecting Whatsapp

21. September 2011 12:13 by Jerry in Windows Phone

Whatsapp just released its beta, it's private beta however, so you are not able to download from market. However, you could directly download from here if your phone is dev unlocked:)

WhatsApp.rar (873.45 kb)

It's not quite stable however. It directly access to all your phone contacts and add those who already used whatsapp to a "favs" list. Then you could send message from people in that list, but it seems couldn't locate my overseas friends whose phone number have a country code prefix. You can also see all your contacts in an "all" list, but sometimes it crashs when I scroll down the list.


Smart Dial v2.0 released!!!

20. September 2011 11:06 by Jerry in Smart Dial

what's new?

  • directly access to your phone Contacts (address book), no need to import from Live account anymore
  • faster load and search performance

Search "Jerry Huang" in Marketplace to download

HD2 Mango: error during registering with your developer account

9. July 2011 19:45 by Jerry in Windows Phone Development

If you are a WP7 marketplace paid developer like me who is not working on a "real" WP7 handset, instead, using HD2. You will find VS2010 cannot debug with your phone after freshing the custom ROM for HD2. The VS2010 compaint that:

The application could not be launched for debugging. Ensure that the target device screen is unlocked and that the application is installed

And then you probably will try to register your phone since you had paid for the 3 developer unlock quota from App Hub. However, the registration program will also throw an error "Error communicating with the developer portal" with error code 0x64. You will know 0x64 is because the phone cannot connect the App Hub registration services after google.

 So what now? Give it up? After some thinking, I suspect the problem is due to the ROM embeded with the "prevent relock" patch which causing the phone cannot connect the registration services. The so-called "prevent unlock" patch is actualy a Registry hack to remove the URL of developer portal which will causing the phone to be relock when connecting with Zune. If so, what I need to do is update the URL back.

	<wap-provisioningdoc><!-- *** COMMENTO *** --><characteristic type="Registry"><characteristic type="HKLM\Comm\Security\LVMod"><parm name="DeveloperUnlockState" value="0" datatype="integer" /></characteristic><characteristic type="HKLM\Software\Microsoft\DeviceReg"><parm name="PortalUrlProd" value="<a href="https://developerservices.windowsphone.com/Services/WindowsPhoneRegistration.svc/01/2010">https://developerservices.windowsphone.com/Services/WindowsPhoneRegistration.svc/01/2010</a>" datatype="string" /><parm name="PortalUrlInt" value="<a href="https://developerservices.windowsphone-int.com/Services/WindowsPhoneRegistration.svc/01/2010">https://developerservices.windowsphone-int.com/Services/WindowsPhoneRegistration.svc/01/2010</a>" datatype="string" /></characteristic><characteristic type="HKLM\Software\Microsoft\DeviceReg\Install"><parm name="MaxUnsignedApp" value="2147483647" datatype="integer" /></characteristic></characteristic></wap-provisioningdoc>

so I made a relock XAP base on above setup, run on my HD2, reboot (must reboot, otherwise won't take effect), register again, done!

The relock XAP could be downlod here (rename to .xap after download), deploy to your phone, tap "HTC-ProvXml-Deploy", click the green icon, your HD2 will be relock again.


Where is the Left, Right, Up and Down buttons in v1.9 IP CAM Controller?

6. July 2011 20:55 by Jerry in IP CAM

From v1.9, I removed the left, right, up and down buttons from the viewer screen. Instead, provided flick/swipe to move gesture support: use your finger flickon the image, e.g. flick left camera will move left.

Apart from new gestures, a new function - save snapshot was being added to viewer screen (both single view and multi-view). Click the button, current image will save into pictures hub (in Saved Pictures category)

The main reason for such "big" change is that gesture is one of the coolest innovation of smart phone, so there is no reason not to make use of it:)

just for fun: sleep sort

29. June 2011 15:02 by Jerry in C#

there are some other versions of implementation in different programming languages, here is my c# version and I believe this sort algorithm will be very hot soon:)

	using System;using System.Collections.Generic;using System.Text;namespace SleepSort{class Program{static void Main(string[] args){int[] ints = { 1, 4, 2, 6, 3 };foreach (int i in ints){SleepSort ss = new SleepSort(i);System.Threading.Thread t = new System.Threading.Thread(ss.Sort);t.Start();}}}public class SleepSort{int i;public  SleepSort(int i){this.i = i;}public void Sort(){System.Threading.Thread.Sleep(i);Console.WriteLine(i);}}}

share on facebook with blogengine

18. June 2011 12:56 by Jerry in BlogEngine

The original post is here: http://blog.sumantdubey.com/post/Share-your-posts-on-Facebook-and-Retweet-them-on-Twitter-with-TWITBOOKSHARE-e28093-BlogEngineNET-Extension.aspx

Unfortunately, the extension class is not working with my latest blogengine 2.0, so I enhanced it a little bit, and now it's working.

download here

  1. place the cs file at App_Code\Extensions
  2. add the css (with notepad) at the end of \themes\the-theme-your-blog-using\style.css
  3. go to extension settings page to enable sharing

IP cameras reviews from the point of view of a developer

11. June 2011 09:48 by Jerry in IP CAM

During the last few months, I had been working with various ip cameras from different brands and types. This review is not focus on functionality but mainly from a developer's angle how the invisible quality of a camera inside is.


  • ACTi
    ACTi is recently supported by IP CAM Controller, but this brand actually has a very long history. They provide comprehensive SDK document but most seems only in C++, not very helpful for me though.

    The user who drawn my attention to support this type of cameras, possess both ACM-1231 and ACM-5601 (both are not PTZ camera BTW). At the beginning, my program is just not working with user’s camera, but working with vendor’s demo one. Then I realized user was using “Web Configurator - Version v2.6”, it’s normal, since he probably brought the cameras a few years ago. After he upgraded to latest v3.0 version, problem gone.

    During my testing, I felt ACTi is a kind of old style, I guess probably because its history. There isn’t too much to say about the functionality since I only tested with these 2 fixed cameras.
  • AirLink
    AirLink is not a big manufacturer I guess, their website is pretty informative for consumer but not for developer. For IP camera, their product line is simple which is good for me since I don’t need to handle different scenarios in coding.

    I worked out for this camera without API documentation, but doing some searching on Google. Later on I accessed to user’s camera and implemented the tap-to-center support. It uses the settings as Ipux, maybe their firmware are the same.

    AirLink is fully supported by IP CAM Controller except zooming, but the camera itself doesn’t support optical zooming neither. As a small brand with reasonable price, it’s a nice choice.
  • Axis
    In my opinion, Axis is more popular for business users. They have various products and full solutions for commercial usages. I guess it also have a high reputation in its market, since it’s top tier cameras in terms of price. I will recommend this if you care about quality while concern less on money.

    Axis is a large and mature vendor; they publish full and different SDK documents for different developing purpose. In my case, I only need the HTTP API which can be easily downloaded from their website.

    Axis is completely supported by IP CAM Controller, including regular PTZ, also tap-to-center. Although they have many product lines, but their HTTP API is consistent in all products. This prove that they are good and mature, since only good API could be well designed at the beginning, then future releases could rely on the steady infrastructure.

    Recently received an inquiry that not working on 207W, after some investigation, turn out that 207W is working on Digest Authentication (while others are working on Basic Authentication). Thanks to Tommy who is the owner of 207W, the IP CAM Controller starts to support digest auth (not only Axis, but all other types as well) since v1.9.
  • Canon
    Canon is one of the biggest and best digital camera providers in the world. Most of their IP cameras are not for home users however. I had tested a few advanced models from a local electric appliances shop. VB-C50Fi for example, equipped with 26x Optical Zoom Lens, this give me excellent experience that I could see everything very clearly. Even after done my programming works, I connected to this camera from time to time just for playing around the zooming:) naughty, huh? As a result, If you want something professional, you must have a look at this.

    As a big vendor, I didn’t get too many troubles during development, except for tap-to-center function. Unlike Axis to provide a straightforward API for this, there is no direct support for this purpose. Nevertheless, I found a walk-around that requesting a dummy still image by specifying the direct coordinate, tricky!
  • D-Link
    Well, D-Link is a kind of suck I have to say. It has several product lines, such as Box, fixed and PTZ types. For different types of D-Link, they have the same web interface (the web page after log on), but I can’t believe that the commands using for similar types of camera are different. For example, 1130L is using a set of commands while 5605 is using another set.

    Another problem I found with DCS-2121 is that tiny difference in firmware version may result of big difference in compatibility. A user from Italy told me that 2121 is working on desktop version but failed in phone version. After comparison between vendor’s demo camera with user’s, it turns out that demo camera is using “1.05_patch01” while user is using “1.05”. What kind of version is that? Patch 01? It’s so un-professional, looks like some kind of productions of personal workshop. I guess this is the reason they don’t publish their SDK document. Maybe they don’t have standard at the moment. It’s really mass.

    Anyway, the reason why 1.05 not working in phone is because the web server in 1.05 cannot retrieve the authentication information, ie. username and password from requests that sent via Windows Phone 7, although from the sniffing software, the credential is already passed to remote 1.05 web server. This could be either D-Link’s problem or Microsoft’s fault (probably the latter in my opinion, ha). Anyway, I worked this out by make up my own authentication header. The IP CAM Controller should be compatible with both 1.05 and 1.05_patch01 firmware since v1.9.

    As for ordinary camera functions, I don’t see particular differences from others, just fair I think. The best supported type with IP CAM controller for D-Link is DCS-5605, PTZ, pan/tilt scan and tap-to-center.
  • Foscam
    Foscam surprises me because this cheap but cool camera has so many users from US and Euro, considering the vendor is a small manufactory base in Shenzhen China mainland. You can find many info regarding this brand on Google, API, consumer reviewers, and guess what, I found someone make a robot with Foscam! (check here), I bet they have very strong sale channel in those regions.

    Latest API is available on request, you can send an email to the support email to get one, they response very fast. Actually I doubt that they are using some sort of open source web server in the Foscam, because I found many small brands are compatible with Foscam’s API, such as Solwise, 7Links.

    The only 2 things a bit annoying me is that 1) Foscam is a bit weird on pan and tilt control. Once the camera is moving, it will not stop until you send a stop command. I only found Sony is a company of that at the moment. 2) No tap-to-center support, their web interface support this feature, but not providing in the API. I reported to vendor, but I don’t think they took my opinion seriously. Anyway, to sum up, if you are looking for something cheap and cool, Foscam was born for you.
  • Lorex
    Lorex is a surveillance solution provider, looks like a pretty big one, listed in Canada. I only tested with LNE3003, a fixed camera. There wasn’t too much difficulty for me, since I only implement view function at the moment.

    It’s not a camera I like though, the camera supports still image, motion JPEG (MJPEG), 3gp and MP4. The camera look like support these format concurrently, ie. viewing MJPEG and MP4 at the same time, but actually it is NOT. You need to setup different port numbers for different streaming format, e.g. 8070 is used by default for MJPEG, 560 is for MP4, etc, And more stupid is that another port (says 85) is using for accessing the web interface via HTTP. I don’t see the point why it has to be like this.

    MJPEG must be connected via HTTP and it’s not sharing with the port of web interface. For example, you visit your camera via, but when you open the live video page, your browser is actually using 8070 to retrieve image. Why not share the same port as other cameras do?

    Besides, although you had set different formats corresponding different ports, you have to choose one and one only for the current image stream format. In other word, your camera is either working on MJPEG format or MP4 at the same time. Then why I have to set those stupid separated port numbers?

    Hopefully I’m wrong above, otherwise it just doesn’t make sense. Or maybe those ports are working exclusively for their DVR.
  • Mobotix
    Mobotix has more than 10 years history. Very good documentation, they host a website for developer and publish the APIs in HTML format. It’s open and professional. With this support, it’s very easy to implement everything. IP CAM Controller supports PTZ and tap-to-center for Mobotix, tested with M12D-S.

    More considerately, if you send something wrong to the camera, it will tell you the possible reason. For example, if you don’t pass a parameter, the camera responses that which parameter is missing. It’s perfect camera for developer.

    For consumer, Mobotix has all functionalities that other brands have, so if the price is reasonable, it's a nice camera to go with.
  • Panasonic
    This is the camera I am using as well as the first camera supported in IP CAM Controller. I had been using BL-C131 for almost 3 years. It comes with 1 year warranty, when my first BL-C131 broken (wifi chip broken, still can work in wired mode) in the second year, I have to buy another one, same type. I’m quite surprise Panasonic didn’t release successive new camera after years.

    In my case, Panasonic is too easy to broken although it’s continuously running 24*7 in my apartment.  (But is this what IP Camera designed for?) And BL-C131 is one of the most expensive cameras. In addition, comparing with other cameras, the viewing angle is too small, only 149° horizontally (some bands could even extend to 270°). The reason I still brought the same type is because I could re-use the parts inside the broken one if the new one broken again. Plus I didn’t have time for shopping and I have to keep an eye on my baby when working.

    Apart from these, it’s a good camera. Support MPEG-4 and MJPEG concurrently (unlike Lorex). Quite stable, contains audio, motion detection, recording, etc, basically everything an IP camera suppose to have. For developer, one set API compatible almost all Panasonic cameras. And I’m impressive for that the new firmware backward compatible with old version. In BL-C131, with latest firmware, there are actually 2 set of commands I could use. This is important and considerate.
  • Sony
    Similar to Canon, not really suitable for home usage. Some types also support 18x even 26x optical zooming.

    I don’t have too much trouble during development for Sony. Comprehensive SDK document, standard API as others, and more importantly, no varieties API for different kinds of products.

    Same as Canon, recommend for professionals. But I don’t like its “foscam-like” pan tilt control.
  • Toshiba
    Another old Japanese brand, fully supported by IP CAM Controller, but tap-to-center seems not working for some types.

    Toshiba looks a bit “high-tech” for me, from its API, it’s not following simply design principle. The streaming path contains too many parameters. It seems trying to be perfect, since you need to encrypt your user name and password to BASE64 format before sending over HTTP. But BASE64 is not for encryption unfortunately. There is no difference for hacker between BASE64 string and plain text. Toshiba provides a direct-move-api which is to implement the tap-to-center functionality, but by using this, you have to understand its “unlike-others” coordinate system. The API accepts only one passing in parameter which is calculated by X and Y via a formula: V = X*256 + Y.
    I’m glad that I’m Chinese, as Chinese are good at maths! LOL

    Anyway, Toshiba maybe not a developer friendly camera, but it seems quite good for consumer, good image quality, easy to use. But I’m not really sure if this is suitable for home usage. The types (IK-WB21A and IK-WB15A) I tested are both seem to be expensive.
  • TRENDnet
    TRENDnet is also a company with long history; at least I received many TRENDnet camera owner enquiries. I’m not sure if TRENDnet has API, I can’t find one on the website. But I found much information from Google, probably a benefit for a large brand with long history.

    Actually it was quite painful when working on TRENDnet. When I published my very early version on marketplace, I received a user’s email saying that IP600 not working for him. This brand has the same problem as D-Link. It cannot accept the user name and password I passed, but instead of replying 401 unauthorized request, it returns a 502 bad gateway error. This misleading me and caused that I spent a lot of time (from Apr to Jun) for this issue. And secondly, different products use different commands, even for similar types IP612P and IP600.

    To sum up, it's definitely not a developer-friendly camera, but maybe good for consumers, otherwise it couldn't survived for that long
  • VivoTek
    Maybe it’s because VivoTek is a Taiwan company, it seems VivoTek is not so popular in US. Actually VivoTek is one of the major brands in Asia.

    I worked out the VivoTek support in desktop version a few months ago, but I haven’t published to phone version until lately. For 7000 series, there are 2 versions of API, the latest one call “V2”. The problem in phone version could be solved by upgrading to latest firmware which is supported V2 API commands. The APIs are available after log on to their website, free registration.
  • Y-Cam
    All Y-Cam at the moment are fixed camera, this is a small UK company I guess. They haven’t published their SDK, but it will be available on request, after you signed the Non-Disclosure Agreement with them. The SDK is informative, even containing some sample codes in C++.

    Actually before I received their SDK, I already figured out the viewing command, I just want to PTZ command from their document. However, later I realized that Y-Cam is not a PTZ camera.

    Their website prodives many live demo in many countries, which is good for both developers and consumers. You can actually have a look before purchase.