0

Is there any method to access the android app database from xammp server using android device using only usb cable and no other mean, like wifi and mobile network. I have gone through many articles and forums to find out this problem but haven't find anything helpful. I am trying to connect the database on localhost xampp from android device (Samsung Galaxy s 2) through my app. I have tried

127.0.0.1

127.0.0.1:80

127.0.0.1:8080

10.0.2.2

10.0.2.2:80

10.0.2.2:800

also tried my laptop ip address.

When i try to debug my app from eclipse on device, the app starts but when i click to get data (product list) from localhost the device just say that "unfortunately Myapp just stop working" and app is closed. This is when i am not using wifi on my device, but it works well when my device is connected to wifi. May be there are places when there is no wifi so in case usb option will be good.

android_guy
  • 236
  • 1
  • 7
  • 18

2 Answers2

1
  • install xampp
  • start Apache on computer where is installed xampp
  • run cmd.exe (menu start -> run ...)
  • enter command: ipconfig

IpV4 Address is that what you need. Input in android device's web browser the IP address (example: 192.168.0.23) You will see xampp menu.

SilverlightFox
  • 32,436
  • 11
  • 76
  • 145
  • I have a 3G evo that has no wifi option so I'm using mhotspot to make its wifi **Now** when I put `ipconfig` command it return 2 ipV4 addresses **1** of Evo other is of mhotspot. I tried with both but I'm not getting xamp in my android phone. What to do Now – Inzimam Tariq IT Nov 22 '15 at 11:10
0

I'm don't belive this will be possible very easily since this would create a security risk for the pc (immagine somone charging his phone on your pc - and he's then accessing your pc just because its connected).

however, after a quick search i found that it might be possible using something called "reverse tethering" - also, it appears to be possible if the pc is running linux.

The problem is that your phone and the laptop have to share a network-connection together, otherwise localhost or any Laptops IP-adress won't be accessible. Maybe you could create an AP for your laptop (therefore connect your pc via Wifi to your Phone) - then the pc's IP-Adress should be accessible?

Maybe this Article will help you further...

Community
  • 1
  • 1
Matthias
  • 197
  • 1
  • 9