How to point specific to ip in android tablet? - android

I am accessing my local server by using DNS. For this I have made changes into my etc/hosts of my PC. However I am not able to access it through my andoid devices. Is there any way to do it. Please suggest the method. I have also installed windows server 2012.
I have created a virtual host in the server and I need to access the virtual host in My andriod device also

You can use ADB pull/push, assuming your device is rooted.
HowToGeek has a pretty simple step-by-step tutorial

Related

How do I connect an Android Emulator to localhost server?

I have an ASP.NET/Azure application running on http://localhost:4617. I would like to debug a REST call made from an Android emulator. Related SO threads seem to indicate that you should use 10.0.2.2. I've tried several variations like http://10.0.2.2:4617, but none seem to work. Any other suggestions?
If I do ping localhost on my machine, it returns Reply from ::1: time<1ms which seems to have something to do with an ipV6 address, but I'm not sure how this is related.
If the local host is running on your desktop than that is the problem.
When you type http://10.0.2.2 it tries to connect to the Android emulator local host.
What you need to do is find your computer IP address (you can use google for it). Then once you have it type that into your android emulator browser and it should work
I was able to figure this out. If you're running an Azure server-emulator, then you need to run Visual Studio with administrator privileges. If you don't, then it will not bind correctly to the local host.

How to access virtual host in android cell phone

I want to access my virtual host (running on my desktop) on my android cell phone and I do not know where to start from. I searched how I can access that. Up till now what I have found is that I need to modify my android's hosts file. I tried to do so but I could not get success. I try to do that with an emulator terminal application.
The host PC can be accessed (from within the phone emulator) using the IP address 10.0.2.2.
That is clearly stated in the Android Emulator documentation.

I'm using xampp for local server and I want to test my locally hosted site to android mobile. How would I do that

I'm using xampp for local server in a 64-bit system. I want to test my locally hosted site to android mobile device to check the responsiveness without hosting it to any web server. How would I do that. Please answer soon
Make sure the Apache module in XAMPP is started up and your android phone is connected to your router(assuming that you are on a wireless network). Find the local IP address of the computer hosting the server. Mine, for example, is 192.168.1.142. This may or may not be similar to yours. Type that IP address into the phone's URL bar. You may need to append the port number to that too, depending on the server settings. For example, if XAMPP is running Apache on port 8080: 192.168.1.142:8080.
To obtain your local IP, it slightly varies depending on the Operating system.
For windows, go to command prompt and do the command ipconfig, it should appear as an entry there.
For linux-based systems, I believe you use the command ifconfig in terminal.
If you do not have a wireless access point, it may not be possible to visit it as the phone naturally does not have an ethernet port.
I think that's not possible. However you could find a free web host to try that out. Here is one:
http://www.host-ed.net
If you really don't want to use a web host, then try downloading the files to your phone/tablet and running them directly from phone/tablet. That will work if you have just plain html/php files. Otherwise browse google play to find a app that can run those files.
This was not available in 2014, but now you can get just a simple browser extension for testing your responsive design.
For Chrome you have e.g. 'Mobile simulator - responsive testing tool'
Simple free tool

transfer files from android to computer via usb programmatically

I am looking for a solution which uses Android API to transfer a text file from an Android powered device to a computer through USB cable. I have found USB host but I cannot use this because the computer can not act as a device for the Android host.
Do you have any suggestions how I can achieve this?
I have solved this problem by using adb status-window to continuously check for device status, and when a new device is connected, the required files are transferred to the computer using adb pull command.
In order to achieve a portable solution (i.e. to run independently of Android platform), I just copied the files 'adb.exe' and 'AdbWinApi.dll' into my application and used the adb from there.
Had similar problem where a software installed in PC needed to be able to access file inside the android phone through USB. After long research here is what worked for me (not sure if this is the best solution but it worked). Windows has Windows Portable Device(WPD) API which can be used to enumerate contents of a device through USB (and copy files between client and device).
There are few implementations in java
http://code.google.com/p/jmtp/ (works well but doesnt support copy function from device to pc though there is some support available to do this with source code)
another one is jusbpmp (available in google repository)
(if somebody finds a well documented and maintained implementation do share)
but since jmtp didnt work for me (copy function source compilation(for 64bit OS) failed), wrote C# program from scratch to copy files from device to PC. here is a nice tutorial
https://github.com/geersch/WPD/blob/master/src/part-3/README.md
You can write an app which will use http to contact your pc and send (POST) data to a known endpoint.
Keep in mind that the app will only have access to the data belonging to the app. You will not be able to access an arbitrary file from the file system

How to bridge/tuntap a network device from the Android emulator to the host

Is there a way to bridge the network device of the Android emulator onto the host machine?
I have seen these instructions, but they are really old, the file names have changed, and my attempts to translate them to the current emulator haven't worked. There are a few other similar examples around, but they're all from 2007-2008. I must admit, my Linux- and especially networking-fu are not strong. I could not get a second networking device (eth1) to show up in the emulator.
The reason I want to have the network device appear as a device on the host machine is that I need to be able to connect to the android device from a remote computer (not the host), through rsh (which I've been able to do, as shown in my instructions here), and then use ssh from within to connect to another remote computer. I can get in to rsh, but I can not ssh out (or ping the remote computer). (I've been provided with an image with rshd on it, and this works fine on an actual phone, but the emulator's network devices being hidden is causing problems)
If an eth1 could be created and bridged, that would be great. I'm also open to bridging eth0 (but I'd want to change the IP to 172.x.x.x to be on the same subnet as the remote computers)
Thanks. I'll try to clarify anything if you ask.
1) Download the LiveAndroid iso from the LiveAndroid Project on google code. Or alternatively, download Android-x86 iso from here. 2) Boot it as a virtual machine with VMWare or VirtualBox. 3) Configure your virtual machine to use Bridge networking, as you would per any regular virtual machine. 4) Install Android SDK the other tools like adb onto your Host computer. Connect using adb to the virtual machine as if it were a real android hardware device.
Note: LiveAndroid is an EE-PC based virtual machine. It thinks its running on EE-PC hardware. So there will be no QEMU-based android emulator running. The network bridging will be performed by the Host-OS drivers provided by your chosen virtualization software.

Categories

Resources