Allow App In Android Emulator to Access Intranet - android

This probably has been asked a hundred times. But I can't seem to see any answer. How do I set the Android emulator so that my app running in it can access a web server set up in our intranet (LAN)?
I have tried setting the proxy/port (both in the settings in Android and specifying -http-proxy when launching the emulator) but I can't get my app to connect to the intranet.
Hopefully, someone can give me a quick answer as this is really urgent.
Thanks and regards,
Rai

You do not need to add any new configuration to the emulator to work. It uses the network what your laptop or System has. It is a new bridge setup on your system using which it communicates to the outside world.
So, I suggest, you check if your system is able to connect to the web server is setup.

Related

Testing Network Throttling using chrome dev-tools for an android app does not work

Goal: Test android app on a physical device with various network connectivity issues (Offline, Slow 3G etc). Android Emulator is not an option for my use case.
Steps I have tried: (Remote Debugging)
Connect my phone to my computer and open the app on my phone.
In chrome "Remote devices" I select my phone and click on inspect for the app opened on my phone. Once the Developer Tools window opens I can play with my app from chrome.
In the network tab I can see the throttling options but when I try the offline option or any other option to slow down the network it does not seem to work.
The offline/slow 3G option works for a normal website but not when using remote devices. I wanted to see if anyone has tried this option before and if it worked for them and I would appreciate suggestions for better alternatives to test an android app with various network settings other than using chrome remote devices?
Other options I have come across are installing a proxy app on PC/Mac and configure networking throttling in the app and then create a wifi hotspot and connect my phone with it. This is possible but it would be tricky with the tools we use so I was looking for a more elegant solution.
The "remote devices" of chrome won't affect your native app. It will not even affect another opened tab other than the one you are "inspecting" and throttling. If you really need to throttle your device's network connection you should use a proxy. A good and easy to handle proxy is Charles web debugging. The free version will cover your needs if you are willing to reconnect every 30 mins. But for sure I recommend you purchase a license since this tool will be always helpful and developers also need to make a living ;)
Here is an example of setting up Charles as a proxy for an android device.
It's a little unclear from your question, but I'm assuming that you're using Remote Debugging to run a webpage on an Android device, and you want to profile the webpage from a laptop/desktop connected to the Android.
One workaround is to use https://www.webpagetest.org/easy. This actually runs your webpage on a real Motorola G device in Virginia with a Slow 3G connection. It gives you a detailed report on your loading performance, just like the DevTools Performance panel.
One of the DevTools team members said that Remote Debugging + Network Throttling should work, but neither of us has tried it recently.

I can not access my notebook with my Android using IPv4

I'm having a bad problem and it already gave me a headache. I did an application with Magic Software and to run it on my Android I have to configure Magic Studio the right way (done), run the project on the Magic server (done and working) and install MagicDev.apk on android (available in the Magic XPA folder and already done), and when finished installing, the application must be run and when it is executed it asks to enter the URL of the Magic application, which is the following: http://[IPv4_of_notebook]/MagicScripts/DevProps.txt, but when you try to access this, it is not possible, it says that the application was not found or the connection failed.
It is worth mentioning, I had this same access problem when using XAMPP or Wamp, because when trying to access the localhost with the cell phone, the link would not respond, it would load until I gave the message (I put Wamp online for this, of course, and changed the settings in the [files].conf). Another important thing is that I made an Android application in Android Studio where one of its functions was to access the internet and although the application installed on Android really could not connect to the link, the emulator accessed quietly (the emulator runs inside the pc, would there be anything?) and I could do what I had to do, this link was on a page I made using Wamp, that is, the emulator accessed my IP, and the cell phone can not.
My question: Is this some configuration of the notebook, Android, Internet router or am I doing something wrong? My friend created a page using Wamp, configured it correctly and placed it online and from my home, with his IP, I accessed the page (with my notebook) in a quiet way. One more note, my notebook connects to the internet with Wifi and my Android too, meaning they are not connected to the source directly as my room PC is, and I do not know if that also matters.
I will later try to run the application on my PC from the room and see if it gives him access to his IPv4, but I do not think it will work either. Anyway, does anyone have any idea what it can be? I do not like messing with my notebook's Internet and other settings without knowing what I'm actually doing, I'm afraid to make my notebook vulnerable. Here in this video https://www.youtube.com/watch?v=1njzFq07t2U you can see the process I'm describing here, but it's not working for me.
I already figured out the villain, it was the firewall. When I turned it off everything worked as expected. I can not keep it turned off for security reasons, but from what I've seen I can configure it to accept only my phone.

