title | description | services | documentationcenter | manager | editor | author | ms.assetid | ms.service | ms.workload | ms.tgt_pltfrm | ms.devlang | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Add push notifications to your Android app with Mobile Apps | Microsoft Docs |
Learn how to use Mobile Apps to send push notifications to your Android app. |
app-service\mobile |
android |
erikre |
ysxu |
9058ed6d-e871-4179-86af-0092d0ca09d3 |
app-service-mobile |
mobile |
mobile-android |
java |
article |
10/12/2016 |
yuaxu |
[!INCLUDE app-service-mobile-selector-get-started-push]
In this tutorial, you add push notifications to the Android quick start project so that a push notification is sent to the device every time a record is inserted.
If you do not use the downloaded quick start server project, you need the push notification extension package. For more information, see Work with the .NET backend server SDK for Azure Mobile Apps.
You need the following:
-
An IDE, depending on your project's back end:
- Android Studio if this app has a Node.js back end.
- Visual Studio Community 2013 or later if this app has a Microsoft .NET back end.
-
Android 2.3 or later, Google Repository revision 27 or later, and Google Play Services 9.0.2 or later for Firebase Cloud Messaging.
-
Complete the Android quick start.
[!INCLUDE notification-hubs-enable-firebase-cloud-messaging]
[!INCLUDE app-service-mobile-configure-notification-hub]
[!INCLUDE app-service-mobile-android-configure-push]
[!INCLUDE app-service-mobile-dotnet-backend-configure-push-google]
In this section, you update your client Android app to handle push notifications.
[!INCLUDE app-service-mobile-verify-android-sdk-version]
Your next step is to install Google Play services. Google Cloud Messaging has some minimum API level requirements for development and testing, which the minSdkVersion property in the manifest must conform to.
If you are testing with an older device, consult Set Up Google Play Services SDK to determine how low you can set this value, and set it appropriately.
[!INCLUDE Add Play Services]
[!INCLUDE app-service-mobile-android-getting-started-with-push]
You can test the app by directly attaching an Android phone with a USB cable, or by using a virtual device in the emulator.
Now that you completed this tutorial, consider continuing on to one of the following tutorials:
- Add authentication to your Android app. Learn how to add authentication to the todolist quickstart project on Android using a supported identity provider.
- Enable offline sync for your Android app. Learn how to add offline support to your app by using a Mobile Apps back end. With offline sync, users can interact with a mobile app—viewing, adding, or modifying data—even when there is no network connection.