Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Add kotlin example for LocationUpdatesPendingIntent/#141

Open
jQrgen wants to merge 6 commits intoandroid:mainfrom
jQrgen:master
Open

Add kotlin example for LocationUpdatesPendingIntent/#141
jQrgen wants to merge 6 commits intoandroid:mainfrom
jQrgen:master

Conversation

@jQrgen
Copy link
Copy Markdown

@jQrgen jQrgen commented Apr 4, 2018

No description provided.

@googlebot
Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@jQrgen
Copy link
Copy Markdown
Author

jQrgen commented Apr 4, 2018

I signed it!


implementation 'com.android.support:design:26.1.0'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be just "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create a buildSrc module with Kotlin code to manage dependencies and get IDE completion support which is a big win. You can follow this tutorial for reference.

val action = intent.action
if (ACTION_PROCESS_UPDATES == action) {
val result = LocationResult.extractResult(intent)
if (result != null) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are talking about Kotlin here, there can be a slight improvement.

result?.let {
   // not null do something
   //everything which is in your if body can come here
}

@codingjeremy codingjeremy added the migrated googlesamples Migrated from old googlesamples repos label Sep 24, 2019
@codingjeremy codingjeremy changed the base branch from master to main September 29, 2020 19:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

migrated googlesamples Migrated from old googlesamples repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants