Access Internet from virtual Android device during development and testing - Android Software Development

Hi,
I'm just starting off developing my first android app. An issue I have at the moment is that when I run my app on the virtual Android device (by running it from Eclipse using the "Run" button), I don't have access to Internet. My app is supposed to access a webservice on Internet.
How do developers usually handle this kind of issue - how can I have my virtual device connect to real life webservices out there?
Greetings,
kenneho

kenneho said:
Hi,
I'm just starting off developing my first android app. An issue I have at the moment is that when I run my app on the virtual Android device (by running it from Eclipse using the "Run" button), I don't have access to Internet. My app is supposed to access a webservice on Internet.
How do developers usually handle this kind of issue - how can I have my virtual device connect to real life webservices out there?
Greetings,
kenneho
Click to expand...
Click to collapse
You can't I don't think. Test it on a physical device.

abtekk said:
You can't I don't think. Test it on a physical device.
Click to expand...
Click to collapse
Actually, after testing it some more it seems like it uses the internet connection on the host computer. When I run the app on the virtual Android device, it manages to connect to internet. When I first tested it I got some error message, and it looked like it couldn't connect to internet. But now it works, at least in my setup.

Related

[Q] Firesheep app for Andriod

Hello all,
Its been a long time no speak on this forum for a while, I have finally made the jump from WM (HTC LEO/SE X1) to Android on a Dell Streak. Admittedly I am still waiting on a stable o2 sanctioned version of Froyo to put SENSE UI on!
My question here relates to Firesheep, an add on for Firefox that allows packet capture on public WiFi networks. I was wondering if anyone could port this application to android as a stand alone App, or if anything else similar had been developed?
I hope someone can give me an answer at least to the feasibility of this request.
+1
I too would love to know hehe
Sent from my Desire HD using XDA App
It would require drivers for the wireless chipset in the phone to be put in promiscious/monitor mode to capture packets, as far as I know, neither is possible, unfortunately.
timekeeper said:
It would require drivers for the wireless chipset in the phone to be put in promiscious/monitor mode to capture packets, as far as I know, neither is possible, unfortunately.
Click to expand...
Click to collapse
Couldn't it run in firefox mobile
monitor mode in galaxy S
There is an app available in market called pixie who get the promiscuous mode for the wifi interface. I'm able to capture packets in Samsung Galaxy S (GT-I9000) with the app installed.
Now we're waiting for firesheep realease for android... it's impossible to install the XPI in Firefox mobile beta...
Yeah, I tried porting the XPI over to firefox mobile, but it wont work without a packet capture utility, like WinPcap, which is used with the normal Firefox Win version.
I would be definately interested in seeing where this goes though...
vit_mar said:
Yeah, I tried porting the XPI over to firefox mobile, but it wont work without a packet capture utility, like WinPcap, which is used with the normal Firefox Win version.
I would be definately interested in seeing where this goes though...
Click to expand...
Click to collapse
It is also working in OSX so I guess libpcap should be enough to use it. By reading this http://seclists.org/tcpdump/2010/q1/98 it seems that there is support for Android. However you will need root access to use it.
This thread, discussing Shark for Root app, refers to a lot of functions that firesheep uses: http://forum.xda-developers.com/showthread.php?t=725692
Perhaps using libpcap/tcpdump (as janfsd suggested), we can port this over. Root is a must though, true...
any updates?
i need this for my N1
Tanks
Bumping for an update on this project!
Found this thread in google. Try http://faceniff.ponury.net/ I've wrote it yesterday I wrote it to sniff only facebook accounts but it can be easily modified to other services.
Hello!!
This is awesome! wooow! I don't mean the fact that you can steal web session profiles,
but the fact that an Android application can open an interface e.g. WIFI and realise sniffing -
network monitoring without being run as root or system. To do so, an application should be
signed with the platform's key : http://stackoverflow.com/questions/6010796/run-secure-api-calls-as-root-android
How is this possible?? I am really wondering about that. Some time ago I tried to port
jNetPcap, so as to use it in an Android application for monitoring the WIFI. I successfully
ported it but I couldn't read the list of Android interfaces from its API and realise web
monitoring.. (see here for details: http://stackoverflow.com/questions/5966603/jnetpcap-on-android-problem-with-findalldevs-method,
http://jnetpcap.com/node/792)
I am really wondering how faceniff faces this problem??
e.g. Shark for Android runs an instance of libpcap in the background and derives the
appropriate information from the pcap traces..
What faceniff do to get the information it wants, e.g. the web sessions?? I am
really curious about that.. Any ideas?
faceniff runs as root....
Yes, but how is it possible to make an application that runs as root?
There is no Android permission you can use in Android manifest to give you
such privileges.. Even other Android applications that run only in rooted phones
cannot open an interface an capture traffic, and for this reason they run in the
background a tcpdump and process the pcap traces it produces (e.g. Shark for
Android).
is anybody here that knows how faceniff can capture packets??
I know how it works because I wrote it
It has a binary file which lies in /data/data/net.ponury.faceniff/
Then the java app executes "su" (to gain root permissions) and executes that binary file. And it grabs results from the binary showing them on the screen. Hope it helps.

How to connect to android phone over 3g or 4g

Hello.
Does anyone know how to get access to their cellphone using the IP address from the wireless carrier?
I've already got SSH set up from the home wifi network. But I'm hoping to be able to do this over cellular. Any ides how to make that work?
Sent from my HTC Glacier using XDA App
If you meant having your phone run an sshd daemon, so you can use a shell with it .... Market has this: https://market.android.com/search?q=sshd
close...
that is what i'm looking to do. but for some reason i'm unable to connect to the device's ip address... any ideas?
Your phone's ip is a private ip address. TMO NATs it to a set of public ip addresses to go out to the internet. That's why you can't connect using your phone's ip.
Sent from my HTC Glacier using XDA App
Darn. I was really hoping to be able to get through. Oh well. Thanks.
Sent from my HTC Glacier using XDA App
One option to get around this is to use remote port forwarding via SSH. You can run an SSH server on your phone and then use ConnectBot on your phone to SSH into an SSH server on your home network. At that point, you can use remote port forwarding with ConnectBot to allow other computers on your home network to access the SSH server on your phone.
That's a very good idea. I'm going to try it in the morning. Very excited.
Sent from my HTC Glacier using XDA App
Hey ran across this sometime ago but didn't know an answer till today... but it's complicated...
1st~ it seems to depend on your service provider...
~ On Sprint I have been able to ssh into my device from a PC connected to a completely different wifi network using Putty on Vista home basic.
~ On Sprint I (with some great help from Almazick here at XDA) have also been able to run a LNMP server and connect to the sample web page and dbmin with the above mentioned network set up but with Chrome and Firefox instead of Putty (yeah that might be a duh statement for some but I don't want to lose ya reader, this stuff is cool ) you can find all the steps that that took by following the link in my sig that points to the XDA Guide I maintain and jump to pages (ruffly) 11-13+ and check the easiest ways to host websites off your device. And I'll eventually have a script and section in the main guide made so you all don't have to scroll through pages of our mutterings
~ Almazick, the person that I credit for getting me to do all this extensive testing, is not on Sprint and because of this has run into errors when trying to connect over 3G and or 4G. This leads me to believe that the issue is the network that your device is connected to.
~ Currently there are almost no other variables left that could be at fault. Both Almazick and I are using the same software and apps to test on.... but for those that have to know what the last variables to test is; hardware, we've got different devices and different service providers, and different PC's. All others have been eliminated or made identical or have been adjusted for.
2nd~ Root is required and if you want to ssh like us then getting Linux duel booted up will make life way easier for helping in the future.
~ Almazick uses Lil Debi and I'm a fan of Debian Kit, both can be found on the Android market place for free, and there are other options like QEMU and more but for this definitely start with Lil Debi and a 2Gb img file or larger (still working on figuring it out on Debian Kit) and follow the direction on page 11 or 12 for now.
~ or you could try downloading an app for ssh server (not client alone) and muddle your way through other guides on the web... I'll be testing/checking the possibilities for this but am not holding my breath on when that'll be ready
3rd~ accessing things...
~ running 'cd sdcard' and 'ls' was peppy and responsive
~ running programs or apps that use lots of data or memory can be ruff.
~~ Force closures happen when out of memory. So freeze or force close or uninstall apps that aren't needed if things like that start happening.
~~ things that use lots of data and or memory also cause much drain on the battery and if excessive wile plugged in can cause heat issues. So use a heatsink from an old computer and a fan and maybe pull the battery too and you can run a bit longer on the edge of what your device can do
4th~ all this is very "use at your own risk"
~ I haven't fried or bricked a device yet but things have gotten toasty so use some for thought and be careful.
Final notes;
I realize that this is a thread resurrection and not 100% directly related to your specific device. However, I offer a work around that should work for all devices* running root and Linux so we should celebrate and revel in the wonders of Open source and helpful people
*running on Sprint or WiFi if on another network then please try it and report the bugs to me on the main guide thread and I'll work with you and try to resolve it
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
nixxofugi said:
Hello.
Does anyone know how to get access to their cellphone using the IP address from the wireless carrier?
I've already got SSH set up from the home wifi network. But I'm hoping to be able to do this over cellular. Any ides how to make that work?
Sent from my HTC Glacier using XDA App
Click to expand...
Click to collapse
SSH server requires a PC which must be always on but you can use a router since it's already running 24/7. If you have a router with SSH/VPN/Proxy capability then you can use router as a server. For example you can use a 3rd party firmware for your router if it is compatible with DD-WRT, Tomato or OpenWRT to run Proxy server, SSH or VPN. They are very easy to setup for this task.
Update: Just noticed it's 2011 thread. Oh well
Almazick said:
SSH server requires a PC which must be always on but you can use a router since it's already running 24/7. If you have a router with SSH/VPN/Proxy capability then you can use router as a server. For example you can use a 3rd party firmware for your router if it is compatible with DD-WRT, Tomato or OpenWRT to run Proxy server, SSH or VPN. They are very easy to setup for this task.
Update: Just noticed it's 2011 thread. Oh well
Click to expand...
Click to collapse
Yeah I do that, been haunting the web for sometime now... I keep a personal log of questions I want answers to and when I find one that is solvable I go back to where I first ran across the question in the first place. Should have seen what the maptools teem thought of this kind of behavior; really motivational
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
S0AndS0 said:
Yeah I do that, been haunting the web for sometime now... I keep a personal log of questions I want answers to and when I find one that is solvable I go back to where I first ran across the question in the first place. Should have seen what the maptools teem thought of this kind of behavior; really motivational
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
Click to expand...
Click to collapse
so what maptool got to do with android over 3G/4G?
Almazick said:
so what maptool got to do with android over 3G/4G?
Click to expand...
Click to collapse
It's yet again a server client based networking set up but instead of accessing files and folders (like with putty here on this thread) or accessing web content (like with LNMP on the other thread) maptools serves up a virtual table top gaming experience to those that connect in. One person sets-up* a game and then shares out the guest login info to their fiends, the guests log in and after a few seconds every one connected can see the changes that any other player takes. Kinda like virtual desktop but for roll playing games.
*set-up of the game is rather labor intense for the individual. Because they make an entire dungeon or world map, tokens to populate it, and libraries of macros so things are more point and click. When compared to running a normal tabletop gaming experience the labor is almost as intense, it's just not easy to share in real time over them internets.
Update 08312013- to help continue answering this question here I found this guide
https://grepular.com/Punching_through_The_Great_Firewall_of_TMobile
That may help with T mobile subscribers in making a good connection over 3G or 4G
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
my carrier is: vodafone
im using SetDNS with openDNS server
also using Dynamic DNS with a no-ip.biz hostname
installed ssh/sftp server i run it... used a ssh client to test it locally, and it works, so the sshd is working
but i cant connect to my no-ip hostname from my PC
here i have some doubts:
SetDNS says it doesnt detect a web-proxy, yet Dynamic DNS has a note: 'you are connected to the internet through a proxy'
what to do next to be able to connect remotely from my PC on ssh through 3g on my phone?
please help!
ripnix said:
my carrier is: vodafone
im using SetDNS with openDNS server
also using Dynamic DNS with a no-ip.biz hostname
installed ssh/sftp server i run it... used a ssh client to test it locally, and it works, so the sshd is working
but i cant connect to my no-ip hostname from my PC
here i have some doubts:
SetDNS says it doesnt detect a web-proxy, yet Dynamic DNS has a note: 'you are connected to the internet through a proxy'
what to do next to be able to connect remotely from my PC on ssh through 3g on my phone?
please help!
Click to expand...
Click to collapse
Well first double check the IP you're using or tracking with no-ip.biz ~ I would suggest using
canyouseeme.org
or an app like Network Info II
https://play.google.com/store/apps/details?id=aws.apps.networkInfoIi
And ensure that the IP didn't change when setting up the first time around, this can happen at the worst times.
And if you're truly behind a firewall or NAT, such as with tmoblie, then I did run across this guide for getting round that last troublesome bit which likely will work for other service providers as well.
https://grepular.com/Punching_through_The_Great_Firewall_of_TMobile
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey

[Q] Remote access from device to device

I was wondering if there was a way to remote access an android device from an android device for example, accessing my fire from my phone.
I am not an expert but suspect that a wireless network would be the only way because as far as I know the 'fire only has wireless interfacing. Hopefully I am wrong though
Well I Knew that It would have to be via wifi. What Im asking though is are there apps that allow for remote access between android devices.
you would need a vnc server on the one:
https://market.android.com/details?id=org.onaips.vnc&feature=search_result#?t=W251bGwsMSwyLDEsIm9yZy5vbmFpcHMudm5jIl0.
and a vnc viewer at the other:
https://market.android.com/details?id=android.androidVNC&feature=related_apps#?t=W251bGwsMSwxLDEwOSwiYW5kcm9pZC5hbmRyb2lkVk5DIl0.
have never tried it but you could check it out
theoretically it should function
also from a pc or mac vnc viewer - there are plugins for browser
What are you trying to do? Wifi file explorer for filed. Google voice with desksms will allow you to text from your fire... etc
Sent from my SGH-I897 using xda premium
I was trying to use my phone as a remote because I keep my kindle in my room and play music but im normally downstairs so I could then change the songs and things over lan.
victimofcanada said:
I was trying to use my phone as a remote because I keep my kindle in my room and play music but im normally downstairs so I could then change the songs and things over lan.
Click to expand...
Click to collapse
exactly for that are the vnc solutions above
did you try it ?
Not yet haven't had time lately
Sent from my Huawei U8800-51 using xda premium
Did it didnt work really cant access kindle from my pc or from my phone.
made a short search on the market for "remote desktop" - there are a lot of apps - maybe one of them is fitting your needs
sorry no more ideas ...
b63 said:
made a short search on the market for "remote desktop" - there are a lot of apps - maybe one of them is fitting your needs
sorry no more ideas ...
Click to expand...
Click to collapse
Those are usually for controlling a PC from the android device.
lmntone said:
Those are usually for controlling a PC from the android device.
Click to expand...
Click to collapse
agree - tested some hours nightly
test pc (with browser) to kf:
there are some (vnc server on kf) which are used to control the kf from pc
basically they are working but they can't handle the screen rotation correctly
means the click points are disorted and you have no control
test galaxy tab (with browser) to kf:
nevertheless conection with the vnc server is working with javascript which i don't have on my vnc client test device
did search but java seems not to be available for android
anyone correct me if i'm wrong
still have to test with a vnc client on the galaxy tab ...

Remote you phone from Computer!

Android - Remote your android phone via usb cable or wireless router from PC.
Phone must be ROOTED!
Download droid VNC server - http://goo.gl/hYLXp - install it.
Download android adb driver - http://goo.gl/faiJU
extract adb.zip driver to Local Disk C = C:\adb
Now, click start, click RUN, type CMD, - ENTER
type adb command - cd \ - ENTER, type adb.exe - ENTER.
type - adb forward tcp:5901 tcp:5901 - ENTER
type - adb forward tcp:5801 tcp:5801 - ENTER
Go back to you're phone and open/start droid VNC Server
Wireless Mode - Phone and Computer must be connected to the same router.
Follow instruction on the phone screen once you press start - Example http://192.168.1.2:5801/ <--- type this in your Computer browser = Enjoy!
USB Cable Mode - Disable data connection (flight mode). Start droid VNC Server, Follow instruction on the phone screen once you press start - Example http://localhost:5801/ <--- type this in your Computer browser.
Once you able to remote your phone from you computer browser, press phone menu and re-enable data connectivity (disable flight mode) = Enjoy!
Or simply download Remote Web Desktop in the Market. It's free.
or webkey, also free on market. havent tried Remote Web Desktop, but webkey is pretty good
dr. xp55 said:
or webkey, also free on market. havent tried Remote Web Desktop, but webkey is pretty good
Click to expand...
Click to collapse
my mobiler is the easiest i have tried. Just install the software on the pc (i use win 7 64 bit). turn on the "debugging" in the development settings of the phone. it will automatically push the app into the phone. Very simple indeed...
irajvi said:
my mobiler is the easiest i have tried. Just install the software on the pc (i use win 7 64 bit). turn on the "debugging" in the development settings of the phone. it will automatically push the app into the phone. Very simple indeed...
Click to expand...
Click to collapse
my mobiler is the easiest. Tried. thanks
irajvi said:
my mobiler is the easiest i have tried. Just install the software on the pc (i use win 7 64 bit). turn on the "debugging" in the development settings of the phone. it will automatically push the app into the phone. Very simple indeed...
Click to expand...
Click to collapse
+1 mymobiler.
v0.9.2
wow, its like opp of vnc.
irajvi said:
my mobiler is the easiest i have tried. Just install the software on the pc (i use win 7 64 bit). turn on the "debugging" in the development settings of the phone. it will automatically push the app into the phone. Very simple indeed...
Click to expand...
Click to collapse
my mobiler needs the phone to be connected to the desktop with a usb cable. thats a turn off. and if a rom (such as some of the ics roms based off the leak rom) isn't supporting usb mount, then theres no use. webkey can be connected to your phone from any wi-fi connection, from any browser, from any pc.
Mymobiler was the ipso facto app for wm6.x to enable one to control ones phone via a pc.
many people were waiting for it to be ported to android. It does support wifi as well as USB connections. I'm fiddling with mine now, as it happens. (downloading webkey, never heard of that one so thanks. I'll have a fiddle with that one too. It looks far more complicated i.e My mobiler is exactly what is says. Your phone on your desktop. I do like the look of the GPS stuff in webkey though.. Still fiddling...)
Webkey... far too complicated. How many user names/passwords/registration of device with them even?
kies air
you guys do know tht there is an app called Kies Air on our devices by default tht allows you to do tht ryt?!
Kies Air has less functionality
jeremy.chan said:
Kies Air has less functionality
Click to expand...
Click to collapse
I agree with that, but it also depends on what requirements you got
little bit slow, but worth it a try
webkey is slow over the wifi. cant connect with usb. much trickier than mymobiler. Also much slower than my mobiler.
Actually, I agree. Hence, I've uninstalled it since discovering Airdroid. Its also free on the now Google Play Store (seriously though, Google Market sounds much better, I don't know what they were thinking.)
Its similar to webkey, but its more organized and has a better layout. And if you can't or don't want to connect via Wi-Fi you can tether it to your PC with a USB. You can control your Note from the browser as well. Definitely check this one out, much simpler to use. I don't like apps that restrict me to only be able to control my phone or act as a file manager with a cable. But this has both options.
Sent from my GT-N7000 using xda premium
You can now use our VMLite VNC Server, the first and only VNC Server that works on any devices, on rooted or unrooted devices.
It provides you the full control of the device from a PC or from another device, with very repsonsive keyboard and mouse operations.
https://play.google.com/store/apps/details?id=com.vmlite.vncserver&hl=en
For a review, pls read:
http://www.androidtapp.com/vmlite-vnc-server/

User Android to put a PC to sleep over a network.

Hi guys,
Am trying to put a PC to sleep over a network from my sgs3. I can use vnc to do it but would like to be able to have a button on my home screen that does it for me when pressed. Is this possible? I have tasker but have no idea if that will help.
Any ideas would be great.
Blinky
Sent from my GT-I9300 using Tapatalk 2
Take a look at unified remote for android.
You can install a free android version, it has power control to sleep/shut down your PC. Also if you configure your machine to support wake on lan (usually in the bios) this app can wake it up as well.
Cheers for the reply, I am trying to do this without the need to install more software on the server PC.
Is there any way of executing a batch file stored on the server from the Android device?
Cheers
Blinky.
Sent from my GT-I9300 using Tapatalk 2
What os does the server run? Fairly easy if it's linux as you could use ssh from your phone to run remote commands, if it's windows I'm not sure, I haven't found an android implementation of psexec sadly.
I think WMI gives you some capability. At work we have a script to gather data and it uses WMI to gather logs and Windows logs and registry keys from customer's machines.

Categories

Resources