Android to Wamp Server Connection using Android Studio and PHP

后端 未结 4 688
闹比i
闹比i 2021-01-17 00:06

I\'m newbie here. I want to connect my android app to wampserver database. I found a tutorial on this link, But where should I find my serverUrl in wampserver? It should loo

相关标签:
4条回答
  • 2021-01-17 00:29

    The "path" is probably the URL to your local web server, that is:

    http://your_ip/your_path_to_your_php_script

    0 讨论(0)
  • 2021-01-17 00:45

    you need to find your IPV4 address of your computer, run command prompt in your computer(go to Windows start button and start typig cmd) and type ipconfig and enter to see your IPV4 address of your computer.

    Successfully Running WAMP server on your computer indicates a green icon on system tray, click on that, with a menu pop up click on put online item. Wait for few second to process its task.

    To test your app for PHP MySQL in your android studio emulator, just enter address as http:\\IP Address\ followed by path of your PHP file in your code.

    For example: http:\\192.168.1.7\test\example.php

    0 讨论(0)
  • 2021-01-17 00:48

    The solution that worked for me was to use 10.0.2.2 as the ip address in my developing android app.

    0 讨论(0)
  • 2021-01-17 00:54

    Thanks to @e4c5 (for the suggestions) and to @Laser for the answer(s).

    I solved it!

    So for the others who will stumble upon this problem, check this out! ^_^

    Go to cmd >> type ipconfig >> then look at IPv4 Address...

    Then paste it on private final String serverUrl = "your path here"

    Replace your path here with http://192.168.1.8/android_user_api/index.php

    Thank you guys!

    Happy Coding!

    0 讨论(0)
提交回复
热议问题