Android Bluetooth Api support for Pan profile? - android

I am trying to establish tcp/ip connection over bluetooth,currently android bluetooth api provides support only for headset,a2dp and health device profiles,but I need PAN profile on manually assigned Ip address,I am not sure but I read somewhere even if you connect your phone to laptop using pan profile the ip address is automatically assigned,and you need to root your phone to manually assign them.Is it possible?
Is it possible to do easily over other platforms like ios or windows phone?

You can use Pan profile in Android, however It is not officially supported. Take a look at the Android Internal API.

Related

Possible to route network traffic to a different gateway programmatically?

I have an Android tablet with a USB to ethernet adapter. The network interface is configured and the default gateway works and allow internet access.
To fix an issue we are having I would like to change the default gateway to something that is incorrect which will cause the tablet to not be able to access the internet.
Then in our Xamarin application I would like to route the internet traffic through the USB to ethernet NIC like normal but I want to programmatically specify the correct gateway somehow without changing the gateway on the NIC. I can also remove the gateway altogether if that would do the same thing and block traffic. But in that case do I have to do anything special in the traffic to send the traffic to the 192.168.1.1 gateway?
Is this technically possible at all in Xamarin or Java/Android? I am also open to somehow configuring Android itself so that only our application has a valid routing table but I am not sure how to do that.
Thanks ahead of time!
I have not tried anything yet to fix this I'm just brainstorming issues.
The document is about WiFiManager. There is a method. But this method was deprecated in API level 29.
At present, the successful changes are all in Android 6.0 and earlier.
Here are two links you can refer to them:
How to configure a static IP address, netmask, gateway programmatically on Android 3.x or 4.x
Set static IP and gateway programmatically in Android 6.x (Marshmallow).

Is it possible to a establish a TCP/IP connection over bluetooth?

Well, the following situation: Devices need to communicate offline. The only option is Bluetooth. Here, the issue is that Bluetooth's encryption is insecure and broken. See KNOB attack.
Therefore, I'm looking for a way to securely exchange data between two bluetooth devices (e.g.,Android and iOS). My current guess is to establish a TCP/IP connection to make use of typical SSL/TLS libraries with all its other advantages (certificate check etc.) and disable bluetooth's encryption for performance increase.
https://developer.android.com/reference/android/bluetooth/BluetoothSocket
Unfortunately, it appears that this idea is already not supported by Android. They do offer some sort of BluetoothSocket, but that is not a TCP/IP connection afaik. Does anyone know a way to enable a TCP/IP connection between two bluetooth devices? Any other idea to secure that broken bluetooth connection?
Answer is yes. Nevertheless, there is no usable API on Android (before Android 9 via reflections maybe) and it still has the hide annotation on Android 11 in its source code, besides the requirement of a special permission to be used by system apps only.
The only option is to enable Bluetooth tethering via system settings (if available). Next devices connecting over Bluetooth will get an IP address, while the smartphone acts as the router. The access of services on the smartphone is permitted.

How to setup a network connection between an android phone and the web browser on pc using a wifi network?

Is it possible to connect my Android phone (Redmi Note 7) directly to my Windows (10) PC in such a way that I can make network connections to the PC from the phone, with/without a per-existing WiFi network?
My specific issue is that I want to be able to connect the camera of my android phone with the web browser using a specific IP address. This IP address when typed on the browser would open a screen that would help us to connect with the android device, basically feeding in everything what the android device camera sees.
I've already done my work on the camera2API interface work, I just need some help with the network connection part.
Ideally I'd like a solution that doesn't involve the Internet at all - neither from the PC nor the phone. In my particular situation, it would also be ideal if this can be done over a WiFi network connected via a single IP(same for phone and to be typed on the browser) would suffice.
I really need help with developing an android app that would help me to setup the connection between the android phone and PC using the TCP/IP protocol. There is already an app for serving such a purpose whose link I am providing below, but I have to add some security and login features on the existing app. All i am asking is how would I set up such a connection in the first place and proceed forward with the app.Also, Bluetooth provides a very less upload speed, and about the USB, i am trying to make the total process wireless. the link to the existing app: ip-webcam.appspot.com
Well, I am working at a similar app, and I use a modified web server for configuration and delivering images (I am doing it on the native side though, but I am sure there are plenty of Java web servers out there).

(Unity) Network manager not working on android device

I added GameObject. To this object I added two components. (Network Manager and Network Manager Hud). Created cube and added Network Identity(Local Pl.Au). In Player Prefab added cube and deleted from scene. Finally I build&Run on windows. And it works well on windows. when I connect my real Android phone it installed successfully but when I tried press Lan Host or Lan Client it is not responding.The phone is connected to the laptop using a USB cable. What am I missing?
LAN Host or LAN Client will work on your PC, because your PC knows what a LAN is.
Your android device, on the other hand, does not.
To match your android device with another device or your PC, you will have to use a match making service.
To develop and try your app, you can use Unity's match making Service, which can be used in a limited fashion with a Unity Personal license.
When using the NetworkManagerHUD tool, the "Enable Match Maker" button will take you there.
You will need to do a bit of setup to turn on Matchmaking Service on your unity account and server before you can try.
Go to Window > Services.
Perform the necessary steps to create or use your current organization and project, and enable Multiplayer.
You can use LAN on Andriod, you just have to enter the IP address of the Host device into the box where it says "localhost". To be clear, replace "localhost" with IP address of host device( can be andriod or PC)

Connect android 4.0.3 phone to Wifly

How do you connect an Android 4.0.3 phone to a Wifly module using level 14 API function wifi direct? I configured Wifly to work in adhoc mode, and wrote the Android app as shown in the Android.developer guide but I can not find the peer.
Since Android 4.0, it is possible to connect an Android phone to a Wifly module in adhoc mode, without rooting, with the following technique:
With a helper app (available on Google Play or develop your own), create an Access Point on the phone and inspect the SSID, passphrase and IP address.
Configure the Wifly module with this info.
In your working app, communicate with the Wifly module through standard socket programming.
These 3 steps are described in the following posts:
http://sailboatinstruments.blogspot.ca/2012/10/talking-to-android-phone-through-wi-fi.html
http://sailboatinstruments.blogspot.ca/2012/11/gps-data-from-wifly-to-android-phone.html
http://sailboatinstruments.blogspot.ca/2012/11/gps-data-from-wifly-to-android-phone_28.html
The current limitation is that the SSID and passphrase are given non-editable random names, so that you have to reconfigure the Wifly when you create a new AP (but note the AP will live on the phone as long as Wifi is enabled, unless you remove it with the helper app). Let's hope that a future Android release will remove this limitation by allowing to keep a permanent SSID and passprase.
UPDATE: With Android 4.2.1, the above limitation seems to have disappeared! The SSID and passphrase remain the same when the access point is removed and recreated.
Its not possible to work with AdHoc mode devices via Android (in iOS you can) in normal ways.
Please read here: http://www.xda-developers.com/android/android-ad-hoc-wireless-network-support/
This link shows a way to work with AdHoc.
Auto-connect: https://dl.dropboxusercontent.com/u/101922388/WiflySanUSB.zip .When only the green LED of the WiFly modem is blinking, the circuit and the program has been successfully implemented.

Categories

Resources