Reputation: 782
I have my MAMP Pro set up to be able to access my host via local network, I believe through NAMO.
My host is named myproject.local
and I am able to access my site at myproject.local:8888
on most devices connected to my network. My laptop and iPhone both are able to access this host using this domain.
However, unsurprisingly, my Android device fails to connect and just says the site can't be reached...
Of course, I tried to just do this using the Android Emulator (using the 10.0.2.2 address), but my Android Emulator won't start because it just stops responding as soon as it opens up... :dumpter-fire:
What lovely Android-specific thing do I need to do to get it to work with this very simple concept of local networks?
Upvotes: 1
Views: 918
Reputation: 1819
Case 1:
If you are using real android phone or iphone, you need to install mamp viewer in you mobile. Then you need to connect your mobile and mamp server with the same network. So you can view your website via mamp viewer or mobile browser. This is how I connect from my real iPhone.
Note: for now mamp viewer in real android phone is not working anymore. Maybe it will be working in the future.
Case 2:
If you are using emulator (AVD), you can access only localhost. So you need to put your code in localhost folder. After that you can test with your emulator browser as below
http://10.0.2.2:8888
Upvotes: 1