onnectivityManager#registerNetworkCallback\(android.net.NetworkRequest,%20android.net.ConnectivityManager.NetworkCallback\))
functions to search for a network to connect from the device that satisfies
the ` NetworkRequest ` . The status is then reported to the ` NetworkCallback
` .

###  Kotlin

    
    
    val connectivityManager = getSystemService(ConnectivityManager::class.java) as ConnectivityManager
    connectivityManager.requestNetwork(networkRequest, networkCallback)
    

###  Java

    
    
    ConnectivityManager connectivityManager =
            (ConnectivityManager) getSystemService(ConnectivityManager.class);
    connectivityManager.requestNetwork(networkRequest, networkCallback);
    

Content and code samples on this page are subject to the licenses described in
the [ Content License ](/license) . Java and OpenJDK are trademarks or
registered trademarks of Oracle and/or its affiliates.

Last updated 2024-03-20 UTC.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing
the information I need" },{ "type": "thumb-down", "id":
"tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{
"type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type":
"thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{
"type": "thumb-down", "id": "otherDown", "label":"Other" }]  [{ "type":
"thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type":
"thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type":
"thumb-up", "id": "otherUp", "label":"Other" }]

  * [ ![X](/_static/android/images/logo-x.svg) X ](//x.com/AndroidDev)

Follow @AndroidDev on X

  * [ ![YouTube](//www.gstatic.com/images/icons/material/product/2x/youtube_48dp.png) YouTube ](//www.youtube.com/user/androiddevelopers)

Check out Android Developers on YouTube

  * [ ![LinkedIn](/_static/android/images/logo-linkedin.svg) LinkedIn ](//www.linkedin.com/showcase/androiddev)

Connect with the Android Developers community on LinkedIn

  * ###  More Android 

    * [ Android ](//www.android.com)
    * [ Android for Enterprise ](//www.android.com/enterprise/)
    * [ Security ](//www.android.com/security-center/)
    * [ Source ](//source.android.com)
    * [ News ](/news)
    * [ Blog ](//android-developers.googleblog.com/)
    * [ Podcasts ](/podcasts)
  * ###  Discover 

    * [ Gaming ](/games)
    * [ Machine Learning ](/ml)
    * [ Privacy ](/privacy)
    * [ 5G ](/training/connectivity/5g)
  * ###  Android Devices 

    * [ Large screens ](/large-screens)
    * [ Wear OS ](/wear)
    * [ ChromeOS devices ](/chrome-os)
    * [ Android for cars ](/cars)
    * [ Android TV ](/tv)
  * ###  Releases 

    * [ Android 14 ](/about/versions/14)
    * [ Android 13 ](/about/versions/13)
    * [ Android 12 ](/about/versions/12)
    * [ Android 11 ](/about/versions/11)
    * [ Android 10 ](/about/versions/10)
    * [ Pie ](/about/versions/pie)
    * [ Oreo ](/about/versions/oreo)
    * [ Nougat ](/about/versions/nougat)
  * ###  Documentation and Downloads 

    * [ Android Studio guide ](/studio/intro)
    * [ Developers guides ](/guide)
    * [ API reference ](/reference)
    * [ Download Studio ](/studio)
    * [ Android NDK ](/ndk)
  * ###  Support 

    * [ Report platform bug ](//issuetracker.google.com/issues/new?component=190923&template=841312)
    * [ Report documentation bug ](//issuetracker.google.com/issues/new?component=192697)
    * [ Google Play support ](//support.google.com/googleplay/android-developer)
    * [ Join research studies ](https://g.co/userresearch/androiddeveloperfooter)

[ ![Google Developers](https://www.gstatic.com/devrel-
devsite/prod/vdd667e8703bf3eb3250e728f4f199ed0baf72dd7a2c58290f8fa685e2652be47/android/images/lockup-
google-for-developers.svg) ](https://developers.google.com/)

  * [ Android ](//developer.android.com)
  * [ Chrome ](//developer.chrome.com/home)
  * [ Firebase ](//firebase.google.com)
  * [ Google Cloud Platform