Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate examples in android TestApp to Kotlin #416

Merged
merged 61 commits into from
Sep 9, 2022

Conversation

birkskyum
Copy link
Member

@birkskyum birkskyum commented Sep 1, 2022

Many of the examples from the TestApp ported 1 to 1 to kotlin.

@birkskyum birkskyum changed the title Upgrade camera examples in TestApp to Kotlin Upgrade android camera examples to Kotlin Sep 2, 2022
@wipfli
Copy link
Member

wipfli commented Sep 3, 2022

Thanks @birkskyum. I think Kotlin is the right language for Android. Let's wait with this pull request until we decided on #420.

@birkskyum birkskyum force-pushed the upgrade-test-app-to-kotlin branch 2 times, most recently from 02dff3b to 36aa1c9 Compare September 8, 2022 11:53
@wipfli
Copy link
Member

wipfli commented Sep 8, 2022

Do we have some build instructions for this test app? Would like to try it out...

@birkskyum
Copy link
Member Author

birkskyum commented Sep 8, 2022

Yes, it's a matter of opening Android Studio in the platform/android directory. Create a virtual device (like rezisable or pixel with a modern API like 31-33) and run the MapboxGLAndroidSDKTestApp. Gradle will have to do a lot of work when you open the repo, so it can take a little while, but apart from that, it's quite few steps.

@wipfli
Copy link
Member

wipfli commented Sep 8, 2022

Great, I will give it a go and ping you if I am stuck...

@birkskyum birkskyum changed the title Upgrade examples in android TestApp to Kotlin Migrate examples in android TestApp to Kotlin Sep 9, 2022
@birkskyum birkskyum merged commit 3e98f60 into main Sep 9, 2022
@birkskyum birkskyum deleted the upgrade-test-app-to-kotlin branch September 9, 2022 12:04
@wipfli
Copy link
Member

wipfli commented Sep 9, 2022

What is the easiest way to review this pull request? The diff seems to be too large for git to recognize that the files were renamed and the code was changed...

@birkskyum
Copy link
Member Author

birkskyum commented Sep 9, 2022

The only way as I see it is to run the app before the change, see how each example works, and then apply the change and validate that the example works the same as a practical test. That's how I've done it for each example.

@wipfli
Copy link
Member

wipfli commented Sep 9, 2022

Sure I can do that. I might also just rename the files back to .java and then do a diff...

@birkskyum
Copy link
Member Author

birkskyum commented Sep 9, 2022

This is like a first round of porting. Many small changes can be done for each file due to the new capabilities of Kotlin, especially regarding NullPointerExceptions, but that'll be a second round.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants