Skip to content

Commit

Permalink
Merge pull request #2532 from RickSaling/bug249778
Browse files Browse the repository at this point in the history
Bug249778: fix markup
  • Loading branch information
mollybostic committed Feb 18, 2014
2 parents 7396c33 + 54c4ac1 commit 208d4e1
Show file tree
Hide file tree
Showing 3 changed files with 31,113 additions and 98 deletions.
91 changes: 11 additions & 80 deletions articles/mobile-services-android-get-started-push.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<properties linkid="develop-mobile-tutorials-get-started-with-push-android" urlDisplayName="Get Started with Push (Android)" pageTitle="Get started with push notifications (Android) | Mobile Dev Center" metaKeywords="" description="Learn how to use Windows Azure Mobile Services to send push notifications to your Android app." metaCanonical="" services="" documentationCenter="Mobile" title="Get started with push notifications in Mobile Services" authors="" solutions="" writer="ricksal" manager="" editor="" />


<properties linkid="develop-mobile-tutorials-get-started-with-push-android" urlDisplayName="Get Started with Push (Android)" pageTitle="Get started with push notifications (Android) | Mobile Dev Center" metaKeywords="" description="Learn how to use Windows Azure Mobile Services to send push notifications to your Android app." metaCanonical="" services="" documentationCenter="Mobile" title="Get started with push notifications in Mobile Services" authors="ricksal" solutions="" writer="ricksal" manager="dwrede" editor="" />


# Get started with push notifications in Mobile Services
Expand All @@ -9,27 +7,17 @@
<a href="/en-us/develop/mobile/tutorials/get-started-with-push-dotnet" title="Windows Store C#">Windows Store C#</a><a href="/en-us/develop/mobile/tutorials/get-started-with-push-js" title="Windows Store JavaScript">Windows Store JavaScript</a><a href="/en-us/develop/mobile/tutorials/get-started-with-push-wp8" title="Windows Phone">Windows Phone</a><a href="/en-us/develop/mobile/tutorials/get-started-with-push-ios" title="iOS">iOS</a><a href="/en-us/develop/mobile/tutorials/get-started-with-push-android" title="Android" class="current">Android</a><a href="/en-us/develop/mobile/tutorials/get-started-with-push-xamarin-ios" title="Xamarin.iOS">Xamarin.iOS</a><a href="/en-us/develop/mobile/tutorials/get-started-with-push-xamarin-android" title="Xamarin.Android">Xamarin.Android</a>
</div>

<div class="dev-onpage-video-clear clearfix">
<div class="dev-onpage-left-content">

<p>This topic shows you how to use Windows Azure Mobile Services to send push notifications to an Android app. In this tutorial you add push notifications using the Google Cloud Messaging (GCM) service to the quickstart project. When complete, your mobile service will send a push notification each time a record is inserted.</p>
</div>

<!--
<div class="dev-onpage-video-wrapper">
<a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Android-Add-Push-Notifications-to-your-Apps-with-Windows-Azure-Mobile-Services" target="_blank" class="label">watch the tutorial</a>
<a style="background-image: url('/media/devcenter/mobile/videos/mobile-android-get-started-push-180x120.png') !important;" href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Android-Add-Push-Notifications-to-your-Apps-with-Windows-Azure-Mobile-Services" target="_blank" class="dev-onpage-video"><span class="icon">Play Video</span></a><span class="time">17:11</span></div>
</div>
-->


This tutorial walks you through these basic steps to enable push notifications:

