• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Creation of Android Plugin for Unity

hello guys! this is Krishna. basically a unity dev. I was in the process of making an android plugin to for unity to enable GPS in an android phone. I'm completely new to Java and Android studio. I was able to find a code and was trying to convert it to a library and I started to face issues.

Need help in resolving the errors pls the code given I have for the library is as in the link below: https://pastebin.com/vxVygCSk

Line #35

Task<LocationSettingsResponse> result = LocationServices.getSettingsClient(getApplicationContext())

In the above code, I understood that getApplicationContext() shouldn't be used in an android Library. but not sure how do I do a workaround.

Also, Line # 48
resolvableApiException.startResolutionForResult(MainActivity.this, REQUEST_CHECK_SETTING);

MainActivity is not something that is to be used for a plugin. How do I redo this step?? any support will be of great use to me pls!!
 
Back
Top Bottom