android-wireless

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

倖福魔咒の 提交于 2019-12-05 17:19:07
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? 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. mpontillo What you are looking for is ad-hoc wireless networking , which is not well supported on the Android platform. (but some people have bravely rooted their phones and

Android stops finding BLE devices: onClientRegistered() - status=133 clientIf=0

旧街凉风 提交于 2019-12-05 15:52:52
问题 I am developing an app in which I can both find and configure BLE devices. I am using standard Android BLE API, but recently I've encountered some strange problems. When I turn on my app the BLE scan works OK. I am scanning using: mBluetoothAdapter.startLeScan(mLeScanCallback); // for Kitkat and below and mBluetoothAdapter.getBluetoothLeScanner().startScan(mScanCallback); // for Lollipop and above In the Logcat I am getting following messages (I guess this is important for this issue): D

ConnectivityManager getActiveNetworkInfo() is always null even with data traffic active

喜你入骨 提交于 2019-12-05 03:33:06
i'm working on a android project and i had the need to check for internet connection. i searched the web and i found a solution here on stackoverflow. However, i'm having problems on checking the internet state. I already searched everywhere but i can't find any solution for my problem. Here is the manifest: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> Here is the code for checking if internet is connected: cm =

compile and build “iw” for android 4.1 device?

佐手、 提交于 2019-12-05 00:00:44
问题 i need to install iw wireless packages on android 4.1 device. but i don't know how and what is the require version of the packages to install !! also is it need linux platform to do this or it is enough to build and install on adb shell for android rooting device. i see this link but when i do it from adb terminal i see that git and some shells not found ??? how to do it ? it seems no one has any idea ?? 回答1: While building iw version 3.11 (which has an Android.mk file already), I encountered

How to connect to a wireless network in android?

こ雲淡風輕ζ 提交于 2019-12-04 14:13:23
I have managed to scan for wireless networks and obtain scan results in my application. but is there a way i could possibly connect to them using my app itself? I was wondering whether I would have to specify the encryption type for the network i'm trying to connect? and my requirement would be to connect to any wireless network irrespective of it's encryption type? Any ideas? Thanks TO connect to WiFi AP needed to implement followed steps: Scan WiFi To be sure that you have appropriate AP. Bear in mind that you must provide password to secured AP. Suppose you know witch AP you prefer and now

Android stops finding BLE devices: onClientRegistered() - status=133 clientIf=0

a 夏天 提交于 2019-12-04 01:37:43
I am developing an app in which I can both find and configure BLE devices. I am using standard Android BLE API, but recently I've encountered some strange problems. When I turn on my app the BLE scan works OK. I am scanning using: mBluetoothAdapter.startLeScan(mLeScanCallback); // for Kitkat and below and mBluetoothAdapter.getBluetoothLeScanner().startScan(mScanCallback); // for Lollipop and above In the Logcat I am getting following messages (I guess this is important for this issue): D/BluetoothAdapter: onClientRegistered() - status=0 clientIf=5 In my app I can also read certain

“no route to host” on device on getOutputStream() - connected wirelessly

孤街浪徒 提交于 2019-12-02 14:56:43
问题 private String urlPost = "http://192.168.1.66:8080/DataCollectionServlet/"; @Override protected void doWakefulWork(Intent intent) { // https://stackoverflow.com/q/14630255/281545 HttpURLConnection connection = null; try { connection = connection(); w("connection"); // allrigt final OutputStream connOutStream = connection.getOutputStream(); w("GEToUTPUTsTREAM"); // I never see this } catch (IOException e) { e.printStackTrace(); // No route to host } finally { if (connection != null) connection

“no route to host” on device on getOutputStream() - connected wirelessly

♀尐吖头ヾ 提交于 2019-12-02 08:34:55
private String urlPost = "http://192.168.1.66:8080/DataCollectionServlet/"; @Override protected void doWakefulWork(Intent intent) { // https://stackoverflow.com/q/14630255/281545 HttpURLConnection connection = null; try { connection = connection(); w("connection"); // allrigt final OutputStream connOutStream = connection.getOutputStream(); w("GEToUTPUTsTREAM"); // I never see this } catch (IOException e) { e.printStackTrace(); // No route to host } finally { if (connection != null) connection.disconnect(); } } private HttpURLConnection connection() throws MalformedURLException, IOException {

WifiManager.getScanResults() - clarifications (automatic scans, sleep etc)

两盒软妹~` 提交于 2019-11-29 12:45:28
I would like some clarifications on the behavior of WifiManager.getScanResults() , namely : When wireless is enabled Does android scan for access points on a fixed interval ? Can one query/change the interval ? Can one query the time of the last scan ? For a discussion see this answer What happens when the wireless radio is turned off (sleeps) - while wifi is still enabled - will getScanResults() go on returning the last scan results ? How would one know if it's time for startScan() ? When wireless is disabled getScanResults() would return the last scan results ? Or an empty List ? Or null (it

How to get wifi hotspot state

醉酒当歌 提交于 2019-11-29 07:31:35
I am creating wifi hotspot in my phone and I want get its state change event when I switched on or off hotspot. Atul Panda Please look at the following code. This will help you public class WifiApManager { private final WifiManager mWifiManager; public WifiApManager(Context context) { mWifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE); } /*the following method is for getting the wifi hotspot state*/ public WIFI_AP_STATE getWifiApState() { try { Method method = mWifiManager.getClass().getMethod("getWifiApState"); int tmp = ((Integer) method.invoke(mWifiManager)); // Fix