Back to Browse

Fast API Calls in React Native with Retrofit

205 views
Sep 29, 2024
22:19

Hi Friends, Today we are create native module for call restful api by using retrofit library in React Native Step 1: Creating a new application https://reactnative.dev/docs/getting-started-without-a-framework npm uninstall -g react-native-cli @react-native-community/cli npx @react-native-community/cli@latest init AwesomeProject Step 2: Install React-navigation yarn add react-native-screens react-native-safe-area-context @react-navigation/native-stack react-native-gesture-handler react-native-reanimated @react-navigation/native @react-native-masked-view/masked-view @react-native-community/hooks @react-native-community/checkbox @react-native-community/netinfo apisauce validator https://reactnavigation.org/docs/getting-started Step 3: Connect real device adb reverse tcp:8081 tcp:8081 Step 4: Run you android project yarn start yarn android Step 5: Past into build.gradle (module:app) file for retrofit library implementation 'com.squareup.retrofit2:retrofit:2.8.1' implementation 'com.squareup.retrofit2:converter-gson:2.8.1' implementation 'com.squareup.okhttp3:okhttp:4.9.2' implementation 'com.squareup.okhttp3:logging-interceptor:4.9.2'

Download

0 formats

No download links available.

Fast API Calls in React Native with Retrofit | NatokHD