More Wally - Wallace B. McClure
in

MoreWally.com

Giving people what they want, More Wally. This is the technical and personal blog site of
Wallace B. (Wally) McClure.

This Blog

Syndication

Technical Sites

More Wally - Wallace B. McClure

This blog will have all kinds of posts about Wally McClure. In it, there will be tons of .NET and computer programming posts as well as Wally's views on life in general. As you might guess, this site and blog help you get More Wally in your life. What more could anyone want? .NET, ADO.NET, ASP.NET, AJAX, Atlas, Microsoft AJAX Library, ASP.NET AJAX, and now Windows Azure............follow me on twitter at Wally
  • Microsoft Windows Mobile 7 Phone Rumors

    I recently blogged about my thoughts on the Microsoft Windows Mobile / Google Android disasters.  In the mean time, Google did nothing to change my thoughts.  They introduced the Nexus One.  It sounds cool until you do a little digging and find out its nothing but a device from HTC that has the Google label all over it.  Sales have not been good.  The marketplace has spoken.

     Now rumors are floating around about a Microsoft Windows (Zune) Phone based on Windows Mobile 7.  Does Microsoft have the ability courage to build and design its own phone?  Seriously, they need to.  Look at Apple and RIM. They control the mobile device marketplace.  They produce phones that customers want, not these products that are shoehorned into some hardware, but devices and designs that people want.

  • Do you care about performance? - .NET Performance Testing and Optimization

    http://www.red-gate.com/products/ants_performance_profiler/care_about_performance_ebook.htm

    My buddy Paul Glavich has written a book on how to optimize performance in an .NET application.  Well done Paul!!!!!!!!

    In this complete guide to performance profiling, Paul Glavich and Chris Farrell explain why performance testing is a good idea and walk you through everything you need to know to set up a test environment. This comprehensive guide to getting started is an essential handbook to any programmer looking to set up a .NET testing environment and get the best results out of it. Download your free copy now.

  • Developing with MonoTouch and the iPhone SDK 3.2 Beta

    Yes Virginia, there is a Santa Claus and yes, you can do development on the iPhone SDK 3.2 Beta, monotouch, monodevelop, C#, and the iPhone today.  I did a check of the System Information and boom, the System Version reports 3.2.

    PS. Somebody on twitter thinks that the picture I had posted with this was an NDA violation.  I have no idea if it is or isn't, since I can't find the NDA on the Apple developer site.  I decided to delete the pic from the post and move on.
     

  • Application running in the iPad Simulator

    I've got some code running in the iPad Simulator.  One thing I discovered is that an application has to be compiled against a specific version of the SDK.  When I created a new iPad application, the updated iPad window for the Interface Builder became available.  Very nice indeed.  Everything was the same as before, so that was good.  I fired up the iPad Simulator, and I got this below:


    The next step was getting my app on there, which was easy.  Then I got my app running on the simulator, and I saw this:


    Basically, everything is filled with goodness and seems to be running correctly.  **fingers crossed**

     

    PS. Somebody on twitter thinks I violated the Apple NDA by putting up an image of what I did. I don't know if I have or haven't, but I've removed them.

  • Developing for the Apple iPad in .NET

    If you are in the technology field, or within the listening range of modern media, you've heard of the Apple iPad.  The fact that it runs an updated version of the Apple iPhone OS is a big plus if you are looking to do development on the platform.  I've already received a bunch of emails about this, so I wanted to share what you can do to do develop on the platform right now.

    First, make sure you mac is running Mac OS 10.6.2.  Next, go get the Apple iPhone SDK 3.2 from the apple developer site. This is beta, so expect updates to it.  Now, go get MonoDevelop Version 2.2.1 for the Mac.  Finally, go get a copy of MonoTouch 1.4.7 (or most recent version).  Once everything is installed, go into MonoDevelop and go to Help -> Updates and check for updates on the experimental channel.  You should find MonoTouch 1.9 alpha.  Download and install it.  Now, you should have everything you need.  From here, you can create an iPhone application with .NET.  This is the same as it is with the shipping versions.  If you look at creating a new solution, you can create an iPad Solution.  Starting and debugging an application brings up the iPad simulator.  Very nice indeed.
  • The iPhone 20 second rule

    If you didn't know it, the iPhone has two twenty second rules that developers need to pay attention to:

    • The iPhone has a startup timer. If an application takes longer than 20 seconds to start up, it is killed by the iPhone OS.
    • The iPhone OS will kill any application that is unresponsive for longer than 20 seconds. To work around this, you will need to perform some type of asynchronous operation.
    The lesson learned on this is that asynchronous processing is a good thing to learn and understand.

    Want to know more about developing with the iPhone?  Check out my Wrox Blox eBook on developing applications with MonoTouch for the iPhone/iPod touch for .NET/C# developers.

  • One thing I don't like about MonoTouch applications

    With .NET, executables are fairly small. Every application shares the .NET Framework, so the applications don’t have their own copy of the framework. MonoTouch is not built into the iPhone. MonoTouch applications must have their own copy of the framework. MonoTouch is compiled into your application. The result is that MonoTouch applications are larger on disk than a comparable .NET application.  Think starting at 5 megabytes for the MT framework and going up from there vs very small with .NET exes.

    Want to know more about developing with the iPhone?  Check out my Wrox Blox eBook on developing applications with MonoTouch for the iPhone/iPod touch for .NET/C# developers

  • Safari and WebKit Development for iPhone OS 3.0

     book cover

    I bought this book a few weeks ago. I've been reading it and trying to absorb the features in the iPhone's version of Safari.   I'm impressed.  This book contains a huge amount of information about Safari on the iPhone.  So, why is this important when you can have apps on the iPhone? Have you tried to get an app onto the iPhone?  Its not an immediate process by any stretch of the imagination.  With a web application, you can deploy applications immediately to the iPhone without having to go through Apple's AppStore process.  Its a great read and is very educational.

  • UIAlertView - the alert box for the iPhone

    There are times when the user needs to be presented with some information or question. MonoTouch has a UIAlertView object. The UIAlertView is instantiated with a set of parameters. On the object instance, the .Show() method is called. For .NET developers, this is similar in concept to the .NET MessageBox. For JavaScript developers, this is similar to the window.alert() and window.confirm() methods. 

                    var av = new UIAlertView("Badness happened"                    , "The scheme '" + prot + "' is not supported on this device.",                    null, "Ok thanks", null);                av.Show(); UIAlertView

    Want to know more about developing with the iPhone?  Check out my Wrox Blox eBook on developing applications with MonoTouch for the iPhone/iPod touch for .NET/C# developers

  • ASP.NET MVP for 2010

    I want to thank Microsoft for naming me an ASP.NET MVP for 2010. 

  • Opening another application on the iPhone using NSUrl

    The NSUrl class is what allows an application to open other applications within the iPhone OS while passing parameters. The calling sequence is fairly simple. There are two steps to making this call:
    1. When the NSUrl class is instantiated, a string representing the URL scheme is called. Note that different applications will have different schemes and use different protocols.
    2. The static method UIApplication.SharedApplication.OpenUrl(ns) is called, where ns is the NSUrl class. When the static method is called, if it is not possible to open a URL, a false is returned. If it is possible to open the URL that is passed, the URL is opened and a true is returned.

     Some code to do this looks like:

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

    NSUrl ns = new NSUrl(prot + first + sec.Trim());

    if (!UIApplication.SharedApplication.OpenUrl(ns))

                {

                    var av = new UIAlertView("Badness happened"

                        , "The scheme '" + prot + "' is not supported on this device.",

                        null, "Ok thanks", null);

                    av.Show();

                }

    Ok, this all sounds cool, now lets look at the format of the url schemes that you can pass into NSUrl.  For a list of them, check out: Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} http://wiki.akosma.com/IPhone_URL_Schemes

    Want to know more about developing with the iPhone?  Check out my Wrox Blox eBook on developing applications with MonoTouch for the iPhone/iPod touch for .NET/C# developers.  

  • Be careful what you name a Project or Solution in MonoDevelop

    I downloaded and installed MonoDevelop 2.2 on my Windows 7 laptop as well as installing Mono 2.6.  Everything installed correctly.  I decided to create my first ASP.NET web application and see if this will actually work.  I created an ASP.NET Web Project.  I got the following errors;

    c:\Projects\MonoDevelop\First MD ASP.NET Web App\First MD ASP.NET Web App\Default.aspx(3,3): Error CS1646: Keyword, identifier, or string expected after verbatim specifier: @ (CS1646) (FirstMDASPNETWebApp)

    c:\Projects\MonoDevelop\First MD ASP.NET Web App\First MD ASP.NET Web App\Default.aspx(1,1): Error CS0116: A namespace does not directly contain members such as fields or methods (CS0116) (FirstMDASPNETWebApp)

    What is the cause of this error?  I've been trying to figure this out.  Then it hit me.  I created a new project with no spaces and not dots.  This new project worked.  Awesome.

  • UIPicker in the iPhone with MonoTouch

     UIPicker

    The UIPicker is visually different than the drop down listbox that most .NET developers are familiar, however, it is designed to perform the same type of function.  It allows users to select from a fixed set of data isntead of typing in data in a text box.  Programming with it is fairly simple.  Inherit from the UIPickerViewModel class and then bind the data.

    Here's the class:

    using System;using MonoTouch;using MonoTouch.UIKit;using MonoTouch.Foundation; namespace OpenUrl{  public class ProtocolData : UIPickerViewModel{ public static string[] protocols = new string[]{"http://", "tel:","http://maps.google.com/maps?q=", "sms:","mailto:"};public string[] protocolNames = new string[]{"Web", "Phone Call", "Google Maps", "SMS", "Email"     };AppDelegate ad;public ProtocolData(AppDelegate pad){ad = pad;}public override int GetComponentCount(UIPickerView uipv){return(1);}public override int GetRowsInComponent( UIPickerView uipv, int comp){//each component has its own count.int rows = protocols.Length;return(rows);}public override string GetTitle(UIPickerView uipv, int row, int comp){//each component would get its own title.string output = protocolNames[row];return(output);}public override void Selected(UIPickerView uipv, int row, int comp){ad.SelectedRow = row;}public override float GetComponentWidth(UIPickerView uipv, int comp){return(300f); }public override float GetRowHeight(UIPickerView uipv, int comp){return(40f);  }}}

    And then you bind data doing something like this:

    ProtocolData protocolDataSource = new ProtocolData(this);ProtocolSelection.Model = protocolDataSource;And there you go, you now have a UIPicker with a list of data.

    Want to know more about developing with the iPhone?  Check out my Wrox Blox eBook on developing applications with MonoTouch for the iPhone/iPod touch for .NET/C# developers
  • The Mono / MonoTouch Soft Debugger

    Honestly, I thought that it was really cool when the Novell guys put a soft debugger into Mono/MonoTouch so that it is possible to debug an application running on the iPhone Simulator or on the actual device.  Basically, its a set of code inside of MonoTouch that will talk back to the debugging device.  According to the document, it works in the simulator, an iPhone attached to your macintosh, or over wifi if you are ont eh same network.  Thanks guys!

     monotouch soft debugger

    Want to know more about developing with the iPhone?  Check out my Wrox Blox eBook on developing applications with MonoTouch for the iPhone/iPod touch for .NET/C# developers

  • Putting a Point on a Map in the iPhone

    I wrote the following code to put a point on a map on the iPhone.  It works pretty well.  Basically, I draw a map, then I inherit from the MKAnnotation object and create a new constructor, go out to geocoder and get a lat lon to senter the map on, and finally, I put a point in the center of the map.  I've got to thank Craig Dunn for the inspiration of inheriting from the MKAnnotation object.

    using System;

    using System.Collections.Generic;using System.Linq;using MonoTouch.Foundation;using MonoTouch.UIKit;using MonoTouch.MapKit;using MonoTouch.CoreLocation; namespace Json{public class Application{static void Main (string[] args){UIApplication.Main (args);}} // The name AppDelegate is referenced in the MainWindow.xib file.public partial class AppDelegate : UIApplicationDelegate{// This method is invoked when the application has loaded its // UI and is ready to runpublic override bool FinishedLaunching (UIApplication app, NSDictionary options){// If you have defined a view, add it here:// window.AddSubview (navigationController.View);window.MakeKeyAndVisible (); MapVw.ZoomEnabled = true;MapVw.UserInteractionEnabled = true;MapVw.ScrollEnabled = true;MapVw.ShowsUserLocation = true; btnMap.TouchDown += BtnMapTouchDown; LocationTF.EditingDidEnd += delegate(object sender, EventArgs e) {       UITextField utf = sender as UITextField;       Console.WriteLine("EditingDidEnd is finished.");       utf.ResignFirstResponder();}; LocationTF.Ended += delegate(object sender, EventArgs e) {}; LocationTF.EditingDidEndOnExit += delegate(object sender, EventArgse) {}; return true;} void BtnMapTouchDown (object sender, EventArgs e){GeoCode gCode = new GeoCode();string location = LocationTF.Text;double lat = 0.0, lon = 0.0, radius = 0.0;Location.ResignFirstResponder();gCode.GetLatLon(location, ref lat, ref lon, ref radius);Console.WriteLine("Lat: " + lat.ToString() + " Lon: " + lon.ToString());MapVw.Region = new MKCoordinateRegion(new CLLocationCoordinate2D(lat, lon),                                      new MKCoordinateSpan(.5, .5));MapVw.ZoomEnabled = true;MapVw.UserInteractionEnabled = true;MapVw.ScrollEnabled = true;btnMap.TouchDown += BtnMapTouchDown;gCode = null;} // This method is required in iPhoneOS 3.0public override void OnActivated (UIApplication application){}   }

    }

    The  MKAnnotuation object is inherited like this:

    using System;using MonoTouch.UIKit;using MonoTouch.MapKit;using MonoTouch.CoreLocation;namespace Json{// concept borrowed from Craig Dunn’s blog.   public class ObjAnnotation : MKAnnotation {           private CLLocationCoordinate2D _coordinate;    private string _title, _subtitle;//getters must be overridden to return necessary data.    public override CLLocationCoordinate2D Coordinate {       get { return _coordinate; }    }//title and subtitle are readonly, thus no setter.    public override string Title {       get { return _title; }    }    public override string Subtitle {       get { return _subtitle; }    }    /// <summary>    /// Need this constructor to set the fields, since the public    /// interface of this class is all READ-ONLY    /// <summary>    public ObjAnnotation (CLLocationCoordinate2D Coordinate,                             string Title, string SubTitle) : base()    {       _coordinate=Coordinate;       _title=Title;       _subtitle=SubTitle;    }} }

    The result is this:

    mapping on the iPhone 

    Want to know more about developing with the iPhone?  Check out my Wrox Blox eBook on developing applications with MonoTouch for the iPhone/iPod touch for .NET/C# developers.

More Posts Next page »
2006 - Wallace B. McClure
Powered by Community Server (Non-Commercial Edition), by Telligent Systems