yayaa / LocationManager

Simplify getting user's location for Android
806 stars 187 forks source link

Samples difficult to understand/follow. #71

Closed szaske closed 6 years ago

szaske commented 6 years ago

I appreciate you building this library, as there ARE a lot of steps involved to get a users GPS coordinates. However, I'm finding it difficult to follow your code samples.

I'd like to implement a Location Service. What is this SamplePresenter class? Do I need to implement it? I don't understand it's purpose. So to get your library working I need to:

  1. Have a Base Service
  2. Extend it with yet another Location class
  3. Create a Presenter object

I cannot really see where I get my callbacks in your Service-Activity sample.

yayaa commented 6 years ago

SamplePresenter is coming from MVP pattern, you are right, normally I wouldn't use any architectural pattern in sample applications, but since I wanted to share same code between activity/fragment/service samples, I created the presenter.

In order to use the library, depend on where do you need to get location, you can either extend LocationBaseFragment, LocationBaseActivity or LocationBaseService implementations. If you don't want to extend, or you already have some other extensions, please take a look how they are implemented. You just need to call corresponding methods on LocationManager.