drupal hit counter
Jerry Huang | apps and developing apps

Jerry Huang apps and developing apps

IP CAM Controller is now on Android market!

27. September 2012 00:36 by Jerry in IP CAM, Android

After several months development, I'm so happy to announace the official release of IP CAM Controller in Google Play for Android phonesyes

Comparing with WP version, it has less functionalities in Android, but it's a wonderful start and all functionalities will be coming soon!

Here is the link for details: https://play.google.com/store/apps/details?id=com.zexu.ipcamera

A monthly view calendar in Windows Phone

17. June 2012 15:45 by Jerry in Windows Phone, Windows Phone Development

For some reason, I need a calendar control in a WP7 app, a special one, or a simple one. However, within the most exciting Metro world, it doesn't easy to get high sometimes - officially you don't have calendar control, you need to google it and, you don't have too many opotions after google. This is one of the biggest problem of WP7 development in my opinion. There is too few controls for developers to use.

Anyway, the control I need is a months view calendar that shows 12 months of the year and probably highlighted the current month. The year could be changed somehow. Eventually I found the regular calendar here:

http://adayofrequiem.blogspot.hk/2012/03/month-view-calendar-for-wp7.html

It said it's a "month-view-calendar" but it''s not really the month-view in this articlefrown, so based on the author's source code, I made my own MothView control. Take a look:

It doesn't look very excited, you may need to decorate a little to make it looks pretty. Here is the full source code:

monthview.rar (174.37 kb)

Force a data binding to update

16. June 2012 18:41 by Jerry in Windows Phone Development

The beauty of data binding in Silverlight or WP7 is that it completely separate the UI and data access logics. The ugliness of data binding however is that it doesn't work or work as expect sometimes. The problem is always in Two-Way binding for data input. Consider a very common and straightforward scenario:

A regular page that contains a few textboxes and listpickers for user to input something, and there are 2 buttons inside the application bar - done and cancel. Once user tap the "done" button, data save( or do some validation before that); tap the cancel button simply reset all data input controls. As a result, the best way to implement this is to use a two-way data binding that binding the textbox's Text property to your ViewModal class. Very easy, just a few lines of coding. Is that it? In most cases, yes. However.......

If a user is tapping the "done" button without leaving the textbox (i.e. without losing focus on the textbox), what will happen? The expected behavior is the text binding to viewmodal class and data get saved. You are just too innocent if you think sowink. The text will never get update to your viewmodal class before losing focus. The reason is that the default UpdateSourceTrigger (check MSDN for details) for a textbox (or maybe other controls) is the LostFocus event. With WPF, you may easily change this property like:

[code language=XML]<textbox text="{Binding TextViewModelProperty}" updatesourcetrigger="PropertyChanged"> </textbox>[/code]

In Siliverlight for WP7 however, the XAML doesn't support UpdateSourceTrigger, so you will have to do it manually in your save function:

[code language=C#]object focusObj = FocusManager.GetFocusedElement();
if (focusObj != null && focusObj is TextBox)
{
    var binding = (focusObj as TextBox).GetBindingExpression(TextBox.TextProperty);
    binding.UpdateSource();
}[/code]

 

Once the UpdateSource methid is called, text will be flush to your view-model class. This is the way I used to force a data binding to be inforced. Above coding is based on the post here (no 9 answer):

http://stackoverflow.com/questions/5569768/textbox-binding-twoway-doesnt-update-until-focus-lost-wp7

*credit goes to "StefanWick" and "rrhartjr" (for the WPF part)

 

Is this the end of the story? Is your input page perfect now?  Hoho you wish. The following issue is not really related to data binding but it's very common in every data-input-page with use of application bar button to save. The problem is that data will be save twice if you tap the "done" button quick enough. This bug is actully exists in the latest Facebook app. When you post a piece of comment on somebody's photo in (WP7 facebook app), once tap the "send" button, progress bar (the dot dot dot stuff) shows up at top of the screen, if you tap the "send" button again (believe me, you can), your comment will be posted twice.

I don't know how others resolve this issue, but here is what I did:

1) Write a private function in the xaml.cs
[code language=C#]
         private void EnableControls(bool enabled)
         {
             foreach (Microsoft.Phone.Shell.ApplicationBarIconButton btn in ApplicationBar.Buttons)
             {
                 btn.IsEnabled = enabled;
             }
             pvMain.IsEnabled = enabled;//the Pivot control
         }
 [/code]

2) call EnableControls(false); before the save data function

