Key points for establishing hands-on labs through Azure mobile services

Source: Internet
Author: User
Keywords Applications Azure Mobile services

Overview

The purpose of this article is to provide several learning points for Azure mobile services, which completes hands-on labs.

How do I create a generic project? What is the code between the sharing the Windows Store application and the programs that Windows Phone applies to? How can you make toast messages appear in the device's push notification function? How do I work with a database so that users can add tables, columns, and data? How to add code within a Windows Phone application that allows users to retrieve records and display them through a view control of a list class.

Prerequisites

To complete this hands-on lab, you need to complete the following:

Subscribe to Windows Azure, where you can register to download a free trial: http://azure.microsoft.com/en-us/pricing/free-trial/? wt.mc_id=aeda13c29 Windows Phone Developer account Windows 8.1 and Visual Studio 2013 newer

Specific steps

This hands-on laboratory consists of the following major steps: The estimated time taken to complete the laboratory is 90 minutes.

First step: Create a generic project

In this step, you will configure three Windows Azure virtual machines to be used in the lab. Specifically, you will accomplish the following tasks:

Task 1th: Developing a Generic Application

A general-purpose application allows you to share code between a tablet application and a mobile application. The Visual Studio solution contains three projects. One project for applications based on Windows 8 desktops, laptops, or tablets. The second project is intended for mobile applications. The third project is a code base that is shared between two other projects.

1. You need to create a new mobile phone project. From the File menu, select New/project (New/project).

Create a new mobile phone project

2. From the module panel on the left, select Universal apps (Generic application) as shown below. Next, select the Hub app template and provide a name for your project.

Create and name your project

Task 2nd: Add push notification feature

This task focuses on adding push notification functionality to your mobile application. You should finally reserve a name for your mobile application. You will also modify and/or create a mobile service that is hosted in Microsoft Data Center and supports push notifications.

1. Your project has now been created. The next step is to add a push notification service. Now you add the ability to support push notifications (push notifications). Right-click the phone item in Solution Explorer and select Add/push Notification (Add/push notification).

Add Push notification

2. The wizard will tell you what happens next:

(1) The push channel URI is created. This is a mechanism used by client applications to listen and handle push notifications;

(2) Mobile phone items will also be changed by the code to handle the received push notification;

(3) Your mobile service account will be modified to support push notifications. We will create a new mobile service to support the application.

Understand the changes that will be made

3. You need to log in to Windows Phone Developer portal (Windows Phone Developer portals). This step assumes that you have a valid Windows Phone Developer phone account available to use. If you do not have a Windows Phone developer account, you can register here: Http://www.windowsphone.com/account. Now you can indicate the name for your mobile application. This is the name that will appear in the Windows Phone store. The name must be unique.

Reserve a mobile application name

4. You are now going to create a service, which means that you will use your Windows Azure account to create an Azure mobile service. This means that you have previously been registered and can use Windows Azure.

Create a new Azure mobile service

5. Now you want to provide a name for the Azure mobile service. You also select the runtime Environment, zone, database, username, and password. We chose to create a billing SQL database. Your name will be different from universal-push-notif. You don't have to change the default Run-time environment: JavaScript, but you can select your area.

Create a mobile service

6. Enter the server username.

Provide user name

7. You will now notice that your Azure mobile service has been created. Your name will be different.

Verify the Azure Mobile service you just created

8. Now you want to verify the summary page. You will see that your phone application name and Azure Mobile service have all been created. The system will also inform you that the project source code in Visual Studio will be modified.

View summary information for the Visual Studio Wizard

9. You can now see the completed project in Visual Studio.

To view completed projects in Visual Studio

Task 3rd: Test push Notifications

In the 3rd task, you want to verify that the push notification function is working properly. You want to run your phone application in the emulator and verify that you see the text sample Toast.

1. Right-click the mobile phone item, select Set as a startup project (set as Start item).

Set Start item

2. Running applications and emulators from the taskbar

Starting applications and emulators

3. Now you can see toast notifications have appeared.

View push notifications and applications

4. Sample Toast information will now appear.

View Toast Messages

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.