Android App installation on phone for testing : Suggestions

I am trying my hands on the android app development and need your suggestions to mitigate my current situation.
My organization has disabled USB for the desktop and I wouldn't be able to connect my phone through USB to test my application as I code.
I have installed genymotion but since it is behind proxy, in all the ways I could configure it, it gives proxy authentication error.
The avd is comparitively slower and the app which am trying needs internet connectivity at every step. I have tried these too and my impression is that we can make
the avd work for connecting to internet through its webbrowser but it cannot connect to internet within the apps. I might be wrong here. Please let me know if it is not the case.
Is there any other way where we can install the app in the phone as and when we code to test it..?
One option can be to export an apk file everytime and install them on the phone by sending this apk through a mail. But this will be a cumbersome activity if we have to test as and when we code.
Any suggestions on this..?
PS: I do not want to hack the desktop to enable the USB.Also using an external laptop with USB enabled is out of option in my case.
Many thanks.
Another way is using AirDroïd. You just need to install it on your test device, and you can manage it with a webapp :
your.static.ip.xx:8888
You can install your app with that way, it's really easy, you don't need any account in a local network.
For testing... no idea without usb, or without the emulator. Maybe you can log everything in a text file & get it (with airdroid for example).
EDIT
I think if you create an account you can use it external of you network.
http://web.airdroid.com/
Just create an account, & log on web & on the app, you could use it on the external way.
Why are you even bothering to use the desktop PC when your organization has made it unsuitable for development.
It will be hard work, but you could do all your development on the Android device itself, using AIDE
(Actually AIDE is pretty practical as a IDE if you have a large screen tablet, and pair it with a full size bluetooth keyboard).
Quote: "Inside your project bin folder there is an apk file. If you copy that file to a device you can then install the app from it.
When I am in your situation I throw my apk into dropbox and send out links for people to download it."
from this link
I doubt that if your company has disabled USB they still allow Bluetooth, but because you did not state it specifically:
If you can use Bluetooth, the best way would be to use it for running and debugging your App.
There are some Tutorials on the web.
For Example: http://zcourts.com/2013/07/19/android-debugging-over-bluetooth-without-root/

Setting proxy to Android Emulator

I'm having a problem to surf internet on my Emulator, wich is targeting Google API8.I followed all the instructions I have read, setting the proxy in MobileNetworks-->APN--->....,etc, and doesn`t work. If I remove the proxy, the browser navigates locally, and if I have the proxy configured it doesn't even navigate locally.
I tested the same coonfiguration on an emulator targeting API16 and did work!!!!(local and on the Internet), so please how can I solve this.Any help will be appreciated.
PD: I tested using -dns-server x.x.x.x too and happens the same.
Emulator uses the internet connection from the host computer where it's installed.
If the host computer doesn't need any special configuration to access internet (proxy, etc.), then your emulator doesn't need it either.
Only if your computer needs a proxy configuration (or other), you will need to replicate it in the emulator.
Regards.

Not able to connect secure sites ("https:") from android emulator

I am working on a android application, which is accessing a secured (https://) web service for some data. But I am facing some problem while testing the application in AVD emulator. The problem is that I am not been able to access the "https:" site neither from my application nor from the emulator browser. While I am trying to connect the site (in fact any secured website ) from the browser it's showing the error message as "Data connectivity problem.
A secure connection could not be established.". Though I can access the same websites from my window's web browsers.
According to my analysis the problem is with the privilege setting of the emulator. I am running the application on a corporate (my office) machine, where I don't have the admin rights (but I am a power user) and the machine is also behind the proxy. But as mentioned before I can access those secure sites from the machine's browsers, the only problem seems to be with the emulator accessibility.
I tried to test the same code from my personal laptop and as expected it's working perfectly.
Can somebody please help me out to find out the solution for this? How can I access a secured site from the emulator? FYI I am using eclipse Helios & Android 2.1
Please let me know if you need any more information from my side.

Categories

Resources