Archives

Archives / 2008 / June
  • Pros and Cons of the Sprint Instinct Phone

    There’s been a lot of hype over Apple’s new iPhone 3G coming out on July 11th as well as Sprint’s recently released Instinct phone.  I was originally going to switch over to AT&T and get the iPhone but it meant switching my wife samsung_sprint_instinct over as well since we need to be able to call each other without using plan minutes.  After evaluating the cost of switching carriers we decided it wasn’t worth it since we’d have to pay $400 to get out of our Sprint contracts and my wife recently bought the PPC-6800 Windows Mobile phone which wasn’t cheap.  We’ve been very happy with Sprint’s network in our area as well.

    sprint-instinctBefore getting the Instinct I had a PPC-6700 so I had to choose between going away from a Windows Mobile phone to a totally different type of touch screen phone that wasn’t based on Windows.  With a Windows Mobile phone you have full control over just about anything you want which is nice if you’re a power user.  But, the flexibility does come at a price.  I also had the problem of not being able to answer calls on occasion, having to reboot almost daily, poor battery life, plus a few others.  Truth be told, I really liked my Windows Mobile phone overall and would buy another one. But, after thinking things through more I came to the conclusion that I mainly used my PPC-6700 for calls, text messaging and the Web and that all of the other bells and whistles were rarely used.  I decided to give the Instinct a try since I really liked the touch screen when I tried out the demo version at the Sprint store and liked some of the features it had such as built-in GPS and streaming TV/radio support.

    Here’s what I really like about the Sprint Instinct:

    • Visual Voice Mail – I’ve always hated skipping through message after message to get to the one I wanted to listen to.  Visual voice mail lets me see my messages just like emails, rewind and fast-forward messages just by sliding my finger on the screen, and deleting messages that I know I don’t need to listen to quickly and easily.
    • GPS Navigation – The Instinct has great GPS navigation capabilities.  2-D and 3-D views are available, voice navigation (which includes announcing street names), directions, etc.
    • Nice Form Factor – The Instinct fits into my hands much better than the PPC-6700 I had before and is really light…yet feels solid.  I suspect those with a Motorola Q or similar models won’t notice that much of a difference, but coming from a “brick” it’s really nice.
    • Great Touch Screen – The touch screen on the Instinct is really, really nice.  It’s much better than I was expecting and provides “haptic” feedback.  Basically you get a little vibration each time you click something successfully on the screen.  Very nice!
    • Fast Download Speeds – From what I’ve heard, Sprint’s EV-DO Rev A network hasn’t officially been turned on yet (last I heard that would happen in July sometime) but the download speeds have been really good.  Good enough that I can stream music or TV from home using Orb quite easily (if you’re going to use Orb with Instinct check out this post). 
    • POP/IMAP Email Access – Some of the early reviews I saw said that you could only integrate with Web-based email accounts like Hotmail or GMail.  That’s not true at all.  I’m able to successfully access POP or IMAP email accounts easily and get nice notifications when an email arrives.
    • Speech to Action – Need to find a gas station or restaurant that’s close to where you are?  Want to call or text someone? The Instinct has integrated “speech to action” features that integrate with Live Search, the phone, text messaging, etc.  Say the business name you want and instantly get access to directions, maps, etc. (assuming it can find the place of course).  The voice recognition doesn’t require training and has worked well for me so far.  It can be trained for additional accuracy too through the settings dialog.
    • Traffic – I carpool to downtown Phoenix now so I’m not as worried about traffic as I used to be, but the Instinct’s GPS features also allow traffic information to be viewed including accidents, average freeway speeds, etc.  Haven’t used that feature a ton but did try it out twice and it seemed fairly accurate.
    • Fast Access to News/Sports/Weather – The Instinct provides nice news and weather viewers to get information about all kinds of things.  Radar maps are also available for the weather.samsung-instinct0
    • Solid Bluetooth Support – My PPC-6700 had Bluetooth support but I had to turn it off and on each time I got in my truck so that it would properly sync.  The Instinct’s Bluetooth support is much, much better.  It syncs perfectly every time with my system and can also be used with stereo Bluetooth headphones (which I don’t have…so I don’t know how well that feature works).
    • TV/Radio -  I don’t watch TV much, but the Instinct makes it easy to watch a wide variety of TV shows on the device and provides many radio stations as well.  The quality of the streamed music has been great even while driving.  I listened to a station while driving for about 30 minutes last night with only a few hiccups.  As mentioned earlier, I use Orb to stream TV or music from my home PC to my Instinct as well…I highly recommend Orb.  All of this should get even better once the EV-DO Rev A network hits the airwaves.
    • Java Based – Because the Instinct uses Java behind the scenes a lot of custom apps and games can be run on it.  There are precious few applications out there right now for the Instinct (although I have found some games that work fine).  Sprint is running a developer contest so I suspect we’ll see a flood of apps coming out soon.  I’m a Microsoft .NET developer but since there are a ton of mobile Java applications out there I’m guessing many will be ported to the Instinct.  Time to brush up on my Java some.
    • SD Card – Music and other items can be stored on an SD card (up to 8gig).
    • Battery Life – For people that don’t have Windows Mobile phones this probably won’t be a big deal.  My PPC-6700 had horrible battery life though so it’s nice to have a phone that lasts a long time even when watching TV or streaming music.

    Here’s what I don’t love about the phone:

    • Internet Browser – The Internet browser built-into the Instinct works fine for many sites and provides a way to zoom in and out and easily scroll down to different parts of a site.  However, it’s nothing compared to the Opera Mini browser.  Unfortunately, the Opera Mini browser doesn’t currently work on the Instinct.  I suspect it will in the future given all of the interest in the device but we’ll have to wait and see.  The built-in browser can only be viewed in landscape mode which is annoying at times as well.
    • Load Issue (minor issue) – The phone normally boots up really fast when I turn it all the way off.  However, there have been 2 times where the load screen sat there for 5+ minutes.  After some time it loads fine, but it’s annoying when it has the temporary hang.
    • Ring tones – I always use custom MP3 ring tones and although the Instinct includes some nice ones, there’s no built-in way to add your own custom ring tones.  However, you can go to http://www.myxer.com and take care of that quite easily.  Myxer provides a simple way to upload a music file (or wallpaper), adjust which parts you want to be your ring tone and then download it on your phone.  Read more about making custom ring tones here.
    • No Voice Recording – I like to write and record music in my spare time and frequently used a program on my PPC-6700 to record song ideas I had so that I didn’t forget them.  I haven’t found a way to do voice recording on the Instinct yet although it certainly has the technology in place.  Time to write an application that can do that I guess.
    • TV/Radio Doesn’t Stream Sometimes – I mentioned earlier that I really like the TV and radio support built-into the Instinct.  On a few occasions I would try to watch a TV show or stream a radio station and get nothing.  I suspect it was a network issue at the time or something along those lines.  The TV/radio features seem to work great overall though.
    • No Themes/Skins – The Instinct only comes with 1 theme which can’t be changed at this point.  I’m surprised they didn’t offer several themes/skins.  If someone wants a more iPhone looking interface then that should certainly be possible (I do like the overall interface of the iPhone much better….seems cleaner).  I’m hoping that Sprint or a 3rd party company will release different themes that can be used on the phone.

    Sprint_1

    I have 30 days to try out the Instinct and if I don’t end up liking it I’ll turn it in for a PPC-6800.  However, at this point I’m really happy with it and although there are a few annoyances (what product doesn’t have them though?) I’m planning on keeping it at this point.  For a first version device they did an amazing job and I think Sprint has a winner on their hands.  It’s no iPhone killer in my opinion having played with some friends’ iPhones in the past, but once they make a better browser available it’ll definitely blur the lines between the two devices.

     

     

     

     

    Twitter  Already on Twitter and interested in getting live updates about blog posts and other information?  Subscribe to my Twitter feed at http://www.twitter.com/DanWahlin.

     

     

    Need to display OrgCharts, site maps or other hierarchies in your ASP.NET applications?  Check out SmartChartPro.

    Read more...

  • Pushing Data to a Silverlight Client with a WCF Duplex Service - Part I

    Silverlight provides several different ways to access data stored in remote locations.  Data can be pulled from Web Services and RESTful services and even pushed from servers down to clients using sockets (see my previous articles on sockets here, here and here).  Silverlight 2 Beta 2 introduces another way to push data from a server to a client using Windows Communication Foundation (WCF) and HTTP.  WCF's support for duplex service contracts makes this possible and opens up unique opportunities for pumping data to Silverlight clients.  In this first part of a two part series I'll demonstrate how a WCF push service can be created and cover the steps to get a sample service up and running.  The second article will focus on the client and show how to communicate with a WCF duplex service and listen for data that's sent.

    Read more...

  • Creating a Silverlight 2 Client Access Policy Socket Server

    Silverlight 2 provides built-in support for sockets which allows servers to push data to Silverlight clients.  By using this feature clients can avoid polling the server on a timed basis to ensure that clients are kept up-to-date.  If you're new to the socket features built-into Silverlight 2 you'll want to read my previous posts to get additional details about how data can be pushed from a server to a client:

    Silverlight 2 Beta 2 (and beyond) checks for a client access policy before accessing sockets located on host domain or cross-domain servers.  An example of a client access policy for sockets is shown next:

    <?xml version="1.0" encoding ="utf-8"?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from>
            <domain uri="*" />
          </allow-from>
          <grant-to>
            <socket-resource port="4530" protocol="tcp" />
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>

    This XML code allows Silverlight to access a TCP socket on port 4530.  A range of ports can be specified in the port attribute if needed (ex: 4530-4532).  Before Silverlight tries to call a server with a socket, it makes a call to the target server on port 943 to check the client access policy and see if the server allows socket connections.  This helps minimize various types of hacker attacks.  If a client access policy is available on the server and the policy allows access to the port the client is trying to call, processing of the socket code continues and Silverlight tries to connect.  If not, the client will be unable to connect due to access being denied by Silverlight.

    An example of creating a client access policy socket server that Silverlight can connect to on port 943 is shown next:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Net;
    using System.Net.Sockets;
    using System.IO;
    using System.Threading;
    using System.Reflection;
    using System.Configuration;
    
    namespace PolicySocketServices
    {
        class PolicySocketServer
        {
            TcpListener _Listener = null;
            TcpClient _Client = null;
            static ManualResetEvent _TcpClientConnected = new ManualResetEvent(false);
            const string _PolicyRequestString = "<policy-file-request/>";
            int _ReceivedLength = 0;
            byte[] _Policy = null;
            byte[] _ReceiveBuffer = null;
    
            private void InitializeData()
            {
                string policyFile = ConfigurationManager.AppSettings["PolicyFilePath"];
                using (FileStream fs = new FileStream(policyFile, FileMode.Open))
                {
                    _Policy = new byte[fs.Length];
                    fs.Read(_Policy, 0, _Policy.Length);
                }
                _ReceiveBuffer = new byte[_PolicyRequestString.Length];
            }
    
            public void StartSocketServer()
            {
                InitializeData();
    
                try
                {
                    //Using TcpListener which is a wrapper around a Socket
                    //Allowed port is 943 for Silverlight sockets policy data
                    _Listener = new TcpListener(IPAddress.Any, 943);
                    _Listener.Start();
                    Console.WriteLine("Policy server listening...");
                    while (true)
                    {
                        _TcpClientConnected.Reset();
                        Console.WriteLine("Waiting for client connection...");
                        _Listener.BeginAcceptTcpClient(new AsyncCallback(OnBeginAccept), null);
                        _TcpClientConnected.WaitOne(); //Block until client connects
                    }
                }
                catch (Exception exp)
                {
                    LogError(exp);
                }
            }
    
            private void OnBeginAccept(IAsyncResult ar)
            {
                _Client = _Listener.EndAcceptTcpClient(ar);
                _Client.Client.BeginReceive(_ReceiveBuffer, 0, _PolicyRequestString.Length, SocketFlags.None,
                    new AsyncCallback(OnReceiveComplete), null);
            }
    
            private void OnReceiveComplete(IAsyncResult ar)
            {
                try
                {
                    _ReceivedLength += _Client.Client.EndReceive(ar);
                    //See if there's more data that we need to grab
                    if (_ReceivedLength < _PolicyRequestString.Length)
                    {
                        //Need to grab more data so receive remaining data
                        _Client.Client.BeginReceive(_ReceiveBuffer, _ReceivedLength, 
                            _PolicyRequestString.Length - _ReceivedLength,
                            SocketFlags.None, new AsyncCallback(OnReceiveComplete), null);
                        return;
                    }
    
                    //Check that <policy-file-request/> was sent from client
                    string request = System.Text.Encoding.UTF8.GetString(_ReceiveBuffer, 0, _ReceivedLength);
                    if (StringComparer.InvariantCultureIgnoreCase.Compare(request, _PolicyRequestString) != 0)
                    {
                        //Data received isn't valid so close
                        _Client.Client.Close();
                        return;
                    }
                    //Valid request received....send policy data
                    _Client.Client.BeginSend(_Policy, 0, _Policy.Length, SocketFlags.None, 
                        new AsyncCallback(OnSendComplete), null);
                }
                catch (Exception exp)
                {
                    _Client.Client.Close();
                    LogError(exp);
                }
                _ReceivedLength = 0;
                _TcpClientConnected.Set(); //Allow waiting thread to proceed
            }
    
            private void OnSendComplete(IAsyncResult ar)
            {
                try
                {
                    _Client.Client.EndSendFile(ar);
                }
                catch (Exception exp)
                {
                    LogError(exp);
                }
                finally            
                {
                    //Close client socket
                    _Client.Client.Close();
                } 
            }
    
            private void LogError(Exception exp)
            {
                string appFullPath = Assembly.GetCallingAssembly().Location;
                string logPath = appFullPath.Substring(0, appFullPath.LastIndexOf("\\")) + ".log";
                StreamWriter writer = new StreamWriter(logPath, true);
                try
                {
                    writer.WriteLine(logPath,
                        String.Format("Error in PolicySocketServer: "
                        + "{0} \r\n StackTrace: {1}", exp.Message, exp.StackTrace));
                }
                catch { }
                finally
                {
                    writer.Close();
                }
            }
        }
    }

    Looking through the code you'll see that it uses the TcpListener class to listen for incoming client connections.  Once a client connects the code checks the request for the following value:

    <policy-file-request/>

    Silverlight automatically sends this text to the policy file socket once it connects.  If the request contains the proper value the code writes the contents of the client access policy back to the client stream (see the OnReceiveComplete() method).  Once the policy file is received, Silverlight parses it, checks that it allows access to the desired port, and then accepts or rejects the socket call that the application is trying to make. 

    An example of the Silverlight GameStream socket application I created to demonstrate the fundamentals of using sockets is shown next.  The code for the application can be downloaded here

    If you're brand new to Silverlight 2 and are interested in getting started with it check out the following video tutorials:

    Silverlight 2.0 Video Tutorials

    Part 1: Creating "Hello World" with Silverlight 2 and VS 2008 Tutorial Video Tutorial
    Part 2: Using Layout Management Tutorial Video Tutorial
    Part 3: Using Networking to Retrieve Data and Populate a DataGrid Tutorial Video Tutorial
    Part 4: Using Style Elements to Better Encapsulate Look and Feel Tutorial Video Tutorial
    Part 5: Using the ListBox and DataBinding to Display List Data Tutorial Video Tutorial
    Part 6: Using User Controls to Implement Master/Details Scenarios Tutorial Video Tutorial
    Part 7: Using Templates to Customize Control Look and Feel Tutorial Video Tutorial
    Part 8: Creating a Digg Desktop Version of our Application using WPF Tutorial Video Tutorial
     

     

    Read more...

comments powered by Disqus