The repo includes an APK to run on your Android device named app-release.apk
and a result text file named output.txt
(the solution of the problem) in the root directory.
- Send the file to your Android device.
- Install the APK.
- Run the installed app. (Make sure you're connected to the internet)
The app shows a list of customers with their respective distance from the Intercom Dublin office in kilometres (retrieved from the JSON data here: https://s3.amazonaws.com/intercom-take-home-test/customers.txt).
The action bar shows a number of actions:
- Show All Customers: Displays all customers from the list.
- Show Customers to Invite: Displays all customers that are within 100 km from the Intercom Dublin office.
- Save Invitation List: Stores an
output.txt
file in your device (in the directory Documents/Intercom Party Invitations) sorted by User IDs (ascending). (Make sure you give app the permission to access photos, media and files in order for it save the file in your directory)
- Download and install Android Studio 3.5+: https://developer.android.com/studio
- Download the
InviteCustomers
repository as zip. - Extract the zip file.
- Click on open an existing Android Studio project.
- Select the unzipped
InviteCustomers-master
folder and let the build to be completed. - Go to Run > Run 'app' to run on a connected device or on an emulator.
All the tests are in directory app > java > com (androidTests)
and app > java > com (test)
. If you want to run one of them:
- Open the file, for instance
MainActivityPresenterTest.kt
. - Right click in the file opened and click
Run MainActivityPresenterTest
.
- Make sure you have
gradle
installed on your system: https://gradle.org/install/ - Open the terminal either from your system or in Android Studio.
- Go to
InviteCustomers-master
in the terminal. - Run the command
./gradlew test
to run all the tests in the project.