Android Tutorial Android Wifi-Direct Tutorial

elck

Member
Licensed User
Longtime User
Yes, and Yes (playmemories mobile), Erel
Of course I would like to make my own app, though!
 

blooddiamond

Member
Licensed User
Longtime User
hello,
Im trying to connect between android 4,2 and android 4,1 JB.. I have wifi on and trying to discover but still "no peered devices". What I'm doing wrong ?
 

blooddiamond

Member
Licensed User
Longtime User
Unfortunately no.. What reasons can it be ??

I downloaded program to both phones and turned on wifi.. Should i do something else ??
 

Adrian Jansen

Member
Licensed User
Longtime User
Airdrop?

Do you think we can do something like Apple Airdrop with this?

Cheers,

You could of course just use an app like DropBox or GoogleDrive to transfer files. Just install the same app on both devices, then drop a file into one, and it will appear on the other ( via the Cloud, of course ).
 

bluedude

Well-Known Member
Licensed User
Longtime User
You could of course just use an app like DropBox or GoogleDrive to transfer files. Just install the same app on both devices, then drop a file into one, and it will appear on the other ( via the Cloud, of course ).

Sure we can but not what I wanted
 

Nenad Trickovic

Member
Licensed User
Longtime User
How can I check if device supports Direct WiFi in the code, and if this is the case, enable Direct WiFi without user intervention?
 

walterf25

Expert
Licensed User
Longtime User
Hi Erel, i have an LG Smart TV which supports wifidirect, i would like to make my own app to transfer files and maybe even movies through my galaxy s4, i have an app now from lg but is not too reliable as the connection drops everytime i'm trying to stream a movie from the phone, i downloaded your example and indeed the app discovers my lg smart tv i can see the model number by inserting a log line on this sub
B4X:
Sub Manager_PeersDiscovered (Success As Boolean, Devices As List)
    Log("peers: " & Success)
    If Success Then
        discoveredDevices = Devices
        Log(discoveredDevices.Get(0))    'I inserted this line to look at the paired device details
        lblDevicesText = Devices.Size
    Else
        lblDevicesText = "0"
    End If
    UpdateUI
End Sub

as i mentioned i can see the details of the tv which are this

however when i click on the connect button it doesn't connect.
I can't really see any errors in the filtered or unfiltered logs that are related to this issue.
Do you have any idea as to whether this can even be done, I mean there are apps out there that are used to stream movies from the mobiles to smart TVs.

Any thoughts?

Thanks,
Walter
 

LucaMs

Expert
Licensed User
Longtime User
Erel, in the first post, you wrote:

It is recommended to use Android 4.1+ devices as there are several major known issues with Android 4.04 devices and Wifi Direct.

I think you mean that the problems are in the OS, not in the B4A library, right?

My phone has S.O. 4.0.4. I created a small app (Eclipse) following an example on developer.android.com site and it worked fine (simple file sharing)

You are referring to some specific problem?
 

LucaMs

Expert
Licensed User
Longtime User
Is the ConnectionChanged event raised after you call Connect?


Ehm... i found now the project.. it is dated March 3 2013, my first steps in this "world".

Thanks to B4A, I have abandoned Eclipse

When I opened it, it was "supposed" to update itself.

Now I have a compile error and I do not know if I'll lose my head to make things alright. I prefer to use B4A

P.S. compile error? uhm i dubt.

Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'WiFiDirectDemo'.
java.lang.NullPointerException

I do not even mean to, but it seems to me that the resource compiler does not work, that is something in the environment

Bye bye Eclipse
 
Last edited:

walterf25

Expert
Licensed User
Longtime User
Erel regarding my post #33, even though on your example it seems like there's no connection made, i can see on my TV a message comes up that says that it is connected, but the connectionchanged Event is not raised, can you help with this?

Thanks,
Walter
 

walterf25

Expert
Licensed User
Longtime User
There is nothing that can be done if ConnectionChanged event is not raised. It fails on a lower level. Have you checked the unfiltered logs?
Yes i checked both filtered and unfiltered logs, but as i said on my first post i don't see anything related to this issue.
 

anaylor01

Well-Known Member
Licensed User
Longtime User
Quick question. Could this be used to send commands to each other like say making moves on a chess game?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…