Ruby code to dynamically update android virtual device instance from gpsd
Socket connections are opened to both GPSD and ADB for AVD.
GPSD is configured to send periodic location fixes in json formatted messages.
GPS location is updated via ADB connection when fixes are received from GPSD.
Add this line to your application's Gemfile:
gem 'avd_cntrlr'
And then execute:
$ bundle
Or install it yourself as:
$ gem install avd_cntrlr
-
Start Android Virtual Device (AVD) using Android Emulator: .../Android/Sdk/tools/emulator -avd Nexus_7_API_23
-
Start / Verify gpsd daemon is operating and GPS device is connected
-
Start AVD_Controller: ruby avd_cntrlr
-
Correct GPS coordinates should be available to Android Apps executing in Android Virtual Device instance
Note: So far, were hard coded to use: GPSD - 127.0.0.1:2947 AVD/ADB - 127.0.0.1:5554
- Fork it ( https://github.com/[my-github-username]/avd_cntrlr/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request