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

GPS Support for iOS #22

Closed
brousch opened this issue Mar 11, 2014 · 7 comments
Closed

GPS Support for iOS #22

brousch opened this issue Mar 11, 2014 · 7 comments

Comments

@brousch
Copy link
Contributor

brousch commented Mar 11, 2014

Add support for the GPS facade to iOS

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/3944586-gps-support-for-ios?utm_campaign=plugin&utm_content=tracker%2F77151&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F77151&utm_medium=issues&utm_source=github).
@brousch brousch added the bug label Mar 11, 2014
@sixman9
Copy link

sixman9 commented Aug 20, 2014

I think many would find cross-platform GPS extremely useful, so I'm going to 'start the bidding' by leaving a little information I hope someone with better Kivy/IOS development skills might find useful:

#Python-based IOS/CLLocationManager access using PyObjC (port to Kivy/Pyobjus???)
https://github.com/aosm/pyobjc/tree/master/pyobjc/pyobjc-framework-CoreLocation/PyObjCTest

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html

http://www.appgroup.co.uk/recording-nice-accurate-ios-gps-journeys <- ideas on CLLocationManager IOS GPS usage

Hopefully, some of the above will be useful to someone with more Kivy experience.

@trivedigaurav
Copy link
Member

@sixman9 Thanks for the links! So the approach would be to use PyObjus to access CLLocationManager. The tricky part is to assign a delegate function in Python.

@sixman9
Copy link

sixman9 commented Aug 24, 2014

@trivedigaurav - Gaurav, I'm _not_ an experienced Python or IOS developer (I do have 10 years+ Java), so some of the concepts might allude me (however, I am writing this on my 5-year-old [Intel] Macbook :-P )

  1. Using my 'Google-fu', I believe I've found an example of Pyobjus-to-Objective-C Delegate usage (delegate.py), which documents the usage of OS X's NSURLConnectionDelegate delegate protocol interface.
  2. Further to this, I found a PyObjus/Kivy file, 'protocols.py', which contains references to both the NSURLConnectionDelegate of the 'delegate.py' example code (see no.1) _and_ the target Corelocation/GPS delegate, CLLocationManagerDelegate protocol interface (for IOS).
  3. [Although I'm no expert,] Pyobjus 'protocols.py's' referencing of the CLLocationManagerDelegate protocol doesn't seem to list all of CLLocationManagerDelegate's methods, so, maybe, Pyobjus's 'protocols.py' needs updating(?).
  4. Hopefully, 'delegate.py's' coding can serve as a template for the inclusion of a CLLocationManager.delegate(CLLocationManagerDelegate) call from within Kivy/PyObjus, capable of receiving an array of CLLocation instances passed back to a CLLocationManagerDelegate instance's 'locationManager:didUpdateLocations:' callback method (by CLLocationManager).
  5. Finally, for the cross-platform, write-once Kivy 'magic' to work, I'm assuming it's simply a matter of getting this CLLocationManagerDelegate protocol coded/to work within PyObjus, then 'hooking up' Plyer's GPS Facade interface methods, for GPS, right (?).

Hopefully, this Pyobjus Delegate usage info in 'delegate.py' can help the Kivy community implement the missing IOS GPS/CoreLocation functionality.

Personally, I'm looking for a cross-platform, mobile dev environment with access to native features/GPS, reasonable GUI design facilities and performance, and Kivy seems to offer that.

I hope you find this information to be useful.

Thanks

@trivedigaurav
Copy link
Member

@sixman9 You correct about the protocols. I remember from a discussion with @tito that the protocol list is made using https://github.com/kivy/pyobjus/blob/master/tools/buildprotocols.py. Again, thanks for the links.

@mcastle
Copy link

mcastle commented Nov 12, 2014

Here's a discussion with an example of how to modify the bridge.h and bridge.m files for location services support: https://groups.google.com/forum/#!topic/kivy-users/FzAF3anZIYY

I haven't tried this yet to see if it works, but will update when I do.

@laltin laltin mentioned this issue Mar 3, 2015
@emilv
Copy link

emilv commented Feb 9, 2016

Should this be closed?

@KeyWeeUsr
Copy link
Contributor

Closed by #116.

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

No branches or pull requests

6 participants