Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the usage of deprecated APIs with newer ones #51

Open
friissoren opened this issue Apr 19, 2022 · 0 comments
Open

Replace the usage of deprecated APIs with newer ones #51

friissoren opened this issue Apr 19, 2022 · 0 comments

Comments

@friissoren
Copy link
Collaborator

When compiling, there are several warnings about using deprecated APIs. Figure out if it is possible to replace their usage with some APIs that are not deprecated.

C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\app\DebugActivity.java:186: warning: [deprecation] getExternalStoragePublicDirectory(String) in Environment has been deprecated
        File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "OpenDroneID");
                                        ^
C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\app\DebugActivity.java:231: warning: [deprecation] setWifiEnabled(boolean) in WifiManager has been deprecated
                    wifiManager.setWifiEnabled(true);
                               ^
C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\app\DebugActivity.java:338: warning: [deprecation] Handler() in Handler has been deprecated
        handler = new Handler();
                  ^
C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\bluetooth\WiFiBeaconScanner.java:84: warning: [deprecation] setWifiEnabled(boolean) in WifiManager has been deprecated
            wifiManager.setWifiEnabled(true);
                       ^
C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\bluetooth\WiFiBeaconScanner.java:182: warning: [deprecation] startScan() in WifiManager has been deprecated
        boolean ret = wifiManager.startScan();
                                 ^
C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\app\DeviceList.java:233: warning: [deprecation] setColorFilter(int,Mode) in Drawable has been deprecated
                    droneIcon.setColorFilter(0xff00ff00, PorterDuff.Mode.MULTIPLY);
                             ^
C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\app\HelpMenu.java:33: warning: [deprecation] fromHtml(String) in Html has been deprecated
        helpView.setText(Html.fromHtml(linkText));
                             ^
C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\app\HelpMenu.java:43: warning: [deprecation] fromHtml(String) in Html has been deprecated
        helpView.setText(Html.fromHtml(linkText));
                             ^
C:\Android\receiver-android\Android\app\src\main\java\org\opendroneid\android\app\HelpMenu.java:50: warning: [deprecation] fromHtml(String) in Html has been deprecated
        helpView.setText(Html.fromHtml(linkText));
                             ^
9 warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant