It's Like Building WebParts, for Your Phone - SharePoint Buzz - Your SharePoint Community Resource

SharePoint Buzz on Twitter


    It's Like Building WebParts, for Your Phone 

    An In-Depth Look at Developing Mobile Applications With Mobile Entrée

    Custom development for SharePoint can mean many things.  Workflows, master pages, business data catalog implementations, forms services, reporting capabilities, the list goes on and on.  Since 2003, the staple of custom SharePoint applications has been the custom WebPart.  Mobile Entrée takes the WebPart concept of configurable, modular components, and extends that out to mobile devices.  Lets take a look at the similarities shall we?


    CreateChildControls

    First and foremost; WebParts and Mobile Entrée applications are developed and deployed as SharePoint features.

    The definition of a WebPart within a feature is a .NET class that implements one of two WebPart classes.  Within these WebPart classes you have methods to override in order to add controls to the screen.  Mobile Entrée mirrors this paradigm.  The definition of a mobile application is a .NET class that implements the EntreeServer.Module.EntreeApplication class.  The EntreeApplication class implements some properties and a method to render controls to the mobile device.  This method, called QueryList, can be likened to CreateChildControls.

    Why call it QueryList and not CreateChildControls or Render?  There is a two part answer here:

    1. This method does much more than create or render controls to the client.  It is the call-back method for all click events as well as the delivery mechanism for all screens within your application.
    2. The term QueryList is just that; a query for a "list".  This will make more sense as you read on, but everything that is served to the user's phone is in the form of lists, list groups and list items.  Not lists in terms of list data, but in terms of the structure of the display.

    QueryList has two parameters, EntreeScopeObject and EntreeListObject. The EntreeScopeObject contains information about what URL the user got redirected from [via the http module], information about what item was clicked and form data.  The EntreeListObject is the object that will be returned to the user.  To make the comparison to CreateChildControls where you would use the Controls properties to add interface elements, you would add interface elements to the EntreeApplication through the EntreeListObject that is passed in QueryList.

    The following image illustrates how you add interface elements to a WebPart.  You create web controls, add to or edit their properties and then add them to the Controls property.

    Now, to contrast that with how it's done in a mobile application within the Mobile Entrée framework, see the following illustration.  Notice that the concept is similar, but you are building your interface with list items instead of ASP.NET web controls.


    Event Handling

    So, if the EntreeListObject is akin to the Controls collection your WebPart’s controls are put into, the EntreeScope object is your ViewState/Event Handling for state management and the handling of user clicks.

    The key to handling user interaction in Mobile Entrée is simplicity.  All user interaction flows through the QueryList method and can be accessed via the EntreeScopeObject parameter.  Unlike WebParts, of which a page can have more than one, only a single EntreeApplication is ever interacted with, at a time, on a mobile device.  This keeps things simple for both the user and the developer.  Mobile Entrée takes care of making sure the users’ activity is routed to the correct application and the developer is presented with a simple set of Name/Value pairs of state data, both ViewState-like information and submitted form data.

    Event Handling is a simplified merger of the CommandArgument parameter in WebPart controls and the ViewState system.  In MobileEntree, just about any ListItem can be clickable and so instead of assigning an OnClick event to only specific controls, a ClickAction object can be assigned to any ListItem object.  These ClickAction objects can then be populated with any combination of Name/Value pairs of variables to be sent back in the EntreeScopeObject during a user’s click.

    Essentially, based on values in the  EntreeScopeObject parameters, the developer populates the EntreeListObject with List Groups and List Items that constitute a response to the users’ activity.  This is all the developer needs to worry about.  How this ListObject is presented to the user is food for a future article.


    WebPart Properties

    Comparing how you set up configuration properties is almost identical as well.  Let's extend our hello world example and use a property to allow the user to define who you are saying "Hello" to.  In a WebPart, this is simple, just create a WebBrowsable property that will replace the static "World" text on the label.  The following code snippet would create the property box you see in the tool pane.

    Similarly, the same code snippet within the EntreeApplication class would create the mobile application config property editable from the Mobile Entrée Configuration Page seen here.


    Summing it Up

    So, Mobile Entrée has not only given you a means to create mobile applications within SharePoint, but provided you a familiar way of doing so.  All development and deployment can be done from the same Visual Studio project because Mobile Entrée applications can live in the same features as your WebParts.  The end result is a powerful framework you can leverage to deploy mobile applications with your web applications through methods and practices you use today.

    For more information visit www.mobileentree.com

     
     
    Failed to render control: Value does not fall within the expected range.

    Comments

    Monday, 15 Jun 2009 07:31 by GeoTauAisay
    Thanks for this info

    Monday, 15 Jun 2009 01:26 by Adam Stotts
    Thanks for the post, but I'm trying to understand the need for this....are there limitations to the standard WSS apps on a mobile device?

    Monday, 15 Jun 2009 02:37 by Joe Herres
    @Adam, Currently, there is nothing inside WSS or MOSS that provides developers with a good approach to mobile application development. We built Mobile Entrée to fill that gap and provide a "best practice" approach.

    Sunday, 1 Nov 2009 12:07 by fraynecoll
    energy reductions few confirmation

    Sunday, 1 Nov 2009 12:13 by athmoreflo
    january http://www.ama-assn.org link http://livinlavidalocarb.blogspot.com ocean business http://www.beckersasc.com

    Name:
    URL:
    Email:
    Comments: