Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Added code needed to use Hover SDK/Multisim lib and more detail about the operator endpoint.
  • Loading branch information
davkutalek committed Nov 1, 2019
1 parent aff7af2 commit 0bd2b2f
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,33 @@ Thank you for taking the time to complete this challenge.

Hover's technology requires identifying SIM cards so that the correct USSD and SIM Toolkit services are run on the right networks. There is no official and always up-to-date record of networks in every country, so it would be helpful to compare what a user's SIM card is reporting vs what information Hover has listed.

The Hover Android SDK has a dual-sim library built into it (we are in the process of [separating and open-sourcing it](https://github.com/UseHover/MultiSim)). It simplifies getting SIM info across different devices and Android versions, especially on dual SIM devices. The main API call you need is `Hover.getPresentSims(context)` which returns a list of POJO SimInfo objects. Documentation for them can be found in the [javadoc](http:https://maven.usehover.com/releases/com/hover/android-sdk/1.4.1/android-sdk-1.4.1-javadoc.jar).
The Hover Android SDK has a dual-sim library built into it (we are in the process of [separating and open-sourcing it](https://github.com/UseHover/MultiSim)). It simplifies getting SIM info across different devices and Android versions, especially on dual SIM devices.

Hover also provides its list of network operators via a public HTTP API. http:https://localhost:3000/api/world_operators
For now is easiest to use through the Hover SDK. You don't need a Hover account, just include the following in your app:

1. Add the Hover repo to your root build.gradle repositories:
<figure><pre><code>
allprojects {
repositories {
...
mavenCentral()
maven { url "http:https://maven.usehover.com/releases" }
}
}
</code></pre></figure>

2. Add the Hover SDK to your app-level build.gradle dependencies:

<figure><pre><code>
dependencies {
...
implementation 'com.hover:android-sdk:1.4.1'
}
</code></pre></figure>

Get the READ_PHONE_STATE permission from the user, then call `Hover.updateSimInfo(context)` which will populate the library's SIM database. Then you can use the static methods on the SimInfo object to load them from the database. Documentation can be found in the [javadoc](http:https://maven.usehover.com/releases/com/hover/android-sdk/1.4.1/android-sdk-1.4.1-javadoc.jar).

Hover provides its list of network operators via a public HTTP API: https://www.usehover.com/api/world_operators. This endpoint provides the name, country, mobile country code (MCC) and mobile network codes (MNCs) of each network. The MCC + MNC together are called the Home Network Identifier (HNI) and are also the first 5-6 digits of the IMSI. [Wikipedia]{https://en.wikipedia.org/wiki/Mobile_country_code) has a useful summary and list. Hover also provides a list of countries for completeness: https://www.usehover.com/api/countries.

## User stories

Expand Down

0 comments on commit 0bd2b2f

Please sign in to comment.