# WiFi Setup

**URL:** https://forum.magicleap.cloud/t/wifi-setup/5104
**Category:** General
**Tags:** settings
**Created:** [January 28, 2025, 9:30pm UTC](https://forum.magicleap.cloud/t/wifi-setup/5104 "2025-01-28T21:30:18Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jakob.greuel](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@jakob.greuel](https://forum.magicleap.cloud/u/jakob.greuel)
#### Post date: [January 29, 2025, 1:05pm UTC](https://forum.magicleap.cloud/t/wifi-setup/5104/2 "2025-01-29T13:05:39Z")

</div>

I sadly don't have a solution for you, but here is what i tried already:  
You can add the Wifi using WifiNetworkSuggestion, but there is [no notification for the user](https://forum.magicleap.cloud/t/issues-with-wifi-suggestion-android-api/2213) to confirm the connection so it has no real effect.

You can connect to the wifi by creating a NetworkRequest, which works in that the user gets a popup and the ML2 connects while the app is open, however i had no sucess in sending/recieving anything on the network/internet.

> **Code For NetworkRequest**
>
> ```auto
> private static ConnectivityManager connectivityManager = null;
> ...
> {
> connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
> NetworkRequest.Builder builder = new NetworkRequest.Builder();
> builder.addTransportType(NetworkCapabilities.TRANSPORT_WIFI);
> WifiNetworkSpecifier wifiNetworkSpecifier = getWifiNetworkSpecifier(ssid, password);
> builder.setNetworkSpecifier(wifiNetworkSpecifier);
> NetworkRequest networkRequest = builder.build();
> 
> RegisterCallback();
> 
> connectivityManager.requestNetwork(networkRequest, callback);
> }
> 
> ```
> 
> ```auto
> private static void RegisterCallback() {
> callback = new ConnectivityManager.NetworkCallback() {
> @Override
> public void onAvailable(Network network) {
> super.onAvailable(network);
> connectivityManager.bindProcessToNetwork(network);
> Log.d("NetworkManager", "WiFi connected");
> }
> 
> @Override
> public void onUnavailable() {
> super.onUnavailable();
> Log.d("NetworkManager", "Wifi not Available: ");
> connectivityManager.bindProcessToNetwork(null);
> }
> };
> }
> 
> ```

---

_[View the full topic](https://forum.magicleap.cloud/t/wifi-setup/5104)._
