App is not working on WAMP but It works in online server

后端 未结 1 606
时光说笑
时光说笑 2021-01-25 14:48

I made a basic login app using online SQLite database(http://demo3534535.16mb.com) It works fine on online server. Now i want to run on local server using WAMP in Gennymotion em

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 15:07

    if you're going local, follow these steps:

    1. You need to create a WLAN. Open the command prompt Admin mode and type these commands:

      netsh wlan set hostednetwork mode=allow ssid=DevelopmentLAN key=yourPassword
      

      Press OK. Then execute the following command:

      netsh wlan start hostednetwork
      

    This shall start your WLAN.

    Now type ipconfig in the command line, so that you discover your machine's IPv4 address:

    EDIT:

    Make sure you are noting your Wireless LAN adapter's IPv4 address.

    Note this IP address. This is the one you are going to use as the HOST address.

    The Configuration part.

    Change define('HOST','mysql.hostinger.in');

    to this define('HOST','localhost');

    As for the rest, you need to change the user's name, password and the database name to your WAMPServer's username and password and your database 's name on WAMP, respectively.

    Now I will suppose that your register.php file is wrapped inside a User folder in your WAMP projects directory (C:/wamp/www/User/register.php). Change REGISTER_URL's value to this:

    private static final String REGISTER_URL = "http://192.168.1.3/User/register.php";
    

    And that's it, you're ready to go. Finally make sure your firewall is OFF, otherwise it will block your genymotion emulator from connecting to the WAMP server on your machine, and that you change 192.168.1.3 to your machine's IP address.

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