3) I assume you will bind a property like "InProgress" to the progress bar's IsIndeterminate property, like:

[code language=XML]<toolkit:PerformanceProgressBar x:Name="progressBar" VerticalAlignment="Top" IsIndeterminate="{Binding InProgress}" />[/code]

so the trick here is to call EnableControls(true) when the InProgress becomes false which means the data is saved.
 

[code language=C#]
        void vmNewTrans_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
                case "InProgress":
                    if (!vmNewTrans.InProgress)
                    {
                        EnableControls(true);
                    }
                    break;
            }
        }
[/code]

That's it! No matter how quick you try to save twice, you will never get duplicated data:)

A major update of IP CAM Controller

8. February 2012 15:39 by Jerry in IP CAM, Windows Phone

I'm glad to annance that the v2.0 has been released to marketplace:)

V2.0 Relase Note
* App upgrades to Mango
* digital zooming
* pin camera to start and live tile update
* support new cameras: TP-Link, COMPRO, Level One, WansView,LogiLink
* new language: Swedish
* gesture support for pan and tilt scan
* Alarm and IR toggle for foscam, light toggle for axis

the new version is now based on the Mango WP7, that's why you will have those cool features like pin to start and live tile.

Are you ready to Mango? Let me know please...

11. January 2012 12:34 by Jerry in IP CAM

Recently I received a couple of great ideas from users (thanks, really!):

  • Live Tile support
    haven't made up the details, but one thing for sure is that the snapshot could be pin as icon or background
  • Pin the camera you created on IP CAM Controller to start screen
    this is really cool! Extremely fast to access to your camera, it's really one tap does the job. Moreover, you could use the camera snapshot as the back tile backgroup. (In Mango, each Tile has front one and back one, they are dynamically switched by the phone automatically)

However, as some of you may or maynot know, the current app is developed on earlier SDK (what we called 7.0 version) so that it's compatible with Mango and non-Mango (such as NoDo) devices. The above two features cannot be supported until the project is upgraded to SDK 7.1 (Mango SDK).

Once the project has been upgraded, the app is still available for non-Mango users, but they will not receive any update nofitication from marketplace, in other word, their IP CAM Controller will stick with existing version (v1.13) and not able to upgrade to any newer version until their phones are being upgraded.

I don't know how many people are still using earier version of Windows Phone, so I made a poll here, to collect your opinions and what phone you are using.

Please click here for the vote

 

The number one IP CAM app in "Music & Video" category on WP7 Marketplace

6. January 2012 18:21 by Jerry in

Finally, IP CAM Conotroller becomes the no. 1 IP Camera software in the Music & Video category, or ranking at top 18 in the category (US market) today. In the meanwhile, v1.13 has just been released.

I want to say thank you to all users (most likely they are parents like mecheeky). I'm so much appreciated for all your support in the past few months. As a result, I removed the time limitation on free trial from v1.13 version. Instead of having 3 minute limit on viewing for free trial users, there will be an ad bar showing up. The ad will be completely removed plus capacity of accessing multi view afte purchase. I hope this is acceptable for you.

The v1.13 starts to support multiple languages: Simplified and Traditional Chinese, German and Spanish (beta). Swedish will be coming in the next release, and maybe French:) If your language hasn't been listed, and you are happy to become an volunteer, please do contact me!

Voluntary translators wanted!

19. December 2011 17:52 by Jerry in IP CAM

I'm currently working on the localization of my app (IP CAM Controller), the next release of the app would at least support English and both Simplified and Traditional Chinese.

In fact, I wish to support as many languages as possible. So I would like to invite any one of you could help me out. If you are interested to be a volunteer, please click the "Contact" link at the top, and leave me a message with details such as what language you could do. I will reply you as soon as possible, thanks!

Lumia 800 pre-order

27. November 2011 01:37 by Jerry in Windows Phone

Although the Nokia officially annanced that the pre-order starts from Dec 2, I have just verified by myself that Nokia Lumia 800 pre-order could be made right now at Nokia's local store at HK. You need to pay HK$300 deposit for each phone you order. The deposit is un-refundable if you decide to cancel the order while it will count into the total amount when you pick up the phone and pay the rest.
 
According to the staff, the free earphone offer is available per phone if you place the order now. However, it won't be shipped with the phone at Dec 12, it will be provided later instead.
 
In case you are wondering, I ordered 3 lumia 800 myself at the Nokia store which next to Time Square at Causeway Bay.
 

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.

Parties:
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