android-wifi

Android doesn't work if I use mobile data instead of wifi

我的梦境 提交于 2019-12-08 07:53:00
问题 When I launch my android app and I try to do a login process using WiFi data, it's all right. But if I launch the app again and I try to to the same process using mobile data, the process still waiting until I get an error. The code is: class AsyncLogin extends AsyncTask< String, String, String > { String username, password; protected void onPreExecute() { pDialog = new ProgressDialog(MainActivity.this); pDialog.setMessage("Login..."); pDialog.setIndeterminate(false); pDialog.setCancelable

Android strange cross device behaviour

送分小仙女□ 提交于 2019-12-08 06:08:49
问题 I have three android devices, a Samsung Galaxy Note 10 an HTC Desire C and a Sony Xperia E. As well i have a service that listens on a specific TCP port on these devices. The WIFI policy is set to "Always on" in all of my devices as well my service acquires a WIFI_MODE_FULL and a PARTIAL_WAKE_LOCK so the CPU and WIFI are always there. After some time when i want to connect to these devices from the server something bad happens. The Samsung Galaxy Note device always behaves correctly. HTC

Android Wifi Bandwidth

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 04:45:03
问题 Recently I was given a task to develop Android app on Nexus 7 tablet, which would be conneted with pc via tcp sockets using wifi. Particularly I had to pass stream of images (uncompressed BMP for example) to tablet. So I made simple test to check bandwidth and was dissapointed by results. I'm siting with my tablet just in front of wifi signal sourse, it's written that connection speed is 54Mb per sec, but I get only ~16Mb per sec considering test results. Test code: PC: public static void

find internet ip address in android mobile programmatically , no need device ip address

落花浮王杯 提交于 2019-12-08 03:05:52
问题 i am trying to get the Internet Ip Address in my mobile. no need for device ip address. that device is connected with wifi or 3g or 2g or anyway. that mobile is having internet facility means, i need that internet IP Address. Note : already i tried some coding. that code will work to get the device ip address only. my prev code : try { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for

How does Android's scan-only mode work?

孤人 提交于 2019-12-08 01:52:46
问题 Android 4.3 added new 'software' feature that keeps Wifi get scan results even if Wifi is off. It says that this mode consumes very low power. My question is how this technically done, and how much power saved compared to just enabling Wifi? 回答1: The logic is simple: driver and wpa_supplicant is never unloaded from the memory, unless scan-only mode is disabled in WiFi advanced menu via Scanning always available option. In terms of power consumption - the numbers will differ for every WiFi

How do I connect to multiple Wifi networks one after the another programatically in Android?

▼魔方 西西 提交于 2019-12-07 18:59:31
问题 I want to check the presence of some pre-defined open Wifi networks using the Android API (and I want to add them programatically before checking their presence). Here's what I've done. I have created a blank Activity as follows: WifiManager wifiManager; protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); wifiManager = (WifiManager)getSystemService(Context.WIFI_SERVICE); myWifis(); } public void myWifis() { //Add

Can I use WiFi to transfer data/messages between two android phones, not connected to a router?

蹲街弑〆低调 提交于 2019-12-07 08:57:10
问题 I'm aware that if two Android phones are connected to a same wifi network, they can implement socket programming to transfer data between them But I actually want to know if you can use wifi as a transfer medium between two Android phones, just like you Bluetooth? 回答1: With Android 2.2+ it is possible to create a WiFi hot-spot on one device so another device can connect. Internet connection on either device is not required. 回答2: What you are looking for is ad-hoc wireless networking, which is

Android Wifi Bandwidth

。_饼干妹妹 提交于 2019-12-07 08:14:27
Recently I was given a task to develop Android app on Nexus 7 tablet, which would be conneted with pc via tcp sockets using wifi. Particularly I had to pass stream of images (uncompressed BMP for example) to tablet. So I made simple test to check bandwidth and was dissapointed by results. I'm siting with my tablet just in front of wifi signal sourse, it's written that connection speed is 54Mb per sec, but I get only ~16Mb per sec considering test results. Test code: PC: public static void main(String[] args) throws Exception { Socket socket = new Socket(androidIpAddr, port); OutputStream

Using Android phone as wifi web server

二次信任 提交于 2019-12-07 05:36:07
问题 I got this crazy idea that I don't know is possible or not... what I want to do is set up my phone as wifi access point, then allow people to connect to it, but handle all incoming http traffic myself. So: phone wifi in access point mode; open wifi network (this tidbit works - yes I know it's not officially supported but then I have no intention to distribute put this app on the open market or so, it works on my phone and that's good enough for me). client can connect to the phone (e.g. my

How to create wifi tethering Hotspot in Android Marshmallow?

旧城冷巷雨未停 提交于 2019-12-07 04:59:07
问题 I've tried to create a Wi-Fi tethering hotspot in Android Marshmallow using the following code. public class WifiAccessManager { private static final String SSID = "1234567890abcdef"; public static boolean setWifiApState(Context context, boolean enabled) { //config = Preconditions.checkNotNull(config); try { WifiManager mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); if (enabled) { mWifiManager.setWifiEnabled(false); } WifiConfiguration conf =