adroitandroid / near Goto Github PK
View Code? Open in Web Editor NEWA P2P library for Android for discovery on local networks using UDP and transfer in general using TCP sockets
Home Page: https://goo.gl/kioAiQ
License: MIT License
A P2P library for Android for discovery on local networks using UDP and transfer in general using TCP sockets
Home Page: https://goo.gl/kioAiQ
License: MIT License
I ran your example and when I exit the app this error appears:
java.lang.RuntimeException: Unable to start service com.adroitandroid.near.discovery.client.UdpBroadcastService@73c0f23 with null: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter intent
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3449)
at android.app.ActivityThread.-wrap21(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1633)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6316)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter intent
at com.adroitandroid.near.discovery.client.UdpBroadcastService.onStartCommand(UdpBroadcastService.kt)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3432)
at android.app.ActivityThread.-wrap21(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1633)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6316)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
This happens on android 7, on android 10 everything is ok. I need some help. Thanks
I have a lot of devices and I want to group them by service, can you do it?
ex:
makeDiscoverable (String hostName, String serviceName);
makeDiscoverable ("My android device", "printer.tcp");
Look for devices that have the "printer.tcp" service registered instead of searching for them all
startDiscovery ("printer.tcp")
Hello,
I have this error sometimes.
Fatal Exception: java.lang.OutOfMemoryError: pthread_create (stack size 16384 bytes) failed: Try again
at java.lang.VMThread.create(VMThread.java)
at java.lang.Thread.start(Thread.java:1029)
at com.adroitandroid.near.connect.TcpServerService.onNewReceive(TcpServerService.java:131)
at com.adroitandroid.near.connect.TcpServerService.access$300(TcpServerService.java:25)
at com.adroitandroid.near.connect.TcpServerService$1$1.run(TcpServerService.java:81)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
This library is awesome, I was stuck creating a P2P chat with no middle servers and any other softwares, it never worked with sockets, it was a huge problem, also I was using NSD for device discovery, it works really bad. This library save me, the discovery is very fast and the chat was easy to integrate on my app.
I would like to know if it stills on development, the last commit was on July so I'm not sure of what's gonna happen now. I have to add file sharing on my app so I need to know if we will have it on Near.
Hello,
As you marked in your doc, it would be nice to be able to have several instances of NearConnect, it would allow to have a instance of scan and another communication, like that if two clients communicate together, a third can come join them
Thank you
Hello,
I make a long scan (many hours) and the ping is every 5000ms.
Sometimes i have 0 peers connected sometimes 1 and that chnage evry 2-3 times ping.
What are the possibilities that occur ?
Thank's
Hi, is this project still active?
OnPause of my activity I do:
if (nearDiscovery.isDiscovering) {
nearDiscovery.stopDiscovery()
}
if (nearDiscovery.isDiscoverable) {
nearDiscovery.makeNonDiscoverable()
}
if (nearConnect.isReceiving) {
nearConnect.stopReceiving(false)
}
but still it crashes with this error:
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter intent at com.adroitandroid.near.connect.server.TcpServerService.onStartCommand(TcpServerService.kt)
hi thanks for amazing library
i wonder if we can add p2p video call support to it , it will be very good
thanks
I need a pure Java equivalent for Desktop applications
But I'm running into some problems implementing this
(especially implementing the server)
It would be very cool if you took care of it and created a repository for it.
I would of course also help as much as possible if it is difficult in terms of time.
java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/text/Regex;
what is the cause for this error?
Code is below
mNearDiscovery = new NearDiscovery.Builder()
.setContext(this)
.setDiscoverableTimeoutMillis(60000)
.setDiscoveryTimeoutMillis(60000)
.setDiscoverablePingIntervalMillis(1000)
.setDiscoveryListener(getNearDiscoveryListener(), Looper.getMainLooper())
.build();
mNearDiscovery.makeDiscoverable("Abcd","");
Hi there,
Firstly, thank you for the fantastic job you've done with this API! It's made P2P vastly simpler and cleaner for me. I would like to make use of the API for a project I am working on - notably, a game involving up to 5 devices, with one 'host' device and four peer users. The peer users will need to send data to the host, and the host will have to send data out to all peer users.
I have seen the API used effectively in your sample app for two-way communication - for more users, is it as simple as opening up the discovery process again on a designated 'host' device? I.e. can one device maintain active connections with multiple devices and be able to send out messages that are picked up by them all?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.