1. [Enable Google Cloud Messaging]
2. [Configure Mobile Services]
2. [Add push notifications to your app]
3. [Update scripts to send push notifications]
4. [Insert data to receive notifications]
* [Enable Google Cloud Messaging](#register)
* [Configure Mobile Services](#configure)
* [Add push notifications to your app](#add-push)
* [Update scripts to send push notifications](#update-scripts)
* [Insert data to receive notifications](#test)

This tutorial requires the following:

Expand All @@ -38,67 +26,19 @@ This tutorial requires the following:

This tutorial is based on the Mobile Services quickstart. Before you start this tutorial, you must first complete [Get started with Mobile Services].

<h2><a name="register"></a><span class="short-header">Enable GCM</span>Enable Google Cloud Messaging</h2>
##<a id="register"></a>Enable Google Cloud Messaging

<div class="dev-callout"><b>Note</b>
<p>To complete the procedure in this topic, you must have a Google account that has a verified email address. To create a new Google account, go to <a href="http://go.microsoft.com/fwlink/p/?LinkId=268302" target="_blank">accounts.google.com</a>.</p>
</div>

<!--
1. Navigate to the [Google Cloud Console] web site, sign-in with your Google account credentials, and click **Create Project**.
![][7]
2. Fill in a Project Name and Project ID, and choose **Create**.
![][8]
3. Choose **Continue** and follow the SMS verification process.
![][9]
4. Make a note of the Project Number in the Dashboard section. Later in the tutorial you set this value as the PROJECT_ID variable in the client.
5. Choose **APIs**, and scoll down the right pane until **Google Play Android Developer API** appears. Choose the **OFF** button, agree to the Terms Of Service, and choose **Accept**.
![][10]
6. Choose **Registered apps**,

1. Navigate to the <a href="http://go.microsoft.com/fwlink/p/?LinkId=268303" target="_blank">Google apis</a> web site, sign-in with your Google account credentials, and then click **Create project...**.
![][1]
<div class="dev-callout"><b>Note</b>
<p>When you already have an existing project, you are directed to the <strong>Dashboard</strong> page after login. To create a new project from the Dashboard, expand <strong>API Project</strong>, click <strong>Create...</strong> under <strong>Other projects</strong>, then enter a project name and click <strong>Create project</strong>.</p>
</div>
2. Click the Overview button in the left column, and make a note of the Project Number in the Dashboard section.
Later in the tutorial you use this value to initialize the `SENDER_ID` variable in the client.
3. On the <a href="http://go.microsoft.com/fwlink/p/?LinkId=268303" target="_blank">Google apis</a> page, click **Services**, then click the toogle to turn on **Google Cloud Messaging for Android** and accept the terms of service.
4. Click **API Access**, and then click **Create new Server key...**
![][2]
5. In **Configure Server Key for API Project**, click **Create**.
![][3]
6. Make a note of the **API key** value.
![][4]
-->

[WACOM.INCLUDE [Enable GCM](../includes/mobile-services-enable-Google-cloud-messaging.md)]

Next, you will use this API key value to enable Mobile Services to authenticate with GCM and send push notifications on behalf of you app.

<a name="configure"></a><h2><span class="short-header">Configure the service</span>Configure Mobile Services to send push requests</h2>
##<a id="configure"></a>Configure Mobile Services to send push requests

1. Log on to the [Windows Azure Management Portal], click **Mobile Services**, and then click your app.

Expand All @@ -110,7 +50,7 @@ Next, you will use this API key value to enable Mobile Services to authenticate

You mobile service is now configured to work with GCM to send push notifications.

<a name="add-push"></a><h2><span class="short-header">Add push notifications</span>Add push notifications to your app</h2>
##<a id="add-push"></a>Add push notifications to your app



Expand Down Expand Up @@ -253,7 +193,7 @@ Your app is now updated to support push notifications.
The `google-play-services.jar` library file is now shown in your project.
-->

<h2><a name="update-scripts"></a><span class="short-header">Update the insert script</span>Update the registered insert script in the Management Portal</h2>
##<a id="update-scripts"></a>Update the registered insert script in the Management Portal

1. In the Management Portal, click the **Data** tab and then click the **TodoItem** table.

Expand Down Expand Up @@ -285,7 +225,7 @@ Your app is now updated to support push notifications.

This registers a new insert script, which uses the [gcm object] to send a push notification (the inserted text) to the device provided in the insert request.

<h2><a name="test"></a><span class="short-header">Test the app</span>Test push notifications in your app</h2>
##<a id="test"></a>Test push notifications in your app

<div class="dev-callout"><b>Note</b>
<p>When you run this app in the emulator, make sure that you use an Android Virtual Device (AVD) that supports Google APIs.</p>
Expand Down Expand Up @@ -328,15 +268,6 @@ You have successfully completed this tutorial.
In this simple example a user receives a push notification with the data that was just inserted. The device token used by APNS is supplied to the mobile service by the client in the request. In the next tutorial, [Push notifications to app users], you will create a separate Devices table in which to store device tokens and send a push notification out to all stored channels when an insert occurs.


<!-- Anchors. -->

[Enable Google Cloud Messaging]: #GCM
[Configure Mobile Services]: #configure
[Update scripts to send push notifications]: #update-scripts
[Add push notifications to your app]: #add-push
[Insert data to receive notifications]: #test
[Next Steps]:#next-steps

<!-- Images. -->

[1]: ./media/mobile-services-android-get-started-push/mobile-services-google-developers.png
Expand Down
29 changes: 11 additions & 18 deletions articles/notification-hubs-android-get-started.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<properties linkid="develop-notificationhubs-tutorials-get-started-android" urlDisplayName="Get Started" pageTitle="Get Started with Windows Azure Notification Hubs" metaKeywords="" description="Learn how to use Windows Azure Notification Hubs to push notifications." metaCanonical="" services="notification-hubs" documentationCenter="Mobile" title="Get started with Notification Hubs" authors="" solutions="" writer="ricksal" manager="dwrede" editor="" />
<properties linkid="develop-notificationhubs-tutorials-get-started-android" urlDisplayName="Get Started" pageTitle="Get Started with Windows Azure Notification Hubs" metaKeywords="" description="Learn how to use Windows Azure Notification Hubs to push notifications." metaCanonical="" services="notification-hubs" documentationCenter="Mobile" title="Get started with Notification Hubs" authors="ricksal" solutions="" writer="ricksal" manager="dwrede" editor="" />
# Get started with Notification Hubs

<div class="dev-center-tutorial-selector sublanding"><a href="/en-us/manage/services/notification-hubs/getting-started-windows-dotnet" title="Windows Store C#">Windows Store C#</a><a href="/en-us/manage/services/notification-hubs/get-started-notification-hubs-wp8" title="Windows Phone">Windows Phone</a><a href="/en-us/manage/services/notification-hubs/get-started-notification-hubs-ios" title="iOS">iOS</a><a href="/en-us/manage/services/notification-hubs/get-started-notification-hubs-android" title="Android" class="current">Android</a><a href="/en-us/manage/services/notification-hubs/getting-started-xamarin-ios" title="Xamarin.iOS">Xamarin.iOS</a><a href="/en-us/manage/services/notification-hubs/getting-started-xamarin-android" title="Xamarin.Android">Xamarin.Android</a></div>
Expand All @@ -8,11 +8,11 @@ In this tutorial, you create a blank Android app that receives push notification

The tutorial walks you through these basic steps to enable push notifications:

1. [Enable Google Cloud Messaging]
2. [Configure your Notification Hub]
3. [Connecting your app to the Notification Hub]
4. [Testing your app]
5. [Send notifications from your back-end]
* [Enable Google Cloud Messaging](#register)
* [Configure your Notification Hub](#configure-hub)
* [Connecting your app to the Notification Hub](#connecting-app)
* [Testing your app](#run-app)
* [Send notifications from your back-end](#send)

This tutorial demonstrates the simple broadcast scenario using Notification Hubs. Be sure to follow along with the next tutorial to see how to use notification hubs to address specific users and groups of devices.

Expand All @@ -23,7 +23,7 @@ Completing this tutorial is a prerequisite for all other notification hub tutori

<div class="dev-callout"><strong>Note</strong> <p>To complete this tutorial, you must have an active Windows Azure account. If you don't have an account, you can create a free trial account in just a couple of minutes. For details, see <a href="http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=A0E0E5C02&amp;returnurl=http%3A%2F%2Fwww.windowsazure.com%2Fen-us%2Fdevelop%2Fmobile%2Ftutorials%2Fget-started%2F" target="_blank">Windows Azure Free Trial</a>.</p></div>

<h2><a name="register"></a><span class="short-header">Enable Google Cloud Messaging</span>Enable Google Cloud Messaging</h2>
##<a id="register"></a>Enable Google Cloud Messaging

<p></p>

Expand Down Expand Up @@ -63,7 +63,7 @@ Completing this tutorial is a prerequisite for all other notification hub tutori

Next, you will use this API key value to enable your notification hub to authenticate with GCM and send push notifications on behalf of your application.

<h2><a name="configure-hub"></a><span class="short-header">Configure your Notification Hub</span>Configure your Notification Hub</h2>
##<a id="configure-hub"></a>>Configure your Notification Hub

1. Log on to the [Windows Azure Management Portal], and then click **+NEW** at the bottom of the screen.

Expand Down Expand Up @@ -93,7 +93,7 @@ Next, you will use this API key value to enable your notification hub to authent

Your notification hub is now configured to work with GCM, and you have the connection strings to register your app and send push notifications.

<h2><a name="connecting-app"></a><span class="short-header">Connecting your app</span>Connecting your app to the Notification Hub</h2>
##><a id="connecting-app"></a>Connecting your app to the Notification Hub

1. In Eclipse ADT, create a new Android project (File, New, Android Application).

Expand Down Expand Up @@ -239,7 +239,7 @@ Your notification hub is now configured to work with GCM, and you have the conne
}


<h2><a name="run-app"></a><span class="short-header">Test your app</span>Testing your app</h2>
##<a name="run-app"></a>Testing your app

You can test this app with an actual Android phone, or with the emulator. When you run it in the emulator, make sure that you use an Android Virtual Device (AVD) that supports Google APIs.

Expand All @@ -259,7 +259,7 @@ You can test this app with an actual Android phone, or with the emulator. When y
<p>In order to receive push notifications, you must set up a Google account on your Android Virtual Device (in the emulator, navigate to <strong>Settings</strong> and click <strong>Add Account</strong>). Also, make sure that the emulator is connected to the Internet.</p>
</div>

<h2><a name="send"></a><span class="short-header">Send notification</span>Send notification from your back-end</h2>
##<a name="send"></a>Send notification from your back-end

You can send notifications using Notification Hubs from any back-end using our <a href="http://msdn.microsoft.com/en-us/library/windowsazure/dn223264.aspx">REST interface</a>. In this tutorial we will send notifications with a .NET console app, and with a Mobile Service using a node script.

Expand Down Expand Up @@ -333,13 +333,6 @@ To send a notification using a Mobile Service, follow [Get started with Mobile S

In this simple example you broadcast notifications to all your Android devices. In order to target specific users refer to the tutorial [Use Notification Hubs to push notifications to users], while if you want to segment your users by interest groups you can read [Use Notification Hubs to send breaking news]. Learn more about how to use Notification Hubs in [Notification Hubs Guidance] and on the [Notification Hubs How-To for Android].

<!-- Anchors. -->
[Enable Google Cloud Messaging]: #register
[Configure your Notification Hub]: #configure-hub
[Connecting your app to the Notification Hub]: #connecting-app
[Testing your app]: #run-app
[Send notifications from your back-end]: #send
[Next Steps]:#next-steps

<!-- Images. -->
[1]: ./media/notification-hubs-android-get-started/mobile-services-google-new-project.png
Expand Down
Loading

0 comments on commit 208d4e1

Please sign in to comment.