From the course: Visual Studio App Center for Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add push notifications to native Android apps

Add push notifications to native Android apps - Visual Studio Tutorial

From the course: Visual Studio App Center for Developers

Start my 1-month free trial

Add push notifications to native Android apps

- [Instructor] Let's add push notifications to a native Android application. So we're going to go to our build gradle file under Gradle Scripts, build gradle, and the version for our module. And in dependencies, we're going to add a new line, and let's compile space, and it'll be com.microsoft.appcenter, and then a colon, and appcenter minus push, and then a colon, and we're going to make that the appCenterSdkVersion, so I'm going to copy it from the line before and paste that in. And now we're going to sync our Gradle build by clicking Sync Now. We also need to modify our MainActivity, so we're going to go into the app and Java and open up our MainActivity and add a new import. So that's going to be import com.microsoft.appcenter.push and Push, semicolon at the end. And we'll scroll down to our onCreate, and where we have our AppCenter.start, we're going to start the push service, as well. So we'll do comma Push.class.

Contents