Diffrence between two android APIs - android

please someone can explain me what's the different between using android.net.wifi and android.net.wifi.p2p to use a Wireless network in android app developpment, i know that with the second one, we can use a Wifi without access point, but it's working juste with API 14 at least. what about the first ? is this working too without an access point, and does require API 14 at least ?
Thanks in advance.

P2P is the api to connect to devices on an ap without internet connection

Related

Unity3d WIfi direct (P2P) android support

I am trying to figure out how to make game which will work only locally using Wifi Direct without any internet access.
The concept is very simple. It will be some kind of presentation so I need to have one master/host device and other connected devices will be slaves/clients. When I press button on master/host than should be changed only one value (string or int) in all slaves/clients devices.
With support of 20-40 connected devices in same time.
I have Tried:
UNet - it works only if it is connected to some router with use of local IP's but it does not support Wifi direct communication.
I have tried to find some plugins but I cannot decide which to choose or get information about support of Wifi direct.
I tried to find some other solution like Bluetooth but it supports only 4-13 connected devices at same time but I need to he connected around 20-40 devices in same time.
List of plugins I have found:
Forge Networking - https://www.assetstore.unity3d.com/en/#!/content/38344
1.1 I do not know if this supports a feature i required.
WifiDirect Plugin - https://www.assetstore.unity3d.com/en/#!/content/50112
2.1. This plugins have errors and have no support.
What I would like to ask about:
Does 1. plugin support Wifi direct?
Do you think That I should buy 2. plugin and try to fix it and hopefully I can find a problem and it will work?
Do you know some better or "any" solution how to solve this problem?
I am interested in any tips and help how to make it work.
Thank you very much for your help!
Jakub Kučera
After research I have realised a working solution!
Unity Asset Store: https://www.assetstore.unity3d.com/kr/#!/content/53955
Video of usage: Video
Plugin I have tested on a few Android devices and it works for Wifi Direct with no connection to internet.
This plugin supports much more than that for example:
TCP
Client / Server
Complete C# 2.0 native
Stand alone library (DLL)
Multi-Thread
Event Driven
Support [Binary/Json] message data
Log Server & MySQL Sample Code
New Feature
Unreliable UDP
MNF Server based WinFrom without MySql
I hope it helps somebody else!
And I would like to say thanks to author and his support!

Android connecting two devices for bidirectional communication same as like Xender app

I want to understand how xender app works programmatically ?
I want to implement same feature in my app to transfer files and messages without internet connection.
Is their any library which can help me ?
Android 2.3 must be supported to my app.
I research many stack Overflow questions but not helpful.
WiFi p2p, WiFi direct and NsdManager all having limitations to support lower android versions, it not give support to below android 4.0 version.
wifi p2p is what xender uses. But that feature sadly needs android api level 14 or greater. If you want to share files offline anyway on lower api, the only way is to connect the 2 devices on the same local n/w using wifi hotspot or something, once connected you can start the apps and everything should work just like xender.

How to get timing advance value in android?

I am getting MCC,MNC,LAC values in Android apps, and even I made my own application and I am able to obtain these values.
But Timing Advance (TA) is not available in any of the app or I am not finding any way to get TA. I can use NDK, or AT commands or SDK anything, but I want to get TA value.
Can you suggest any pointers. If not Android, I am OK with iPhone, or Windows App also.
Thanks.
Same questions here Get mobile cell tower timing advance on Android 2.3
For LTE technology there is already an access to Timing Advance values: see http://developer.android.com/reference/android/telephony/CellSignalStrengthLte.html#getTimingAdvance()
No SDK access method for GSM and UMTS.
AT commands are modem specific...
For LTE, TA is available through getTimingAdvance (), starting from API 17 (AOS 4.2 - Jelly Bean).

Passing values from an android device to another

Is it possible to pass a value from an android device to another? I mean, without using the Internet. My project will be implemented only on a localhost. The two android devices are only connected through the router. If it is not possible on the local area network how can I do this? Are there other ways? I'll use the Internet or any other options if possible. Links to open source code, if you have any particularly regarding on this topic, would be appreciated too. Thanks!
If your target is Android4.0+ you can use wifi direct as #pgsandstrom stated.
In other cases if you want to make client/server comunication with two android decices you should look at this thread Socket Server/Client with two Android devices and the awser to this question may be usefull to you too How to write an Android SocketServer to listen on wifi.
If you can restrict usage to Android 4.0 or later, then have a look at wi-fi direct. It doesn't use a router thou, so I hope that isn't a restriction. If you need to support older devices, I think you have to go with bluetooth.

Can an (pre 3.0) Android program connect to a bluetooth A2DP device?

Can a program that is written using the gingerbread/froyo/eclair (e.g. 2.1, 2.2, 2.3 -> NOT honeycomb) connect to a A2DP bluetooth sink device?? Or, do I need to have the user go to their settings to do so? Any help or advice would be highly appreciated.
So, after much more research, it seems that it is impossible to programmatically connect to a A2DP device on a pre-3.0 Android device. I am going mark this as the answer but, if someone finds otherwise, please correct me on this as I would really like to do it programmatically.
Can't you use BluetoothA2dp::connectSink()? Create a BluetoothA2dp instance, then call connectSink(BluetoothDevice device) with the device you're trying to connect to.
code:
http://www.google.com/codesearch#uX1GffpyOZk/core/java/android/bluetooth/BluetoothA2dp.java&q=BluetoothA2dp&l=112
It seems like this API is not listed in the Android API reference for BluetoothA2dp though:
http://developer.android.com/reference/android/bluetooth/BluetoothA2dp.html
So, after much more research, I found and verified that it is actually possible to use the hidden API's to connect to a a2dp device via bluetooth. However, it seems that post-honeycomb, that method isn't possible anymore... I will post another question regarding that.

Categories

Resources