Bug 60395 - Alternative for ActivityManager.GetRunningServices(int) in Xamarin after Android 8 upgrade
Summary: Alternative for ActivityManager.GetRunningServices(int) in Xamarin after Andr...
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 8.0 (15.4)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-10-26 15:09 UTC by Saravanan
Modified: 2017-10-26 15:31 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Saravanan 2017-10-26 15:09:27 UTC
After migration to Xamarin.Android to 8.0 from 7.3.0.13 i am facing the error in my code like error CS0618: ActivityManager.GetRunningServices(int) is obsolete: 'deprecated'

And checked as GetRunningServices is only intended for debugging or implementing service management type user interfaces. Thus they have obsolete and not given any alternatives for this method.

In Xamarin.Android is there is any alternative given to this function?


------------#---------------#---------------------

System Info:

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Professional

Visual Basic 2015   00322-50050-56982-AA930
Microsoft Visual Basic 2015

Visual C# 2015   00322-50050-56982-AA930
Microsoft Visual C# 2015

Visual C++ 2015   00322-50050-56982-AA930
Microsoft Visual C++ 2015

Visual F# 2015   00322-50050-56982-AA930
Microsoft Visual F# 2015

Application Insights Tools for Visual Studio Package   7.18.00214.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Chutzpah Context Menu   4.3.5
Enables you to run JavaScript unit tests via Chutzpah from the context menu

Chutzpah Test Adapter for Visual Studio 2012   4.3.4
Chutzpah adapter for the Visual Studio 2012 Unit Test Explorer. Chutzpah is an open source JavaScript test runner which enables you to run JavaScript unit tests from the command line and from inside of Visual Studio.

Clang with Microsoft CodeGen   14.0.25516
Clang with Microsoft CodeGen

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JetBrains ReSharper Ultimate 2016.2    Build 106.0.20160818.163633
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Team Foundation Server 2015 Power Tools   14.0
Power Tools that extend the Team Foundation Server integration with Visual Studio.

Microsoft Visual Studio Process Editor   1.0
Process Editor for Microsoft Visual Studio Team Foundation Server

Mono Debugging for Visual Studio   4.7.4-pre (c2d89eb)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Python Tools for Visual Studio   2.2.40825.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration   2.2.40825.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support   2.2.40825.00
Profiling support for Python projects.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TargetFrameworkMigrator   1.0
Bulk Change .Net Projects Target Frameworks

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Visual C++ for Cross Platform Mobile Development (Android)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (iOS)

Visual Studio Tools for Apache Cordova   Update 10
Visual Studio Tools for Apache Cordova

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   4.7.10.22 (fe36bec)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   8.0.0.33 (7a6a056)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   11.2.0.8 (9a9f054)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Jon Douglas [MSFT] 2017-10-26 15:31:38 UTC
Hi Saravanan,

This is not a bug, but rather a change by Google in their Android 8.0 APIs. Bugzilla is reserved for issues within the Xamarin.Android product and thus I advise you to ask this question on Stack Overflow or the Xamarin Forums. You can read more about where to ask a question here:

https://developer.xamarin.com/guides/cross-platform/troubleshooting/support-options/#Summary_of_Support_Options

You can read about this API change here:

https://developer.android.com/reference/android/app/ActivityManager.html#getRunningServices(int)

Here's associated Stack Overflow questions about this:

https://stackoverflow.com/questions/45715905/android-o-replacement-for-getrunningservices

https://stackoverflow.com/questions/45817813/alternate-of-activitymanager-getrunningservicesint-after-oreo

https://stackoverflow.com/questions/45519439/android-getrunningservicesactivitymanager-deprecated