How to access LAMP localhost in android device for testing? - android

I am developing a Wordpress site in Linux using LAMP environment. I want to test the look and feel of the site in a mobile device. I have an android device.
Is it possible to test my Linux localhost site in an android device using wifi or USB? If yes, how?
Using - Ubuntu 12.04 - XAMPP Linux 1.8.0 - Android 4.0
Note: Before you dismiss this question as possible duplicate, I checked the stackoverflow questions but nothing helped.
Open for editing!

If both your device and your LAMP setup are on the same network, no problem. Just let the URL (on Android) be the IP- adress of your Site (for example http://192.168.0.5/yourwordpresssite)

You can also use an android emulator. The emulator has access to the loopback address via 10.0.2.2.
see: http://developer.android.com/tools/devices/emulator.html#emulatornetworking

Related

React Native: Dev Server IP iOS vs Android

I'm running a DEV server locally on my Mac and want the mobile simulator to connect to it. After trying a few different things, I realized that iOS works fine when connecting to my server # http://localhost:8080/api but Android requires my IP Address like http://192.168.1.105:8080/api. Is there a way to make localhost work on Android as well?
In Android the localhost refers to the device on which the code is running, in this case the emulator.
If you want to refer to the computer which is running the Android simulator, use the IP address 10.0.2.2 instead. You can read more from here.

Access Localhost IIS from Android VM

My ASP website is running by way of the default IIS server included in Visual Studio 2015. This is accessed by the URL localhost:50544. I have to use 'Genymotion' to run an android virtual machine. Geny motion uses virtualbox so if need be I can edit the virtual machines configuration directly via virtualbox.
I'd like to visit my website from the android browser.
I've edited the android virtual machine to include a second bridged adapter and attempted to visit 10.0.2.2:50544 from within the android VM. It does not load and eventually the browser will produce a time out error. Someone's similar question mentions visiting 10.0.3.2 when specifically using genymotion. But this has the same outcome.
How may I visit the website from within the android virtual machine?
Can you try using your local IP address?
Like my IP would be: 192.169.2.9

Connect to openERP from others computers

I have a simple question:
I'm installing openERP server in my computer.
and i can conncte to it by typing "http://localhost:8069" in google chrome.
Now I ask if i can connect to my openERP server from others computers and from my mobile android in my locale network.
EDIT:
so this is my situation:
I have developped an application android to connect to an openERP.then i am installed openERP (all-in-one) on my computer.the application turn good on the emulator, now i want to connect from my phone android.
but when i typing (my_ip:8069) from my application in my phone,i can't acces to my computer.
so tell me if it is possible or no,if yes how can i do it.
thanks for suggestions.
You can connect by using IP of that computer.
IP:8069 from any computer in that network.
Try disabling your firewall, it worked for me.

Connecting to host from Android via USB

Okay so here is the background of this problem. I commute a lot on the train and build a lot of PHP web apps optimized for mobile devices. I would like to develop code on a netbook (Running Ubuntu Server) with no GUI. All development done using Vim directly on the netbook.
I would like to connect up my Nexus 4 to the netbook via USB and "connect" to the netbooks web server in the chrome browser. I can only use USB for this since I won't be having any reliable internet access.
I understand that using adb from the Android SDK, you can forward a port from the netbook to the phone. However, I need to do it the other way around.
For example:
Run a web server on the netbook on port 4000
Connect phone via USB
Somehow forward port 4000 on the phone to port 4000 on the netbook
Open chrome browser on phone and go to localhost:4000.
I am aware of the "reverse port forwarding" method that is described in the Google docs at https://developers.google.com/chrome-developer-tools/docs/remote-debugging. However, this requires an installation of chrome on the netbook. I don't want to have to install an entire GUI just for this.
Update
With regards to the above, I have found https://groups.google.com/a/chromium.org/forum/m/#!topic/chromium-reviews/7mE61hDcFdA. Does this mean I could install Chrome on the netbook (even though I don't have a GUI) and port forward via CLI?
An APP might do the job here. If you know some java you might be able to pull it off. Basicly you tunnel a connection through adb, then use an app as proxy and a small program on the computer. There might be an easier way though

Android can't see devices on ".local" domain

I'm having an annoying issue with Android development. I have a webserver (Tomcat) running on my Macbook which is connected to the local network via wifi. I have my Sprint EVO connected to the same network using wifi. The only way I can connect to the Tomcat instance is by raw IP address. If I use the Macbook name with or without the ".local" domain suffix it does not recognize the host name. The emulator behaves the same way. My iPhone can resolve the host name as can the iPhone simulator. So, I'm thinking either this is a bug in the Android platform or I've missed/accidentally tweak some hidden config somewhere in both the emulator and the device? Any idea?
A .local domain suggests Bonjour, which Android doesn't speak natively. The Mac's name without '.local' is either an AFP name or a WINS name (if you've got samba turned on), which isn't going to help much either.
You'll need to set up a proper DNS server (maybe your wifi router will do it), or try one of the java zeroconf libraries as described here.
More than 10 years after this question was asked, it has now been added to Android. You can visit a .local domain name (mDNS domain) - I have a raspberry pi server (raspberrypi.local) running a python web server (python3 -m http.server) in my screenshot.
From the android docs:
Users can use the command adb shell ping6 HOSTNAME.local, where HOSTNAME is the hostname of a target device on the LAN, for example, adb shell ping6 ipad.local.
Useful reading
Android docs
Higher level reading - also explains how Android devices were updated ("Mainline")

Categories

Resources