Android Question GPS spoofer

Discussion in 'Android Questions' started by carlos7000, Jul 25, 2019.

  1. carlos7000

    carlos7000 Active Member Licensed User

    Hi all

    How can I make a program that makes the cell phone believe that it is moving?

    I am developing an application that requires the use of GPS, but to test it, I always need to go out walking streets. To make things easier, I carry a notebook, so I stop somewhere and try to correct the problem. If I develop the application at night a rainy and cold day, or in a dangerous place, it is worse.

    I know there are several programs that perform this task. But the company I develop uses old equipment. Applications that simulate GPS do not run, or work erratically on such old equipment.

    I could create a simple application to which 2 points are given and simulate the movement between the two at a given speed. But I have no idea where to start.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. DonManfred

    DonManfred Expert Licensed User

    how do you SIMULATE a new GPS Position to the SYSTEM? Calling a sub in your own app doesn´t change any SYSTEM-Positioning routines and this is what the TO is trying to archieve.
     
  4. DonManfred

    DonManfred Expert Licensed User

    The question in #1 is:
     
  5. emexes

    emexes Well-Known Member Licensed User

    Never mind, I have fixed my mistake.
     
    Last edited: Jul 25, 2019
  6. emexes

    emexes Well-Known Member Licensed User

    Hey Carlos, what was the end result here? Are you still on the streets?
     
  7. MarkusR

    MarkusR Well-Known Member Licensed User

    my phone have a developer option to choose a app for simulating locations.
    i think that app you will write,true?

    https://developer.android.com
     
    Last edited: Jul 26, 2019
  8. emexes

    emexes Well-Known Member Licensed User

    and for most everybody that would be the solution and end of discussion, but the original post stated:
    and thus I am interested in what solution Carlos used, in case he has struck (programming) gold that might be used in eg testing BLE interfaces.
     
  9. carlos7000

    carlos7000 Active Member Licensed User

  10. carlos7000

    carlos7000 Active Member Licensed User

    Yes, I still have to walk the streets.

    I still can't.
     
  11. carlos7000

    carlos7000 Active Member Licensed User

    Yes it is.
     
  12. carlos7000

    carlos7000 Active Member Licensed User

    A request for ACCESS_MOCK_LOCATION or WRITE_MOCK_LOCATION does not appear in runtimepermission

    I tried with two versions of the manifest.

    Code:
    'This code will be applied to the manifest file during compilation.
    'You do not need to modify it in most cases.
    'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
    AddManifestText(
    <uses-permission android:name=
    "android.permission.ACCESS_MOCK_LOCATION"/>
    <uses-sdk android:minSdkVersion=
    "5" android:targetSdkVersion="26"/>
    <supports-screens android:largeScreens=
    "true"
        android:normalScreens=
    "true"
        android:smallScreens=
    "true"
        android:anyDensity=
    "true"/>
        )
    SetApplicationAttribute(android:icon, 
    "@drawable/icon")
    SetApplicationAttribute(android:
    label"$LABEL$")
    'CreateResourceFromFile(Macro, Themes.DarkTheme)
    'End of default text.
    Code:
    'This code will be applied to the manifest file during compilation.
    'You do not need to modify it in most cases.
    'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
    AddPermission(android.permission.ACCESS_MOCK_LOCATION)
    AddManifestText(
    <uses-sdk android:minSdkVersion=
    "5" android:targetSdkVersion="26"/>
    <supports-screens android:largeScreens=
    "true"
        android:normalScreens=
    "true"
        android:smallScreens=
    "true"
        android:anyDensity=
    "true"/>
        )
    SetApplicationAttribute(android:icon, 
    "@drawable/icon")
    SetApplicationAttribute(android:
    label"$LABEL$")
    'CreateResourceFromFile(Macro, Themes.DarkTheme)
    'End of default text.
     
  13. emexes

    emexes Well-Known Member Licensed User

    Can you post the part of your code that receives position from GPS? Just the few lines before and after the bit where you are reading the latitude and longitude into your own app's variables will be enough, eg might look like:
    Code:
    Public Sub LocationChanged(Location1 As Location)
       CurrentLatitude = Location1.Latitude
       CurrentLongitude = Location1.Longitude
       LastUpdateTime = 
    DateTime.Now
    End Sub
     
  14. MarkusR

    MarkusR Well-Known Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice