September 2010 - Posts - 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

News

Please goy buy 3-4 copies of my book on MonoTouch titled "Professional Android Programming with Mono for Android for .NET/C# Developers." They make great gifts all year round. Plus, I get about $.25 when you buy a copy.

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? iPhone, Android, MonoTouch, MonoDroid, Mobile, HTML5, .NET, ADO.NET, ASP.NET, AJAX, jQuery, jQuery Mobile, ASP.NET AJAX, and Windows Azure............follow me on twitter at Wally

September 2010 - Posts

  • Mobile - Native Apps or HTML?

    So, I'm still trying to decide if the best way to target a mobile device is to go with Native Apps that run on the device and take advantage of all of the features or the device or is the best way to target multiple devices with HTML?  I like the mobile app idea.  I want to take advantage of the device.  No matter what features end up in HTML5 will every solution ever be able to solve every problem out there.  However, for the vast majority of apps, an HTML(5) solution will solve the problem.  With this, I ran across three interesting facts this week:

    • 70% of smart phone users don't care about apps on their device.  Will this number increase, decrease, or stay the same in the future?
    • Apple is definitely making money for developers with their App Store.
    • Android users are expecting apps to be free, or pay less on average for them.
  • Speaking in Huntsville on Ajax, UpdatePanel, Webforms, and Ajax Controltoolkit

    I'm excited. I'll be speaking at the Huntsvlle, AL VS.NET UserGroup Tuesday evening. The subject is Ajax, Updatepbal, Webforms, and the Ajax Control Toolkit. I'm excited about this.
  • Apple officially changes their Developer SDK License - MonoTouch officially makes it - And then go buy a beer on me.

    Great news today.  Apple has updated their developer SDK License effective today.  bookPreviously, MonoTouch was sitting in a grey area.  They appeared to follow the letter of the law, but their was a question if it followed the spirit of the law.  With MonoTouch, I can build a native iPhone app with C# and the .NET framework.  The key is you can build native apps with it. It's a great tool.  I love.  Anyway, now, with Apple's changes that were announced, we now have conclusive proof that Apple is allowing Monotouch based apps.  This is great stuff!.  Along with this announcement, Novell has announced a discount of 15% that is effective for the next two weeks  The  discount code is "MONO-331"  After you go buy a copy of MonoTouch, take the 15% that you saved and buy a copy of our MonoTouch book.  Then, with the money you saved, go buy a beer, sit down and read our book.  Its on me!

  • Book Review - Chris Hay and Brian Prince bring us "Azure In Action"

    In October, 2008, I first read about Microsoft's Azure Platform.  I started working with the product soon after wards. I've built a couple of apps, one that has been up and running for about 18 months. I think of Azure as some great stuff.  As you can well imagine, because I started really early on, I learned a lot of lessons the hard way.  Thankfully, you don't have to.  Chris Hay and Brian Prince have produced a book on building applications with Windows Azure.  I've been really impressed as I have read it.  It has several things that I really like and as a fellow author, I am thankful for.  These are:

    • The book covers more than the 1.0 immediate release.  As a writer, the market wants material immediately.  Unfortunately, fast, fast, fast tends to lead to mistakes.  Given that Azure 1.0 tools were released at the end of 2009 and their book is coming out in Fall, 2010, they've had the opportunity to get things right.
    • The book is based on the tools in Visual Studio 2010.  Awesome, show me the most up to date stuff.  It's what I'm likely to see going forward.
    • Messaging, messaging, messaging.  Trying to explain the concept of messages is hard.  Until you have used it, its really hard to explain the significance of it.  Chris and Brian have devoted a good section of the book to messages and messaging.
    • It would have been really easy for Chris and Brain to just talk about Sql Azure.  It's what Microsoft is going to push because that's what they will push.  Chris and Brian wrote a good amount of material on Sql Azure.  They also spent a significant amount of material/pages/time on Table Storage, which is Microsoft's cloud based NoSql product.  I personally like Table Storage and find it fairly interesting to work with.  I learned a couple of things about Table Storage from reading thier pages on the subject.
    Overall, this book will help you as you develop an application that target's Windows Azure.  You'll be glad when you buy a copy through Amazon or Manning's site.

    DESCRIPTION

    Cloud-based applications pose an intriguing value proposition for businesses. With an easily scalable, pay-as-you-go model and very small startup costs, the cloud can be a great alternative to systems hosted in-house. Developers are scrambling to understand the impact a cloud-based approach will have on current and future projects.

    Azure is Microsoft's full-fledged entry into the "Cloud Services Platform" arena. Unlike other cloud offerings that address only one piece of the puzzle, Azure includes an operating system, a set of developer services, and a data model that can be used individually or together. It's designed to interact seamlessly with other .NET-based components, and leverages your knowledge of Visual Studio, the .NET platform, and SQL Server. It's also fully compatible with multiple internet protocols, including HTTP, REST, SOAP, and XML.

    Azure in Action is a fast-paced tutorial intended for architects and developers looking to develop on Windows Azure and the Windows Azure Platform. It's designed both for readers new to cloud concepts and for those familiar with cloud development but new to Azure. After a quick walk through the basics, it guides you all the way from your first app through more advanced concepts of the Windows Azure Platform.

    The book starts by looking at the logical and physical architecture of an Azure app, and then moves to the core storage services—binary store, tables and queues. Then, it explores designing and scaling frontend and backend services that run in the cloud. Next, it covers more advanced scenarios in Windows Azure. After covering the core of Azure, it introduces the rest of the Windows Azure Platform with a particular focus on SQL Azure Database.

    Table of Contents        

    Part 1 Welcome to the cloud
     1. Getting to know Windows Azure 
     2. Your first steps with a Web role 

    Part 2 Understanding the Azure service model
     3. How Windows Azure works 
     4. It's time to run with the service 
     5. Configuring your service 

    Part 3: Running your site with web roles
     6. Scaling web roles 
     7. Running native, full trust, and other code 

    Part 4 Working with blob storage
     8. The basics of blobs 
     9. Uploading and downloading blobs 
    10. When the blob stands alone  Part 5 Working with structured data
    11. The Table Service, a whole different entity 
    12. Working with the Table REST API 
    13. SQL Azure and relational data 
    14. Working with different types of data 

    Part 6 Doing work with messages
    15. Processing with worker roles 
    16. Messaging with the queue 
    17. Connecting with AppFabric 
    18. Running a healthy service in the cloud
     

  • The battery and background processing on the iPhone with MonoTouch using iOS 4 and later

    When you are programming on the iPhone with, or without, MonoTouch, you need to pay attention to what you are doing with regards to accessing device resources.  I recently wrote a blog post about background processing with the iPhone and specifically with MonoTouch and location based services.  Having worked with this for a while, I wanted to mention that you will want to be careful doing anything like this.  The reason is that the more you bang on services on device, you will use up the battery of the device.  In my case, I was going off device on changes, which was killing the battery even worse.  Bottom line, be careful when you use services and how you use them.  If not, you can use the battery up fairly quickly.
  • Book Review - Julie Lerman's "Programming Entity Framework" Second Edition

    Programming Entity FrameworkI recently received a copy of Julie Lerman's "Programming Entity Framework" 2nd  Edition.  As you may/may not know, I've been rather disappointed by any set of objects that get between me and my database.  I like to be fast and highly optimized for my database connections, commands, and transactions.  I've been rather disappointed with NHibernate's lack of support outside of Sql Server, the fact that there are is a lot of hand editing of the support files, and honestly Entity Framework 1 had enough problems that I decided to stay away.  As I got into Azure, I was doing a lot of LINQ and Entity Framework 1 stuff and starting to be more interested in these technologies.  When .NET 4 shipped, I made the decision to start using EF with new projects.  The only way to effectively learn a new product is to immerse yourself in it completely.  Most of my work to this point has been with simple EF and Linq.  As I have gotten deeper into it, I've been turning to Julie over email and IM to resolve issues that I have had. 

    Now that I have my own copy of Julie (by way of Julie's book), I won't need to bother her quite so much.  I've been reading through the book and am amazed at the content that she covers.  It discusses all of the features that I need to cover plus more.  She starts you off with the basics of Entities and Entity Framework and how its different from the typical thinking we have of databases, goes through simple CRUD, gets into integrating with stored procedures, and then gets into the good stuff.  Wow, who would have thought that there is support for multi-threading, testing, and the complexities of transactions! If you are getting into Entity Framework, this is the book for you!  Run out and get it now.  Its the next best thing to having Julie Lerman sitting right next to you helping you with your code. Its available on Amazon and at O'Reilly's site.

    Book Description: Get a thorough introduction to ADO.NET Entity Framework 4 -- Microsoft's core framework for modeling and interacting with data in .NET applications. The second edition of this acclaimed guide provides a hands-on tour of the framework latest version in Visual Studio 2010 and .NET Framework 4. Not only will you learn how to use EF4 in a variety of applications, you'll also gain a deep understanding of its architecture and APIs. From the Entity Data Model and Object Services to WCF Services, MVC Apps, and unit testing, this book covers everything.

    Table of Contents

    Chapter 1 Introducing the ADO.NET Entity Framework
    The Entity Relationship Model: Programming Against a Model, Not the Database
    The Entity Data Model: A Client-Side Data Model
    Entities: Blueprints for Business Classes
    The Backend Database: Your Choice
    Entity Framework Features: APIs and Tools
    The Entity Framework and WCF Services
    What About ADO.NET DataSets and LINQ to SQL?
    Entity Framework Pain Points Are Fading Away
    Programming the Entity Framework
    Chapter 2 Exploring the Entity Data Model
    Why Use an Entity Data Model?
    The EDM Within the Entity Framework
    Walkthrough: Building Your First EDM
    Inspecting the EDM in the Designer Window
    The Model’s Supporting Metadata
    Viewing the Model in the Model Browser
    Viewing the Model’s Raw XML
    CSDL: The Conceptual Schema
    SSDL: The Store Schema
    MSL: The Mappings
    Database Views in the EDM
    Summary
    Chapter 3 Querying Entity Data Models
    Query the Model, Not the Database
    Your First EDM Query
    Querying with LINQ to Entities
    Querying with Object Services and Entity SQL
    Querying with Methods
    The Shortest Query
    ObjectQuery, ObjectSet, and LINQ to Entities
    Querying with EntityClient to Return Streamed Data
    Translating Entity Queries to Database Queries
    Avoiding Inadvertent Query Execution
    Summary
    Chapter 4 Exploring LINQ to Entities in Greater Depth
    Getting Ready with Some New Lingo
    Projections in Queries
    Projections in LINQ to Entities
    Using Navigations in Queries
    Joins and Nested Queries
    Grouping
    Shaping Data Returned by Queries
    Loading Related Data
    Retrieving a Single Entity
    Finding More Query Samples
    Summary
    Chapter 5 Exploring Entity SQL in Greater Depth
    Literals in Entity SQL
    Projecting in Entity SQL
    Using Navigation in Entity SQL Queries
    Using Joins
    Nesting Queries
    Grouping in Entity SQL
    Shaping Data with Entity SQL
    Understanding Entity SQL’s Wrapped and Unwrapped Results
    Summary
    Chapter 6 Modifying Entities and Saving Changes
    Keeping Track of Entities
    Saving Changes Back to the Database
    Inserting New Objects
    Inserting New Parents and Children
    Deleting Entities
    Summary
    Chapter 7 Using Stored Procedures with the EDM
    Updating the Model from a Database
    Working with Functions
    Mapping Functions to Entities
    Using the EDM Designer Model Browser to Import Additional Functions into Your Model
    Mapping the First of the Read Stored Procedures: ContactsbyState
    Mapping a Function to a Scalar Type
    Mapping a Function to a Complex Type
    Summary
    Chapter 8 Implementing a More Real-World Model
    Introducing the BreakAway Geek Adventures Business Model and Legacy Database
    Creating a Separate Project for an EDM
    Inspecting and Cleaning Up a New EDM
    Setting Default Values
    Mapping Stored Procedures
    Working with Many-to-Many Relationships
    Inspecting the Completed BreakAway Model
    Building the BreakAway Model Assembly
    Summary
    Chapter 9 Data Binding with Windows Forms and WPF Applications
    Data Binding with Windows Forms Applications
    Data Binding with WPF Applications
    Summary
    Chapter 10 Working with Object Services
    Where Does Object Services Fit into the Framework?
    Processing Queries
    Materializing Objects
    Managing Object State
    Managing Relationships
    Taking Control of ObjectState
    Sending Changes Back to the Database
    Implementing Serialization, Data Binding, and More
    Summary
    Chapter 11 Customizing Entities
    Partial Classes
    Using Partial Methods
    Subscribing to Event Handlers
    Creating Your Own Partial Methods and Properties
    Overriding Default Code Generation
    Summary
    Chapter 12 Data Binding with RAD ASP.NET Applications
    Using the EntityDataSource Control to Access Flat Data
    Understanding How the EntityDataSource Retrieves and Updates Your Data
    Working with Related EntityReference Data
    Working with Hierarchical Data in a Master/Detail Form
    Exploring EntityDataSource Events
    Building Dynamic Data Websites
    Summary
    Chapter 13 Creating and Using POCO Entities
    Creating POCO Classes
    Change Tracking with POCOs
    Loading Related Data with POCOs
    Exploring and Correcting POCOs’ Impact on Two-Way Relationships
    Using Proxies to Enable Change Notification, Lazy Loading, and Relationship Fix-Up
    Using T4 to Generate POCO Classes
    Creating a Model That Works with Preexisting Classes
    Code First: Using Entity Framework with No Model at All
    Summary
    Chapter 14 Customizing Entity Data Models Using the EDM Designer
    Mapping Table per Type Inheritance for Tables That Describe Derived Types
    Mapping Unique Foreign Keys
    Mapping an Entity to More Than One Table
    Splitting a Single Table into Multiple Entities
    Filtering Entities with Conditional Mapping
    Implementing Table per Hierarchy Inheritance for Tables That Contain Multiple Types
    Creating Complex Types to Encapsulate Sets of Properties
    Using Additional Customization Options
    Summary
    Chapter 15 Defining EDM Mappings That Are Not Supported by the Designer
    Using Model-Defined Functions
    Mapping Table per Concrete (TPC) Type Inheritance for Tables with Overlapping Fields
    Using QueryView to Create Read-Only Entities and Other Specialized Mappings
    Summary
    Chapter 16 Gaining Additional Stored Procedure and View Support in the Raw XML
    Reviewing Procedures, Views, and UDFs in the EDM
    Working with Stored Procedures That Return Data
    Executing Queries on Demand with ExecuteStoreQuery
    Adding Native Queries to the Model
    Adding Native Views to the Model
    Using Commands That Affect the Database
    Mapping Insert/Update/Delete to Types Within an Inheritance Structure
    Implementing and Querying with User-Defined Functions (UDFs)
    Summary
    Chapter 17 Using EntityObjects in WCF Services
    Planning for an Entity Framework–Agnostic Client
    Building a Simple WCF Service with EntityObjects
    Implementing the Service Interface
    Building a Simple Console App to Consume an EntityObject Service
    Creating WCF Data Services with Entities
    Understanding How WCF RIA Services Relates to the Entity Framework
    Summary
    Chapter 18 Using POCOs and Self-Tracking Entities in WCF Services
    Creating WCF-Friendly POCO Classes
    Building a WCF Service That Uses POCO Classes
    Using the Self-Tracking Entities Template for WCF Services
    Using POCO Entities with WCF Data and RIA Services
    Sorting Out the Many Options for Creating Services
    Summary
    Chapter 19 Working with Relationships and Associations
    Deconstructing Relationships in the Entity Data Model
    Understanding the Major Differences Between Foreign Key Associations and Independent Associations
    Deconstructing Relationships Between Instantiated Entities
    Defining Relationships Between Entities
    Learning a Few Last Tricks to Make You a Relationship Pro
    Summary
    Chapter 20 Real World Apps: Connections, Transactions, Performance, and More
    Entity Framework and Connections
    Fine-Tuning Transactions
    Understanding Security
    Fine-Tuning Performance
    Exploiting Multithreaded Applications
    Exploiting .NET 4 Parallel Computing
    Summary
    Chapter 21 Manipulating Entities with ObjectStateManager and MetadataWorkspace
    Manipulating Entities and Their State with ObjectStateManager
    Using ObjectStateManager to Build an EntityState Visualizer
    Using the MetadataWorkspace
    Building Dynamic Queries and Reading Results
    Creating and Manipulating Entities Dynamically
    Summary
    Chapter 22 Handling Exceptions
    Preparing for Exceptions
    Handling EntityConnectionString Exceptions
    Handling Query Compilation Exceptions
    Creating a Common Wrapper to Handle Query Execution Exceptions
    Handling Exceptions Thrown During SaveChanges Command Execution
    Handling Concurrency Exceptions
    Summary
    Chapter 23 Planning for Concurrency Problems
    Understanding Database Concurrency Conflicts
    Understanding Optimistic Concurrency Options in the Entity Framework
    Implementing Optimistic Concurrency with the Entity Framework
    Handling OptimisticConcurrencyExceptions
    Handling Concurrency Exceptions at a Lower Level
    Handling Exceptions When Transactions Are Your Own
    Summary
    Chapter 24 Building Persistent Ignorant, Testable Applications
    Testing the BreakAway Application Components
    Getting Started with Testing
    Creating Persistent Ignorant Entities
    Building Tests That Do Not Hit the Database
    Using the New Infrastructure in Your Application
    Application Architecture Benefits from Designing Testable Code
    Considering Mocking Frameworks?
    Summary
    Chapter 25 Domain-Centric Modeling
    Creating a Model and Database Using Model First
    Using the Feature CTP Code-First Add-On
    Using SQL Server Modeling’s “M” Language
    Summary
    Chapter 26 Using Entities in Layered Client-Side Applications
    Isolating the ObjectContext
    Separating Entity-Specific Logic from ObjectContext Logic
    Working with POCO Entities
    Summary
    Chapter 27 Building Layered Web Applications
    Understanding How ObjectContext Fits into the Web Page Life Cycle
    Building an N-Tier Web Forms Application
    Building an ASP.NET MVC Application
    Editing Entities and Graphs on an MVC Application
    Summary
    Appendix Entity Framework Assemblies and Namespaces
    Unpacking the Entity Framework Files
    Exploring the Namespaces
    Appendix Data-Binding with Complex Types
    Using Complex Types with ASP.NET EntityDataSource
    Identifying Unexpected Behavior When Binding Complex Types
    Appendix Additional Details About Entity Data Model Metadata
    Seeing EDMX Schema Validation in Action
    Additional Conceptual Model Details
    Additional SSDL Metadata Details
    Additional MSL Metadata Details

     

  • Connecting to Sql Server from WebMatrix using LINQ and Entity Framework Version 4

    I just wanted to post a little fyi on connecting to Sql Server from WebMatrix (Razor, ASP.NET Web Pages) using Entity Framework Version 4.  Connecting seems to work perfectly for me.  I opened up my web site project in Visual Studio 2010.  I then created an ADO.NET Entity Data Model (aka .edmx file).  This file went into the App_Code directory of the project.  I then wrote the code below in a cshtml file:

    @{
        ExampleModel.ExampleEntities ee = new ExampleModel.ExampleEntities();
        var lst = (from l in ee.Customers select new { l.CustomerID, l.Name });
        Response.WriteJson(lst);
    }

    As you can see, the code is fairly simple.  I create the entity connection, create the query, and then pass the query to Response.WriteJson() method.  The Response.WriteJson() method causes the query to execute and then serialize the result. 

    Personal Note: One thing to note is the creation of the object with just the CustomerID and Name values.  This is due to a serialization bug in the first beta of WebMatrix.  Hopefully, this will get resolved in the next ctp/beta of WebMatrix.

  • Thoughts on MBAs, Engineers, Education, and a bunch of other random thoughts this evening

    Sometime around noon today, I ran across a series of tweets by Vivek Wadhwa on Twitter regarding education, MBAs, and a series of great thoughts regarding education, MBAs, Engineers, and a series of other items.  I ran through and started reading the links.  I found them to be very educational.  I always enjoy reading things that discuss regarding business growth.

    I am not sure what Vivek's is driving at with these questions or if I correctly understand them, but in my mind, the questions are:

    • What is the role of engineering in business?
    • What is the role of business education in business?
    • How does one cross between engineering and business concepts?
    • How do you staff a start up?

    Well, where you stand on a subject depends on where you sit.  I've worked at the small start up level and having been through three startups, I thought I would throw out a few thoughts on these below. Here is a brain dump set of thoughts that don't necessarily have a rhyme/reason.

    • What is the role of engineering in business? As an engineer, let me shock you, by saying that engineering for the sake of engineering is worthless, yet I see this all the time.  I love Joel Spolsky's line about "Your job is to ship product and make money."  Now for a small company on its way to starting and growing, I've found that the best way to do things is to invest money into engineering work.  The two that were successful spent more money on engineering than anything else.  There was a tremendous focus on producing products that people wanted.  There was lots of product testing and feedback taken from users to build these products.  In the third unsuccessful startup, I'm not sure where a lot of the money went to, but it was not used on engineering.
      Now, as a company grows, I understand why there is need for other resources management, marketing, finance, and hr are all necessary, but at the startup level, these layers need to be kept at a minimum.  Along with that, there must be an understanding that people need to work together for a common good.
    • What is the role of business education in business?  Hmm, this is a great question.  With me, I never wanted to work forever at a large company.  I wanted to go for a number of years, and then leave to do my own thing.  I was a product of the late 1980s.  I watched as companies decided to fire people left and right. I decided as I watched this continual trend, I saw that  companies were were not interested in the welfare of their employees and that the "social contract" of employment was dead.  If that's the way its done, what do I owe them?  And after working in Corporate America, I saw that as definitely true.  as a result, I got out and decided to do my own thing.  Given the rates that we can charge for our our skills, writing that it allows me to do, and the excuse to get into new technology, I think that this is a better trade than working in Corporate America.  I think the lack of a focus on employees in Corporate America means that you have more start ups, not less.
      I think that this lack of focus means that you have to make the effort to educate yourself and it also means that you must get out, talk with others, and find out what their needs are.  This will help you in product creation and marketing.  I still remember that late May, 2008 product discussion I had while sitting at a bar eating dinner.  I learned more about human nature in 2 hours than I ever learned in my first 41 years of life.  Go talk to people, they'll tell you fairly quickly if you idea is a winner or loser.  That's been something I have lacked as I've spent too much of my time dedicated to engineering, but I've definitely made up for that mistake.
    • How does one cross between engineering and business concepts?  Now, I think that this is easier than it appears.  There is a basic concept that more money has to come in than go out, well, unless you are a dot-bomb, Enron, or WorldCom, and even then, the laws of finance do catch up to you.  Now, while this sounds simple, there are tons of engineers that don't understand this concept, they think that everyone is making money hand over fist.  I get into numerous discussions with others that think that the Apple iPhone AppStore is a huge money maker for Apple.  From every financial analysis I have read, the AppStore is not much more than a break even for Apple.  Its kinda like a loss leader for the iPhone, iPad, iPod Touch devices.  I remember getting into a discussion with a friend of mine not long after I met him regarding something that his company would not do for him.  He was so frustrated with them.  I asked him, "What is the benefit to your employer? It does not make them more money and it does not lower their cost of doing business."  I'm not sure if he ever understood the issue.  Anyway, when I look at engineers, they do not typically make the effort.  If they would just make the effort, they would go way to the front of the line.  It doesn't take a lot, merely that you listen to what the other side is looking to do, what they need, and an understanding of the other side.  Unfortunately, most people, let alone engineers, don't have the ability to put themselves into another person's shoes.
    • How do you staff a startup?  I think that this is fairly simple.  You need to have engineering and marketing.  As things get going, you can add finance, management, hr, and other things.  However, at the beginning, you need to focus on the bare minimums to get going.  Conserve your cash, don't act like a drunken sailor on shore leave.
    There, I think that's my thoughts.  I reserve the right to change them based on whatever reason I want to.

    Posted Sep 06 2010, 03:36 AM by wallym with no comments
    Filed under:
  • StartMonitoringSignificantLocationChanges in iOS 4 question with MonoTouch (iPhone, iPad, iPod touch)

    I got a question on Twitter the other day about why I am using the StartMonitoringSignificantLocationChanges() feature of the CLLocationManager.  I think this link on Apple's Developer site describes why this is significant.  The important text for me is:

    Applications can register for significant location changes only. (Recommended) The significant-change location service is available in iOS 4 and later for devices with a cellular radio. It offers a low-power way to receive location data and is highly recommended. New location updates are provided only when the user’s position changes significantly. If the application is suspended while running this service, new location updates will cause the application to be woken up in the background to handle them. Similarly, if the application is terminated while running this service, the system relaunches the application automatically when new location data becomes available.

    The key parts are:

    • This is the recommended way to handle changes in the background.
    • It only works in iOS 4 and later for devices with a cellular radio, so it will only work on the iPhone and 3g iPad (once it gets iOS 4).  This means that I have to continually borrow my wife's iPhone, which results in some looks of "wtf do you want with it now."
    • The user position changes significantly.  I think that this is a big deal.  The event that you wire up does not go banging on the GPS in the device.  That will help with power, though it won't be the same as if it is not using any power.  Its better than the alternative of using more power.
  • Debug/Release Settings for Simulator/iPhone with MonoTouch in iOS Version 4 with MonoDevelop

    I was working on my iPhone app last night. It requires the features of iOS4. I found a weird behavior. When I ran my app in debug mode on a device, it ran properly. When I ran my app in release mode on a device, I was getting behavior like I was running on iOS3. I was pulling my hair out. After I got back from the gym, I listed my problem on the MonoTouch IRC. Thankfully, someone else had that problem. The issue is that there are different settings for Debug and Release with the Simulator and iPhone. As a result, you have to set the settings appropriately for each configuration. Thankfully, you just need to be aware of this and set it as necessary. Here's the screen you need to be aware of.
    iPhone app settings
2006 - Wallace B. McClure
Powered by Community Server (Non-Commercial Edition), by Telligent Systems