What connection use emulator in android studio? - android

Android studio has its own settings for connection. There I can use proxy. So this way studio will use that proxy instead of computer wifi connection to sync libraries for example.
But for example if my application I send requests to the firebase what connection will be used by emulator? It will use studio proxy or it will use computer wifi for that? And if I use real device will it use mobile internet connection or proxy?

I have tested all scenarios. So the answers are the following.
Everything local depends on local WIFI of the laptop. Android studio has opportunity to set up its own proxy but also wount work without wifi. Android emulator has a wifi spot calls AndroidWifi in settings which indicates laptop wifi.
The real device use its own connection. So these are to separate different parts. If there is no connection on laptop but there is on real device. So you can't add library but you can launch based on HTTP requests app on real device.

Related

ADB Debug over remote desktop

Essentially I have 2 computers. One a client, on a network that I can't edit, and a 'server' that is running Android Studio, and whose network I can request adjustments made too. I would like to be able to compile an app from android studio to a device connected to the client. The client and server are not on the same network. Is there a way to do this? I've tried a few solutions but none of them work.
Edit: I'm not adverse to changing the remote software if need be
If you can get both the computer with Android Studio and the device on the same wifi network you can use wireless adb.
Described here:
https://developer.android.com/studio/command-line/adb.html#wireless

How do I capture Android http traffic using charles or wireshark (which is on PC) under VPN connection?

I have googled a lot about setting up fiddlers for capturing android traffic. I have tried each of the suggested options. None of them work when there is an active VPN connection.
Setup: Charles or Wireshark is available on PC. Both PC and android device are on same network and on seperate VPN connections.
Tried approaches:
Configuring Wireshark/Charles – Created a new adhoc wireless network and making the android use the same. Another way was making the laptop as a virtual router or hotspot. None of these methods work when it comes to VPN.
Using TCP/IP monitor available in eclipse – This is a great tool built in eclipse, but needs hostname and port. For the internal website I do not know the port. Since it is standard http setup, I am assuming it should be either 80 or 8080.
Using different fiddlers available on Play store – All good fiddlers like tcpdump need the phone to be rooted and that’s not an option for me.
Tethering of PC network onto mobile - This again fails when it comes to VPN (damn you, VPN)
Anyone with any insight, most welcome !
Thanks!
Have you seen this approach? Have you configured proxy on you device connection?

HTTPS connection on wi-fi enabled Android Wear without phone tethering

I can't find any documentation on Android Wear that shows how to create an app that leverages the fact that some watches (like my Samsung Galaxy Gear) can now connect directly to the internet via wi-fi when the phone is not around.
I have a few apps that generate https requests to access a REST service and I would like to know if these can be directly called from a Wear app connected to wi-fi (no phone).
Similar questions don't seem to answer this:
Direct internet connection on Android Wear?
https://stackoverflow.com/questions/26062487/android-wi-fi-direct-persistent-connection
Android: Establish "Wi-Fi Direct" connection with networked devices
My tests on a Wear emulator tethered to an internet enabled Phone emulator show:
java.net.UnknownHostException: Unable to resolve host "api.xxx.com": No address associated with hostname
But of course there's no direct wi-fi connection on the watch emulator so my next step is to try on a real watch and phone.
My suspicion is that Android Wear's data API handles this transparently so direct http requests seem impossible.
Best, thanks in advance for your help.
Even if Android 5.1.1 support Wi-Fi Feature. Android Wear on Wi-Fi: Using a smartwatch without a phone nearby
You should stick to the Data Layer API, you cannot send http request directly from watch. Fetch internet data from the phone, then transfer it to watch with Data Layer API.
You can see this Does Android Wear support directly access the Internet?
And this document Always-on and Wi-Fi with the latest Android Wear update
From the last update its possible to make http requests over wifi using android wear. You can even connect a bluetooth headphone to it to use with some streaming app.
While on wifi, if your mobile phone is connected to the internet too (dont need to be the same wifi, can be even 3g) it will act the same way it would when bluetooth connected yo our phone, but with its own internet access.
This dont mean apps will change their behavior, because most of them are coded to make the requests from your phone, but if you have an app that make direct networks requests, it will send them from your watch without advising or needing your phone.
How to do networks requests on android wear
Just use the same network requests libraries you would use on a normal Android mobile application, like volley, retrofit, okhttp. The code is exactally the same, and by the way, any Android Mobile library works with Android Wear too.

Change subnet of Android Emulator?

I need to test an App I wrote that's being used in a different country. This app will only work there as it communicates with the local network there. My boss has asked me to remote in and install the Android emulator on the client PC so we can run tests.
The PC's net config operates on the subnet 192.168.0.xx
The devices the app wants to communicate with are on 192.168.1.xx
There doesn't seem to be a way to get the emulator to work on the different subnet. The internet works so I'm assuming this is blindly using the client PCs internet connection (on 192.168.0.xx). In which case if I change the client PC's network configuration I'll lose my remote connection and cannot continue my work!
I've had a Google to no avail.
Any suggestions?
Thanks.

Android emulator Wi-Fi

Is it possible to connect the emulator to Wi-fi? Since am not using eclipse or any IDE... Am trying to connect a stand alone emulator to Wi-fi
Currently, while you can use your computer's Internet connection in the emulator, it's not reliable to use it for simulating Wi-Fi. The WifiManager gets confused when you switch/want to test your connectivity state.
Even in Android 1.5, there were some problems with it (Issue 2571 - android), and while you can use your Internet for simulating HTTP connections and downloading data, finer control over Wi-Fi connectivity should better be done with a device.
If you mean that the emulator should connect to the internet via your PC/MAC then it works without any changes.
I am able to browser the internet via the browser in the emulator i.e. the emulator has internet connectivity.

Categories

Resources