-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bskjon
committed
Nov 11, 2024
1 parent
067bce3
commit f4c6371
Showing
4 changed files
with
34 additions
and
36 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
app/src/main/java/no/iktdev/demoapplication/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,46 @@ | ||
package no.iktdev.demoapplication | ||
|
||
import android.net.nsd.NsdServiceInfo | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import androidx.appcompat.app.AppCompatActivity | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.Job | ||
import kotlinx.coroutines.launch | ||
import no.iktdev.demoapplication.databinding.ActivityMainBinding | ||
import no.iktdev.networking.mdns.ndsDiscovery | ||
import no.iktdev.networking.mdns.ndsDiscoveryListener | ||
import java.net.InetAddress | ||
|
||
class MainActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
val binding = ActivityMainBinding.inflate(LayoutInflater.from(this)) | ||
setContentView(binding.root) | ||
|
||
val ioScope = CoroutineScope(Job() + Dispatchers.IO) | ||
|
||
ioScope.launch { | ||
val discovery = ndsDiscovery(this@MainActivity, "_streamit._tcp", object: ndsDiscoveryListener { | ||
override fun onResolveFailed(info: NsdServiceInfo, errorCode: Int) { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override fun onResolved(info: NsdServiceInfo) { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override fun onLost(hostAddress: InetAddress, serviceName: String) { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override fun onStartFailed(serviceType: String, errorCode: Int) { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
}) | ||
discovery.startDiscovery() | ||
} | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
library/networking/src/main/java/no/iktdev/networking/mdns/ndsData.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters