How to connect my android app to XAMPP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How to connect my android app to XAMPP

Postby Tommy97 » 12. February 2018 15:38

Dear All,
i have an issue with my project.
Briefly, i'm bulding an app that needs to be connected with a db for login, registration and many others functions.
i'm using XAMPP, apache and sql, and all work fine but i cannot / i don't know how to connect my android app (.apk) to my pc, that has XAMPP installed.
i'm testing this on my local network(wifi home), and i'm building via html and php.
someone know how to do that? are there some android api to include maybe?

thanks in advance for your help!!
Tommy97
 
Posts: 2
Joined: 12. February 2018 14:34
XAMPP version: 1.1.1
Operating System: Windows

Re: How to connect my android app to XAMPP

Postby Nobbie » 12. February 2018 17:58

Which Android App do you mean??

Apache sends/receives data via TCP and HTTP is used to be send via Port 80. Therefore your Andoid App must have an option to apply an IP for receiving/sending data from/to a webserver (your Apache from Xampp in that case), you must connect your Smartphone (or tablet) to the same (W)LAN as your Xampp PC and then apply the LAN IP of your Xampp PC (i.e. 192.168.x.y) in your Android App to connect to Xampps Apache. If you can specify a Port, specify Port 80.

If you have a firewall running on one of your devices (Xampp or Smartphone), the connection might fail.

If you need to connect to MySQL (instead of Apache), you must specify Port 3306 instead of Port 80. But, a connection to MySQL requires more than only a server IP and Port, you also have to apply a MySQL User with password, the default User for Xampp MySQL is "root" without Password. If you have to specify a database, you may use "test", it is preconfigured in Xampp. You may also create your own database in Xampp instead.

Last not least you wont succeed if you dont know anything about MySQL connections.
Nobbie
 
Posts: 10541
Joined: 09. March 2008 13:04

Re: How to connect my android app to XAMPP

Postby Tommy97 » 19. February 2018 12:44

Hi Nobbie,
i thanks you for your response.

the weird problem is that i just tried as told by you.
i put my server local ip address --> 192.168.x.x into my code, and if i try from the smartphone browser and i write "http://192.168.x.x/pathfolders" it works very well!! but if i build my project into android application by PhoneGap , and i install the app(.apk) into my device, it doens't work. the app displays only the first page without my customs(css, php..) and if i try clicking a button , it doesn't do nothing. it seems like my app cannot find my files project into xampp forlders. i hope this is more detailed than first post..
i would like post two screenshot on attachment but i don't know how to..

let me know if you got more hits for me.
Thanks a lot for your support!!!!!
Tommy97
 
Posts: 2
Joined: 12. February 2018 14:34
XAMPP version: 1.1.1
Operating System: Windows

Re: How to connect my android app to XAMPP

Postby Nobbie » 19. February 2018 20:44

Sorry, but I dont know anything about PhoneGap.
Nobbie
 
Posts: 10541
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 45 guests