This is a React-Native Typescript application that serves as an example on how to implement calls to the TomTom Points Of Interest Search API using Native Modules.
Using React Hooks and React Components we are creatinng a custom List View that inflates its children when a TomTom API response is received.
The Items inside this List View get populated from the Json response received from the API.
The network requests are implemented in native android (java). They are returned as a promise to React-Native (Typescript).This project only implements native Android modules, iOS is not yet implemented.
- Node.js > 12 and npm
- Watchman
- JDK > 8
- Android Studio and Android SDK (This Project Targets Android SDK version 29 and Minimum SDK Version is 16. It's only tested in Android 10(Q) SDK 29)
Name | Downloads |
---|---|
react-native-get-location | |
accordion-collapse-react-native |
Download the project and install all the dependencies using:
git clone https://github.com/johnkozaris/TomTomPOIExample.git
cd TomTomPOIExample
npm install
Creating a TomTom Developer Account
- Create a TomTom Developer Account
- Login and go to your Dashboard
- In the Keys Section, Generate and copy an API KEY
Using your API Key in The Project:
- Go inside the android native files and open the TomTomPOIModule Class located in
android/app/src/main/java/com/tomtompoiexample/TomTomPOIModule.java
- Inside the class find the
static final String TOMTOM_API_KEY
and put your API key there
First you need to start the Metro Javascript bundler. Inside the project root directory run:
react-native start
In order to run the app in a connected android device or emulator run:
react-native run-android
In ordered to be easier to review this code contains A LOT of unneeded comments But this also makes it better to serve as an example application.
👤 John Kozaris
- Github: @johnkozaris
- LinkedIn: @ioannis-kozaris
Give a ⭐️ if this project helped you!