Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1124 - Added localhost correct IP for the emulator. #1125

Conversation

amrhossamdev
Copy link
Member

Fixed #1124

After running the local server using docker in my machine, I started to monitor the API calls, I found that it's incorrect to use 127.0.0.1 or localhost because the Android emulator runs in a VM therefore here 127.0.0.1 or localhost will be an emulator's loopback address.

So it's correct to use http://10.0.2.2:8080/ as a base URL for connecting to a local host.

Ref :

Successful calling in Android emulator.

image

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Apply the AndroidStyle.xml style template to your code in Android Studio.

  • Run the unit tests with gradlew connectedObaGoogleDebugAndroidTest to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them for the initial submission of the pull request. When addressing comments on a pull request, please push a new commit per comment when possible (reviewers will squash and merge using GitHub merge tool)

@amrhossamdev amrhossamdev changed the title Fix #1124 - Added localhost correct IP for emulator. Fix #1124 - Added localhost correct IP for the emulator. Feb 26, 2024
Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 awesome, looks great

@aaronbrethorst aaronbrethorst merged commit 886a03c into OneBusAway:main Feb 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve support for development against a local server
2 participants