Build Mobile Apps With Zero Coding
In Chapter 3, you learned how to build several simple mobile Web applications. In this chapter, you'll learn how to create dynamic mobile applications. Creating dynamic mobile applications involves writing code to manipulate the methods and properties of mobile Web Forms controls and to respond to the events those methods and properties raise.
Your mobile application will not be accessible without first publishing it. Click on the Tool Package menu item to launch the Packaging Wizard. In the first step, choose to create a new application definition. Click Next to advance to the next window. In the next window, choose the target platform for your mobile application. As you are targeting Windows Mobile 6 on the Pocket PC, choose the Oracle Lite PPC60 ARMV4I US option. In the next window, you can add any additional files you wish to include with the mobile application. These can be images, resource files, and so on. You would usually include the . cab installation files of your application here. The idea is that when an application is synced to the mobile device, it would not only sync the database, but also everything the mobile device needs to get your application up and running.
Mobile device programming by itself can be a serious test of software engineering skill, where coders are usually forced to work with a fraction of the resources available compared to the full .NET Framework. Screen area, processor speed, memory, and disk space available stand at a fraction of what one would generally get with a desktop computer. In fact, the .NET Compact Framework implements only thirty percent of the full .NET Framework, doing away with a large subset of the classes deemed to be unsuitable for the small footprint required of a mobile application.
One of the challenges mobile application developers face is the different look and feel of applications on different devices. An application that runs perfectly on one device may be totally unusable in another. Not only that, developers often have to learn new languages such as the Wireless Markup Language (WML), Handheld Device Markup Language (HDML) and Compact HTML (cHTML).To cater to the vast array of mobile devices available in the market (PDAs, mobile phones with WAP microbrowsers, and so on), developers can either create multiple sets of documents or use the complex XML Stylesheet Language Transformation (XSLT) to tailor their content for multiple devices. But using XSLT is not a trivial solution, it's a task requiring programmers with good programming foundation. Together with the introduction of the .NET Framework, Microsoft announced the Microsoft Mobile Internet Toolkit (formerly known as the .NET Mobile Web SDK).With the Microsoft Mobile Internet Toolkit, developers can...
We use a text editor to create the mobile applications in this chapter. Chapter 5 illustrates how you can use Visual Studio.NET to create the same application. For readers using the Microsoft Embedded Visual Toolkit 3.0, take note that the Pocket PC emulator by default does not support JScript. This feature will pose a problem for mobile applications that make use of JScript for page navigations. To enable JScript support, you should download the JScript.dll component from Microsoft's Web site.
When developing mobile applications, you'll mostly be concerned with session state management. However, sometimes you might want to manipulate or work with the application state, a mechanism for persisting data between multiple users of an application. A typical example of application state information is a count of the number of users who access an application. You can then render this count to display as a Web hit counter. Debugging Mobile Applications Mobile applications are notoriously difficult to debug. ASP.NET provides rich and powerful debugging facilities that simplify this process.
Integrate mobile applications with other applications by using one of the following patterns Device Logic to Server Logic. With this pattern, a mobile application connects to an application on the server computer. Because most synchronization requires business logic, this is the most frequent option. You can achieve this kind of synchronization with Web Services. Device Logic to Server Data. With this pattern, a mobile application can connect directly to a data repository and obtain data as it is needed based on the application logic. You can achieve this kind of synchronization with the SQL Server .NET Data Provider. The following example demonstrates the use of the SqlCeReplication class to synchronize data in a mobile application with a published database.
A Besides the name change, you can now develop mobile application using Visual Studio.NET. Also, more devices are supported in Beta 2. For more information about the changes from Beta 1 to Beta 2, refer to the documentation that comes with the Toolkit. A Yes, the Mobile Internet Toolkit simply provides an easier way to develop mobile applications that runs on multiple devices.Your user still needs to use a WAP gateway to access your application.
Businesses are exploring the methods of keeping their employees mobile while increasing profitability. Businesses also see that they can increase sales from mobile customers. Customers may want to use mobile devices to buy tickets to sporting events, theaters, and so on. Mobile applications can also deliver traffic information and supply messaging capabilities. This chapter introduces mobile Web applications and discusses the challenges in creating mobile Web applications that can be accessed effectively from a vast array of device types.
With cookieless sessions, the session ID value is placed into the URL for the Web site instead of a cookie. You should plan on implementing cookieless sessions on all mobile applications to assure that your mobile Web site is compatible with the majority of mobile devices.
Security is something that tends to be overlooked, especially in the case of mobile device projects. One likely reason is that mobile applications are not expected to be used in a multiuser environment. Mobile developers often take the shortcut of not implementing any authentication at all. Their argument is that it's your own device and it's only meant for a single user. Some even see the login step for the mobile device as counter-productive.
This application requires a Web.config file with the isWML11 device filter defined in it (included as standard in mobile applications created in Visual Studio .NET). If this application didn't contain the ScriptTemplate defined above, the WML that the client receives is as shown in Listing 8-14. The application in Listing 8-13 inserts the contents of the
Mobile Information 2001 Server provides the capability to develop mobile applications by using standard Web and WAP applications' authoring tools. The server also provides .NET Mobile Web SDK to design and render Web applications. You can also create applications with a common interface regardless of the mobile device used to access the application. This is possible because Mobile Information 2001 Server enables you to use mobile controls and Web forms, which ensure that the content and interface you create remain compatible with various mobile devices.
If you write mobile applications targeting different versions of .NET CF, you will need to explicitly configure the application to run using that specific .NET CF version. The .NET CF App Configuration tool allows you to do this. It is located in this folder on your development machine
In this chapter, we'll examine the design issues and techniques that you'll use to solve these problems and offer some general guidelines for creating useful, effective applications. You'll learn about the basic design principles for mobile applications and the guidelines for designing an effective mobile user interface. We'll also show you how to optimize the performance of your applications.
The Windows Mobile SDK provides an emulator kit that lets you test your mobile applications on a PC without the need for a real device. Although you can test your applications on a real mobile device connected to your PC, chances are you will most likely use the emulator at one point or another out of convenience.
Mobile application development is highly simplified by the .NET Compact Framework. It provides a uniform infrastructure that allows developers to create applications in a way that is similar to standard Windows applications and deploys them in different types of devices. This allows Visual Studio .NET developers to port mobile The .NET Compact Framework includes a subset of the classes that are defined in the System.Windows.Forms and System.Drawing namespaces. These classes allow developers to rapidly build user interfaces for mobile applications. It is important to note that when you create a mobile version of a desktop application, some of the user interface behavior is changed and restricted. However, when you upgrade applications that were created in previous mobile application development environments, such as eMbedded Visual Basic, most of the original functionality is supported and improved with the new .NET Compact Framework. When you create a new mobile application, or port...
When you build mobile applications, it is quite likely that you will have to handle file attachments one way or another. When deciding on a strategy for file handling on the mobile platform, it is usually a good idea to consider how these files will be synced to your enterprise server at the end of the day. There are generally two approaches
For general application configuration settings, such as how long a request is processed before being considered timed-out, the maximum size of a request, or whether to use fully qualified URLs in redirects (a requirement for some mobile applications) we use the configuration settings
Many of the mobile device manufacturers provide emulators that can be used to test mobile Web applications. Emulators display the mobile Web application as it would appear on the hardware device. If an emulator is set to be the default browser, it is displayed when pressing F5 to debug the mobile application.
This approach has additional benefits. Perhaps the desktop application offers a great many options to users. Different users might employ varied subsets of the available options. Thus, they should be able to access a corresponding subset of options in the mobile version. A function in the desktop application that allows users to register their preferences for the mobile application can be used by your application to tailor menus and options when the users access the application from a mobile device.
Microsoft has released a suite of diagnostic tools to help .NET CF developers troubleshoot these types of issues in their applications. The Power Toys for .NET CF 3.5 suite is provided free of charge, and gives you the ability to peek under the .NET CF hood while your mobile application runs. In this chapter, you will learn how to use each tool to resolve commonly encountered .NET CF problems. You will specifically learn about the following
Visual Studio .NET 2003 (code-named Everett) already has built-in support for the .NET Compact Framework, with the corresponding assemblies and project templates to support project-targeting mobile devices. The new project templates are named Smart Device Application and ASP.NET Mobile Application, and they allow us to create applications to be used on either Pocket PC- or Windows CE-based devices. Figure 2 shows the New Solution dialog box of Visual Studio, highlighting the Smart Device Application item.
The upshot of this is that we will still need to design classic and mobile web applications in different ways- even if we don't end up using WML. In fact, WAP 2.0 uses XHTML (although the dialect used looks very similar to and works in a similar way as WML). This may mean that it will be easier for web designers to make the leap to mobile applications, but still doesn't change the fact that a single web application is unlikely to be suitable for all browsers unless specific customizations are made and, of course, one candidate for this could rely on mobile controls.
However, if the user makes changes to a single record, which is more likely in a mobile application, you can adopt a simpler approach. In Listings 9-9 and 9-10, the authors table from the pubs database installed with the .NET Framework samples uses an ObjectList control. The code defines an item command using the syntax in the .aspx file, which allows the user to edit the details. When selected, the editForm form appears, displaying the current field values using editable controls, such as TextBox. To keep the example short, this application allows editing of only the First Name and Last Name fields. Figures 9-3 and 9-4 show how the user interface of this example will look.
The Mobile Internet Toolkit has a development and runtime environment. The separation of these environments within the Mobile Internet Toolkit provides a layer of abstraction between how the application is written and how it is rendered on the target mobile Internet devices. In the development environment, a number of steps are involved in the process of application development creating a Mobile Web Form, adding mobile controls for application UI functionality, integrating business logic, testing on emulators and target devices, and finally posting to the deployment Web server. As we discussed in the preceding section, this server would be a Windows 2000 server with the .NET Framework or a .NET Server and Mobile Internet Toolkit. On the production side (runtime environment), mobile Internet devices would make an HTTP request to the Mobile Internet Toolkit application. A standard *.aspx file name would be used to reference the Mobile Internet Toolkit application.The runtime environment...
Try to evoke the spirit of haiku in your mobile applications simple, clear, concise. If your applications read like poetry, you can consider yourself a very fine software engineer When designing ASP.NET mobile applications, it's good object-oriented practice to separate the code responsible for handling the user interface from code that implements business logic
You will now need to define the users that can access your mobile application. You can do this via the WebToGo portal. The next thing you need to do is to make sure that this user has access to your CRMLIVE mobile application. Click on the main Applications tab. You will be able to see a list of all the mobile applications registered with Oracle Mobile Server. You should be able to spot the application you've just published.
Unlike the old versions, this new version comes with an integrated development environment (IDE) for both creating and testing mobile applications. The text editor included with IDE supports syntax highlighting for WML and WMLScript content.The Openwave SDK is shipped with support of the following standards
If you have developed a mobile application that makes use of remote WCF or web services and you experience problems communicating with the service, you can use Remote Logging to capture all network events that occur between the mobile device emulator and the remote service.
An Oracle Mobile repository makes use of an existing Oracle database to store the server-side data for your mobile applications. After you install Oracle Mobile Server, you will need to create at least one repository. The Mobile Server Repository Wizard will automatically run after your first installation of Oracle Mobile Server.
The MSI installer also provides the standard wizards that make the deployment of your mobile application feel more like a typical PC application installation. The process involved in creating an MSI file is a bit different from that of a CAB file. In a nutshell, you need to do the following ActiveSync handles mobile application installations initiated from the PC via a tool called ceAppMgr.exe. In this first step, you must create an INI file that informs CeAppMgr.exe about your application. As mentioned earlier, all mobile application installations initiated from the PC are handled by ActiveSync (or more particularly, a component called CeAppMgr.exe). Your deployment project must make your application known to ActiveSync by passing an INI file to CeAppMgr.exe. You can create this file manually using any text editor program. The contents of this file should look something like the following
Note that this user control has an external dependency. You must define the isWMLll capability evaluator in the Web.config file of any application you want to use this control. If you use Visual Studio .NET to create your mobile applications, the runtime will include isWMLll in Web.config by default.
When you decide to create a new mobile application that is based on a desktop application, it is necessary to port and review several aspects of the original application. These aspects range from the user interface, to data access, and even to low-level manipulation of the target device. This section provides an overview of the steps that are necessary to port a desktop application to a mobile application. It also discusses some of the tools that are available to port the application, and it details the procedures to facilitate the port. Mobile application. If the target platform of the original application was a mobile device, the mobile environment constraints have already been taken into account. This facilitates the upgrade to the .NET Compact Framework because most of the work is concentrated in specific conversion issues. Otherwise, you have to redesign the application to make it suitable for use on a mobile device. Desktop application. If your intention is to create a mobile...
SQLRDA was one of the earliest methods of data synchronization between a mobile device and an SQL Server database. It allowed the mobile application to issue push or pull commands to sync data upwards or downwards from the SQL Server database. Through the Client Agent, the mobile application could issue these commands to the Server Agent (which sits behind the IIS web server). The Server Agent then executes the requested commands directly on the SQL Server database.
If you have created a WCF web service to consume from your mobile application, you can easily connect to it by adding a web reference to it in your mobile application project in Visual Studio (as you've done in Chapter 10, Building the Dashboard). There is, however, another way to do this. The ServiceModel Metadata tool allows you to quickly generate the classes that are required to connect to a WCF web service. You can even specify the language of the generated source code.
In many cases, your application will require support for offline operations when network connectivity is unavailable. For example, many mobile applications, including rich clients for Pocket PC or Table PC devices, must be able to function when the user is disconnected from the corporate network. Offline applications must rely on local data and user process state to perform their work. When designing offline applications, follow the general guidelines in the following discussion.
Many applications on the mobile device today come with tools that let the user download patches or latest updates from a remote server (when an Internet connection is available) and directly install them on the mobile device. This can help to take the load of maintenance and upkeep of the mobile application off the systems administrator. An automated update service ensures that mobile end users can freely apply patches and updates to their mobile device at the click of a button.
The major pro to building an ASP.NET application that directly targets the iPhone is the deployment of new versions of the application. New versions of the application are directly available to iPhone users the moment the deployment is made to a web server. There is no need to wait for an application to be accepted by the App Store and for users to download the application. While it currently takes two weeks from the time an application is sent to the App Store until the time it is accepted and deployed, the App Store can be bypassed and a web application can made available to users. Developers are able to stay in their existing development environments and use the tools that they are the most familiar with.
As part of the Microsoft mobile solutions offering, Mobile Information Server (MIS) is positioned to be an important piece of an overall mobile solution. MIS is a platform for the delivery of mobile applications.Version 1.0 was released in summer 2001. MIS comes in an Enterprise and Carrier edition providing an end-to-end platform for the delivery of enterprise mobile solutions. MIS typically is hosted in the DMZ (Demilitarized Zone) and sits between enterprise data sources and the various wireless devices. This platform provides an integrated environment for the delivery of mobile applications including enhanced security mechanisms and direct backend integration with the Active Directory.You can use MIS Enterprise Edition for securely deploying Mobile Internet Toolkit applications as well as pushing notifications generated in a Mobile Internet Toolkit event or any other enterprise event sources.
One way or another, most computer applications end up consuming, storing, and rendering data. Computers can store data in many formats, but the relational database system is the most powerful and efficient for complex data queries. To provide small devices with a robust database system, Microsoft has introduced SQL Server 2000 CE Edition. Even with its small footprint, SQL Server 2000 CE Edition supports the fundamental SQL Server programming features. It provides advanced capabilities including remote data access, merge replication, and support for transactions. In this section, we look at installing and using some basic features of SQL Server 2000 CE on a Pocket PC, specifically the Compaq iPAQ. Not every mobile application needs to be in constant communication with a home base as long as the required data is portable and secure.We look at how
Replication features in SQL Server provide availability and performance improvements for applications in many organizations by delivering data copies and updates to multiple servers and remote, and sometimes disconnected, users. Multilocation organizations are able to keep local copies of data for reads and writes, eliminating the need for high-speed, dedicated connections to remote database servers. Mobile application users are able to access and edit data when they are disconnected from any network, allowing them to update the central database when they are able to reconnect to their corporate network or the Internet. In a growing global and mobile user environment that requires immediate and reliable access to information, replication rises to the task.
Lastly, messaging-based mobile applications make use of services such as SMS (Short Messaging Service) and e-mail to drive the interaction between the user and the application. Like the thin client model, it does not require installation of any specific software other than the messaging application itself.
The common language runtime has been specifically designed to address not only the preceding problems, but also quite a few more. It enables reliable applications by eliminating memory leaks. The concept of write-once, run-anywhere has been one of the most sought after treasures in application development. It's been tried before in different ways, but previous approaches always missed the mark. The common language runtime, on the other hand, advances us further down the road by providing a multilanguage execution environment that allows developers to build many different types of applications, from Web services to Windows applications to mobile applications and everything in between. We can now create components and integrate them fully with Web services (and each other) without regard for programming languages. As we've heard before, we truly are now entering a state in which the language becomes a lifestyle choice.
Date selection is a commonly used feature of mobile applications, and in the past, great efforts have gone into making date selection as easy and error-proof as possible. Instead of spending time in building the date selection module, the Mobile API has included the Calendar control. Consider the example shown in Figure 1.33.
Merge replication provides synchronization capability via a publisher-subscriber model. The database at the server side is called the Publisher. It makes a publication (a set of database objects) available for replication. The mobile application is the Subscriber. The setting up of merge replication is a two-step process In the previous diagram, the mobile application uses the replication objects to communicate with the SQL Server CE Client Agent, which passes the changes made to the corresponding Server Agent via IIS. The SQL Server Reconciler is the component that will merge all changes from the Subscriber to the Publisher.
In this last example, you'll build a small application that displays the current time and allows the user to click a button to update the display. This application introduces you to writing Web applications with command-line tools, using the .NET Framework SDK and the Mobile Internet Toolkit. Although you're unlikely to write real-world applications in this way, knowing how the command-line approach works will help you understand the process by which Visual Studio .NET helps you construct a mobile application. This example also shows you how to write code in a code-behind file and override the Page_Load method.
If you're reading this book from cover to cover, you already know that you can use any .NET language to write code for use in mobile applications. In this book, we've chosen to use C , but you can use your favorite language and still be able to do the same things as we're doing here. In this section, we'll delve a little deeper into the .NET languages and then show you where you can place the code you write.
The Machine.Config file contains the defaults for all ASP.NET applications on the machine in which ASP.NET has been installed. In traditional ASP, configuration was handled by script written to update the IIS metabase or through a series of screens and manual setting in the IIS Manager.The Machine.Config is a great place to store information that needs to be consistent across all ASP.NET applications running on that server.The Machine.Config file will play a large role in mobile Web application development, as you will see later in Chapter 4, because it houses device-specific information that you can use in any mobile application.
The Oracle Lite Mobile Server provides synchronization services between the Oracle Lite database on the mobile device and an Oracle database at the backend server. In fact, the Mobile Server does much more than that. It handles the management of all aspects of mobile application deployment, including user management for each application. The web-based WebToGo portal is used to manage the deployment of your mobile applications. This portal is included in the Oracle Mobile Server installation.
I*ve attended several talks and read numerous articles that claim they show you how to 'develop applications for mobile devices'. In fact, they show you how to build Web applications accessible to mobile devices. That's not the same thing. A mobile application resides and executes on the mobile device and leverages the capabilities of that device. Many such applications will also need to retrieve or send information from to the Web. This is an area where Web services really shine You expose your existing or new applications via Web services and you program mobile clients to access those Web services. That way, your back-end applications are device independent Any device can communicate with those Web services given a SOAP stack for that device .
When writing ASP.NET applications for wired clients, you'll often want to disable the view state to enhance your application's speed. This is because the runtime distributes view state information to the client in a way that's similar to the hidden variables you learned about earlier, and sending large amounts of data between the client and server places a large overhead on the network. However, mobile applications are different. For applications built with the Mobile Internet Toolkit, Microsoft changed the implementation of view state because of the extreme bandwidth limitations placed on those clients. For mobile Web applications, the runtime saves view state information in the session and doesn't send that information to the client it only sends the client an identifier.
Get All The Support And Guidance You Need To Be A Success At Dominating Apps. This Book Is One Of The Most Valuable Resources In The World When It Comes To Becoming The Godfather Of Smart Phone Apps.