Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
saidmotya authored Sep 17, 2022
1 parent 98f7608 commit 65992eb
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

# CountryChecker [![](https://jitpack.io/v/saidmotya/CountryChecker.svg)](https://jitpack.io/#saidmotya/CountryChecker)

An Android library for member secretGFX group, Help developer to get user location country & check the app is insalled from GG Play Store.

## Installation

*Step 1.* Add the JitPack repository to your project `build.gradle` file

```gradle
allprojects {
repositories {
//your repository
maven { url 'https://jitpack.io' }
}
}
```

*Step 2.* Add the dependency in the form

```gradle
dependencies {
implementation 'com.github.saidmotya:CountryChecker:1.0.0'
}
```

## Initialize

```java

countryChecker = new CountryChecker(this, CheckerType.SpeedServer); //check country via server speedtest.
countryChecker.setOnCheckerListener(new OnCheckerListener() {
@Override
public void onCheckerCountry(String country, boolean userFromGG) {
//get user country & check if the user install your app from GG play store.
}

@Override
public void onCheckerError(String error) {
//failed to get user country.
//you can show No Connection dialog her ! and get retry again to get info.
}
});

```

## CheckerType

| CheckerType | Description |
| --- | --- |
| `SpeedServer` | Make connection to server https://www.speedtest.net/speedtest-config.php |
| `SimCountryIso` | Get the SIM country ISO via TelephonyManager |

0 comments on commit 65992eb

Please sign in to comment.