Home Featured How to Mock Your Live Location

How to Mock Your Live Location

by Sweeta Gupta

Caricaturing your Android GPS location is likely something many individuals dismiss as something just developers need. Mock Your Live Location

While it offers numerous utilizations, to the individuals who test applications, ROMs, and different services, spoofing your GPS additionally offers numerous utilizations to the common Android users.

By controlling your location, you can utilize a wide range of applications. We should take a ton at some of the approaches to exploit spoofing the GPS.

Tracking Tricks

How about we start by seeing how applications can follow us. Here are the principal two location providers in Android.

  • GPS — (GPS, AGPS): Name of the GPS area location. This provider decides location utilizing satellites. Requires the authorization android.permission.ACCESS_FINE_LOCATION.
  • Network — (AGPS, CellID, WiFi MACID): Name of the network area provider. This provider decides location dependent on the accessibility of cell tower and WiFi access. Requires both of the permissions

android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION.

GPS and Network providers and Mock Location

“Mock Location” is a hidden developer setting in the Android working system that permits a gadget proprietor to set any GPS location for testing purposes.

Regardless of the way that this is a developer setting, anybody can utilize it just by a few buttons in gadget settings. Or then again you can compose a couple of lines of code and transfer the user straightforwardly to these settings.

Here’s the code for beginning this intent — users ought to permit utilizing your application as a mock location:

    if (!isMockLocationEnabled)

        startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS));

private boolean isMockLocationEnabled()


    boolean isMockLocation;

    try {

        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

            AppOpsManager opsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);

            isMockLocation = (Objects.requireNonNull(opsManager).checkOp(AppOpsManager.OPSTR_MOCK_LOCATION, android.os.Process.myUid(), BuildConfig.APPLICATION_ID)== AppOpsManager.MODE_ALLOWED);

        } else {

            isMockLocation = !android.provider.Settings.Secure.getString(mContext.getContentResolver(), “mock_location”).equals(“0”);


    } catch (Exception e) {

        return false;


    return isMockLocation;


Also, read: Top 4 laptops for students and young professionals

After you have this authorization, you would now be able to change the GPS and Network position. Coincidentally, you could get the scope and longitude from EditText or enter the hardcoded ones, in our demo application we added two choices: to enter the directions or pin your point on the map.

BLE and WiFi, and battle with Google

As I said above, to improve the consequences of your situation, there could be utilized BLE and WiFi signals close to you. Also, for this situation, every one of your endeavors might be in vain.

Simultaneously, note that you can’t replace BLE and WiFi signals in any capacity, so this information will be exact except if you utilize third-party gadgets that will help give custom signals.

Be that as it may, this is now too muddled a path and there’s no requirement for a conventional user to dig into it. There is a lot simpler way — you can impair the ability to utilize these signals in the “Improve Accuracy” segment in your phone’s settings.

There is one more trouble. It’s insufficient for you to change your provider just a single time, in light of the fact that on a similar Google maps your point will rapidly get back to its genuine position.

This is on the grounds that they frequently update the provider’s network and the data of your custom provider will be obliterated. Thus, you need to apply a trick — for instance, adding data from a test provider with a specific recurrence so that Google doesn’t have the opportunity to replace it with a genuine one.

Let us know your thoughts in comment below. We will be happy to respond your reply.

Also, read: Why does Apple have one of the most stable interfaces?

Latest Tech News