I know this has been asked and answered before, but I use 10.0.2.2
for the emulator. And I heard I must use something else for my real device. Can someone tell me what that is? And can I have them both run off of 1
URL. Instead of having one for the emulator and actual device.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Get the ip address by running ipconfig from dos prompt and use it.
You have to use the ip address of your computer for a real device.check your ip address and try to connect with it.In my case I came to know this when I was trying to access some webapp from my android device and my web application was on tomcat container on my pc.It worked very well for me.
localhost
of an Android device islocalhost
, 127.0.0.1.That refers to
localhost
of the computer running the emulator.You need to use the IP address of the computer, on whatever network that the computer and the device share. You cannot access
localhost
on one machine from another machine, by definition.Of course, you also need to figure whatever it is that is running on that computer to listen to more than its own
localhost
.Not really. Moreover, neither of the values that you are thinking of are the right ones for a release build of your app, in all likelihood. There, you will need to use the domain name (or, in a pinch, IP address) of some publicly-visible server that everyone's devices can reach.