1. Are you ready for the Galaxy S20? Here is everything we know so far!

Creation of Android Plugin for Unity

Discussion in 'Android Development' started by gameDev_inprogress, Nov 5, 2020.

  1. gameDev_inprogress

    Thread Starter

    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!!
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - Creation Android Plugin
  1. androinewbi
    Replies:
    4
    Views:
    108
  2. Angie82
    Replies:
    2
    Views:
    164
  3. shakushinnen
    Replies:
    3
    Views:
    152
  4. pstein
    Replies:
    2
    Views:
    380
  5. Clinton_BC
    Replies:
    0
    Views:
    949
  6. glasshalffull
    Replies:
    1
    Views:
    859
  7. Android News
    Replies:
    0
    Views:
    218
  8. JustRay
    Replies:
    2
    Views:
    3,707
  9. Kamal14042015
    Replies:
    0
    Views:
    474
  10. aio developers
    Replies:
    17
    Views:
    1,311

Share This Page

Loading...