Prerequisite and build configuration: I am trying to create my application with an overview of AndroidStudio 2.4 5 by setting the build configuration below for an O perview device for Android, compileSdkVersion 'android-O' buildToolsVersion '25 .0.0 'compileOptions.encoding =' ISO-8859- 1 'minSdkVersion 16 targetSdkVersion' O '// Enable multidex support. multiDexEnabled true
Problem Description: My application uses these legacy ConnectivityManager class methods for devices with an older version of Android. - ConnectivityManager.startUsingNetworkFeature()
- ConnectivityManager.stopUsingNetworkFeature()
-ConnectivityManager.requestRouteToHost()
When I try to create my application with the above api, it gives a compile-time error as follows:
Error: (626, 48) error: cannot find startUsingNetworkFeature (int, String) character method Error: (7393, 27) error: cannot find stopUsingNetworkFeature (int, String) character method Error: (69, 36) error: not unable to find requestRouteToHost character method (int, int)
Ideally, these api should not give a compile-time error for the purpose of the reverse goal. Please let me know how to solve these compile-time errors.
I can’t remove these methods from the code, because they are necessary for devices with the old version of Android (less than the version of Android L)
source
share