Currently investigating this area will update this post if / when i find anything out. Any extra brain power will be much appreciated on this.
similar but not duplicate thread - Android : Check 3G or Wifi network is ON or Available or not on android Device
Use case.
User walking along the road using 3G. When the background service sees that networks are available :
Check if the Wifi network that we now see can be associated to.
Check if the Wifi provides an active connection (do a test ping and look for expected results)
Does the Wifi network need a Wispr Login.
If it does perform our Wispr authentication logic.
Then ONLY once we have got an active connection, switch the user off of 3G and onto that WiFi network.
Basically, can I send calls specifically using the WIFI device port whilst allowing the user to continue using 3G?
Thanks
Looks like there might be a way - Let WiFi and 3G connection work together by hacking ConnectivityService.java - but looks nasty.
Could you enable both - check for wifi connectivity and then disconnect 3g /or wifi depending on the outcome?
Related
Can two android devices share hello message just by enabling their wifi? They should not be connected to an internet network, but just should exchange messages when wifi turned on
It is possible to send messages without being connected to an internet network.
For instance, Jott, an Android and iOS app, uses what's called a mesh network to allow users to send messages to each other when they are in close proximity. The mesh network operates on Bluetooth low energy or using a router that can reach within 100 feet of each user.
Not sure if this helps with your idea of enabling wifi, but it's something worth looking into.
I have never done this myself but I read there is thing called Wi-Fi Direct that allows phones to connect each other without a Wi-Fi access point.
https://developer.android.com/guide/topics/connectivity/wifip2p.html
I am working around wifi direct and NSD (Network Service Discovery) to transfer files.
NSD: where serivce has been created and can scan the other devices which are publishing the same service with in the same network.
WiFi Direct: This is used to scan the near by devices without network
WiFi P2P Network Serice Discovery: This is used scan the service near by devices where other devices provide the same service (NSD+WiFi Direct)
As per requirement, I need to give compatibilty to iOS device even though both are not in same network. I came to know that NSD is similar to Bonjour service by iOS.But this can be possible when devices are in the same network.
Is there any way to get connect to iPhone when both are not in same not network?
Ignoring the intricacies of getting Android and iOS to play nice together, it is possible to make them think they are in the same network without physically being there. If I understand you correctly, seems like you have two options:
Setup up a VPN server in network A and the device in network B connect to it. This would make the device in network B think it was on network A, and have access to all LAN services (such as NSD).
Set up VLAN trunking on a switch and put network A in the same network as B.
Option 2 would only work if they were geographically in the same area (like on the same campus). Option 1 would be preferable if they were geographically disparate, or you were unable or unwilling to make the infrastructure changes necessary to support option 2.
I want to work with Wifi connection via Android Devices (for example I want to send a command with my device to home router via Internet and my router send this command to a wifi module) when I refer to Developer Android APIs, I see a section that named "Wi-Fi Peer-to-Peer". what differences exist between wifi (working android devices with access point like home router) and "Wi-Fi Peer-to-Peer". Is "Wi-Fi Peer-to-Peer" same wifi Direct ? why Google didnt discusses about simple wifi ? please help.
WiFi P2P (Peer-to-Peer) and WiFi Direct are both the same thing.
There are two main differences between "normal" WiFi and WiFi P2P (from the developer's point of view):
A WiFi p2p connection (something you establish from code) is a direct connection between two devices. You can understand it as a sort of temporary (created for the time of the connection) "normal" WiFi network created for the purpose of communicating those two devices. A "normal" WiFi connection basically translates to a situation when a device is connected to a broadcasted (by some device - e.g. home access point, or a smartphone) WiFi network. This all basically means that to send data between two devices using WiFi P2P, those devices DO NOT have to be connected to the same WiFi network (as long as those devices know how to connect to each other using wifi p2p). Unfortunatelly good news with WiFi P2P end right here, because:
Designing a WiFi P2P connection based system is extremely difficult if you want to make it at least reasonably robust. This is mostly due to the lack of documentation on that subject (in Android Dev), and due to Android's WiFi p2p unpredictability (I know what I'm talking about - I was recently desigining such system).
You're wrong saying that Google didn't discuss "simple" WiFi. You just need to remember that connecting to "simple" WiFi is just not that complicated, so they didnt have to do a guide like they did for WiFi P2P. All information considering "normal" WiFi are there (at Android Developer), its just spread over many classes.
Tell me what you think is not discussed?
Also you should try to describe the exact thing your application needs to do (with WiFi), so I can maybe give you a hint whether you should try your luck with WiFi P2P or not.
I know there are methods to add and connect to a wifi network
How do I connect to a specific Wi-Fi network in Android programmatically?
But what I need is to connect to a network that is already been saved by the user in the device,
Basically I want to connect to the best available network (which user has been connected to earlier) around. I can manage to find the nearby wifi signals and get their strength then I want to connect to the best one.
Also there are couple of inactive threads in SO asking the same question, unfortunately none of them has any answers:
https://stackoverflow.com/questions/24257680/connect-to-a-configured-wifi-network
https://stackoverflow.com/questions/20476702/android-how-do-you-choose-which-previously-saved-wifi-to-connect-to-and-do-it
How to connect to pre-configured Wifi in Android?
I want to make my android connects two networks at the same time, the first one a wifi network to get internet connection and the other one ad-hoc network ( a network between mobiles to share some data), but the android can join only one network at the same time, Any ideas!!
It seems to be possible now.
Check this out:
http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html
What you are asking for can not currently be done. You can only be connected to one network at the time. However, there is a standard called WiFi direct that will allow you to do what you are asking for, but it isn't yet implemented in Android. I recently talked with an Android engineer at Google about this, and they are working on it, so it appears you will be able to what you are asking for in the near future, but not right now.
PC:
This CAN be done with microsoft's virtual wifi switcher.
You can connect to two our more wireless networks at once.
PC/Android/iPod/iPhone - Double/Triple connection:
You can connect your pc to your android phone or iPod Touch/iPhone(Jailbroken) with wifi teathering for android and usb teathering for both android an iPodTouch/iPhone.
Android/iPhone:
•Connect to cellular network and WiFi.
Virtual WiFi
research.microsoft.com/en-us/downloads/994abd5f-53d1-4dba-a9d8-8ba1dcccead7/
Create Two Threads. Use these threads to do the network connection. Threads can run simultaneously. So network connection also will process simultaneously. If you need to provide more priority for one connection set the thread priority high for that thread. Also set less thread priority for another thread.
I have one local device connection and one server connection. Initially both done in AsyncTask(If server connection is going on then i can't connect local device). But i need more preference for local device and also need to do both the communication simultaneously. so i tried this. It was working fine to me.