Skip to content

warren-bank/Android-Mock-Location

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android app that mocks the GPS and Network location providers.

Screenshots

Mock-my-GPS Mock-my-GPS Mock-my-GPS Mock-my-GPS Mock-my-GPS Mock-my-GPS

Summary

combination of:


Comparison of features in existing apps

FakeTraveler:

  • pros:
    • doesn't require root or system permissions
      • only requires setting: Developer > Mock Location
    • includes a minimalist map embedded in a webview
      • nice implementation
      • static html page w/ 2-way javascript binding
  • cons:
    • no bookmarks
    • no geo intent filters
    • no ability to "wander" from specified lat/lon

FakeGPS:

  • pros:
    • coding is excellent
    • supports 2 ways to "wander" from specified lat/lon
      1. buttons (up, down, left, right) that apply a specified offset to current location
        • accessed via a "joystick" that floats on top of other apps
      2. "fly to"
        • user specifies a 2nd location and how much time it should take to travel there (as the crow flies)
        • recalculates a new intermediate position every 1 second
    • supports bookmarking geo coordinates
  • cons:
    • requires root
    • requires installation as a system app
    • does NOT use the 'Mock Location' API
      • hooks directly into low-level APIs
    • "joystick" overlay is not optional
      • always visible when GPS location is fake
    • "joystick" overlay includes unnecessary buttons
    • bookmarks cannot be edited
    • no good way to push a geo coordinate into the app
      • no internal webview with map
      • no geo intent filters

Design Goals

Combine the best features from all:

FakeTraveler:

  • methodology for mocking location (GPS and Network)

FakeGPS:

  • overall architecture
  • "joystick" and "fly to"

OsmAnd:

  • geo intent filters

other considerations:

  • though the embedded map in FakeTraveler is elegant
    • the geo intent filters make this unnecessary
      • external mapping software can provide better features
        • Google Maps can work offline
        • OsmAnd can work offline
        • OsmAnd can broadcast geo intents

other enhancements:

  • better bookmarks
    • save from fields in UI
    • save from geo intent
    • add from dialog
    • edit from list
  • more preferences
    • frequency at which location providers receive mock updates
    • duration for which mock updates are sent to location providers each time the "start" button is pressed
      • 0 holds the special meaning that the duration is indefinite and will continue until the "stop" button is pressed
    • ability to enable/disable "joystick"
    • ability to configure the increment value added to lat/lon values each time a "joystick" button is pressed
    • ability to continue to mock the destination after a trip simulation completes

Comparison of release APK variations

  • Mock-my-GPS vs. Mock-my-GPS-UnifiedNlp-Backend
    • Mock-my-GPS
      • installation is required
      • minimum supported version of Android: 1.5 (Cupcake, API 3)
      • standalone application
    • Mock-my-GPS-UnifiedNlp-Backend
      • installation is optional
      • minimum supported version of Android: 2.3 (Gingerbread, API 9)
      • backend plugin for UnifiedNlp, which is:
        • typically installed as a component of microG
        • intended for used on de-Googled Android ROMs
        • a drop-in replacement for Google Location Services (GLS)
      • behavior:
        • while Mock-my-GPS is running, Mock-my-GPS-UnifiedNlp-Backend provides mocked location data to UnifiedNlp
        • by default, the timestamp for mocked location data updates is advanced by 45 seconds
          • this causes UnifiedNlp to prioritize the mocked location data, and to effectively ignore location data updates provided by all other backend plugins
      • for more info, refer to:
  • english vs. withAllLanguageTranslations
    • english
      • does not include translated string resources for any other languages
    • withAllLanguageTranslations
      • does include translated string resources for all supported languages
  • withAospLocationProviders vs. withGooglePlayServicesFusedLocationProvider vs. withHuaweiMobileServicesFusedLocationProvider
    • withAospLocationProviders
      • supplies mock location data to the following Android Open Source Project (AOSP) location providers:
        • LocationManager.GPS_PROVIDER
        • LocationManager.NETWORK_PROVIDER
        • LocationManager.FUSED_PROVIDER
    • withGooglePlayServicesFusedLocationProvider
      • supplies mock location data to the following Android Open Source Project (AOSP) location providers:
        • LocationManager.GPS_PROVIDER
        • LocationManager.NETWORK_PROVIDER
        • LocationManager.FUSED_PROVIDER
      • supplies mock location data to the following Google Play Services location providers:
        • FusedLocationProviderClient in the Google Location Services (GLS)
      • requires that Google Play Services is installed, enabled, and sufficiently recent
    • withHuaweiMobileServicesFusedLocationProvider
      • supplies mock location data to the following Android Open Source Project (AOSP) location providers:
        • LocationManager.GPS_PROVIDER
        • LocationManager.NETWORK_PROVIDER
        • LocationManager.FUSED_PROVIDER
      • supplies mock location data to the following Huawei Mobile Services (HMS) location providers:
        • FusedLocationProviderClient in the HMS Core Location Kit
      • requires that Huawei Mobile Services (HMS) is installed, enabled, and sufficiently recent

Legal: