Wifi functionality - android

Does anyone knows if the wifi networks for android phones are based on Access Point Names (APN) ? I ask because in my android application I plan to overwrite some fields in all APN's to disable cellular network, but I still want to have available the wifi for the user

AFAIK, WiFi is independent from APN settings, i.e., if you mess with the APN settings WiFi will still work (cf. the APNdroid application).

Related

How to hide SSID on android phone

I am trying to hide SSID on my android phone. Can anyone please how to proceed for it? Is there any Android API available for the same?
Thanks in advance!!!
You can not hide AP SSID (stop SSID broadcasting or beaconing) through Android API!
SSID hiding depends on the kernel/wifi-driver that you have on your phone! Only few drivers (devices) support this feature! Also a few drivers support monitor mode!
Vendor-drivers have closed source :-( which makes it difficult to add these features to them! See bcmon project for example)
Android API allows you to connect to the network with specific SSID (it may be hided) programmatically. You should know network SSID and password (see this link about WifiConfiguration class and hiddenSSID, this link about WifiManager class, and these stackoverflow answers: programmatically create WiFi Configurations, connect to a specific WiFi network).
See this 3rd party App HiddenSSID Enabler for connecting to AP with hided SSID and this example: Connecting your Android tablet to a wireless network with disabled SSID broadcast
When SSID is hidden at wifi, you may not use wifi.
This software enable hidden SSID.
NOTE: This software will change wifi settings,
take responsibility by yourself.
Android App

How to restrict my mobile apps while my device in certain range in Wi-FI. i want to make application like sonic wall or firewall in Android?

I want to give restrict the usage of apps whenever device is in range of my wifi network. and at time my application will start automatically and it should always running within my wifi range, no one can able to disable or close/kill the app only app admin can do this. App will check the wireless networks available in range, and connect to network as soon as it is in range. person will not be able to switch off the wifi or connect to any other network. When device is in range of my wifi, apps will be restricted and only allowed app can be used. suppose we can restrict camera use in my wifi range and camera usage will become unrestricted when device is out of my wifi range. When device is out of my wifi range, person can use their device without any restriction. it is same like sonicwall or firewall can do in internet explorer in windows. we can only use some allowed pages in internet while sonicwall or firewall is on.
What you are looking for is not possible in Android. Apps have very limited permissions and they cannot restrict the behaviour of other apps AT ALL! Here you will get some idea of how to connect to Wifi SSID. But what u ask for is like a device administrator and it is NOT possible.
Not true! It is posable to restrict apps to WIFI only just install the free app Onovo https://play.google.com/store/apps/details?id=com.onavo.android.onavoid

Android Wi-fi AP hotspot - without internet

There are lots of post on SO regarding setting up AP (Hotspot) on android mobile. However, in all these cases, the AP is a conduit to the outside internet world. In my case, I just want a server application running over a mobile setup as an AP. And let all the client android mobiles connect to it, send their data and disconnect if they like. No internet connection is assumed (i.e, no gprs/3g etc).
My observations: If I setup a wifi AP (via settings -> tethering and portable hotspots) when it is also connected to GPRS, then another android phone can successfully connect to this AP and send the data to the application. However, if I disable the GPRS, even though the client shows that it is connected to the AP, it can't seem to send any data. It seems that an external internet connection is a necessity for the AP mode to work.
Is this understanding correct? Or am I setting something wrong?
I know that I am late to the party (more than 3 years late :) but I was searching for a solution to this problem and stumbled upon an easy workaround. I am using a Nexus 4 with Android 5.0.1 and I can easily configure my phone to use it as an Android Wi-fi AP hotspot - without internet. Just go to Settings / Data Usage and disable "Mobile data" option under the Mobile tab. Then enable the WiFi hotspot option as usual.
I was trying to get this working in order to play with a VirtualBox machine from VulnHub.com that asked for a Bridged Connection when I was commuting to work (no Internet, but with my laptop and my mobile phone I was able to make it :)
I think you have used the internet IPs in your code not the local IPs for communications,is'nt it?
I have the same use case and was looking for the same info as you are. I checked that some of the WiFi-only tablets do not even have a HotSpot setting. Even the devices that do have it, if I remove the SIM card, I cannot enable the HotSpot (I get a message asking me to insert a SIM first).
It looks like our use case is not supported by Android. Rather, the HotSpot feature was not designed with our use-case in mind. I mean, why would an end-user want to use an Android phone or tablet in a HotSpot mode if it didn't also provide outside connectivity?

Are any android devices capable of connecting to an AP and another device simultaneously?

Since I don't have an Android 4.0 device I haven't been able to test this myself. Also I wonder if connecting device A (a smartphone) to device B (a wifi direct capable device) using Wifi direct would mean that device A would assume it is provided with internet from device B (tethering?). I am trying to make an application for device A that would communicate with a device B that does NOT provide internet, thus it would be interesting to know if such a scenario would lead to device A losing internet connectivity for the duration of the connection. Is the situation different depending on if device A is connected to internet through an AP or through 3G/4G?
Perhaps using Bluetooth would be a solution, but in my case security is an issue, and it seems to me that Wifi direct provides stronger security (WPA2).
Any info would be helpful!
/S
On Android, Wi-Fi Direct doesn't interfere with your connection to the Internet (Wi-Fi or 3G/4G). A problem may be that once your turn on the Wi-Fi (to enable Wi-Fi Direct, your phone will try to connect to one of the saved available networks and will disable your 3G connection. That is because Android (by default) doesn't support dual connection (via both Wi-Fi and 3G/4G), but there is some applications around that claim that they can provide such functionality.

android which data connection

Should my Android phone automatically select wi-fi if available, if not then go to the next data service etc. If I use
connectivity.setNetworkPreference(ConnectivityManager.TYPE_WIFI);
will that ensure the same result or confine it to using wi-fi only.
Yes. By default android chooses WiFi network and if WiFi network is not available then it switches to mobile carrier network. To implement switch form WiFi to mobile network you can follow my answer over here: How to handle WiFi to Mobile network switch programatically?
If the Device is connected to a WIFI network will Android use that because it has 1. priority.
And you will almost always prefer using WIFI to your network operations. So you dont really have to worry about this.
I could see on my different devices (all HTC I have to say), under Android 2.1 and 2.2: when both 3G and Wifi are both enabled and available, the system switches down the 3G to prefer the Wi-fi.
The documentation says "When active, all data traffic will use this connection by default. " Whichever you set as your network preference, that will be made the default connection. The system default must be Wifi itself.

Categories

Resources