Sdílet prostřednictvím


LocationManager.AddTestProvider Method

Definition

Overloads

AddTestProvider(String, ProviderProperties)

Creates a test location provider and adds it to the set of active providers.

AddTestProvider(String, ProviderProperties, ICollection<String>)

Creates a test location provider and adds it to the set of active providers.

AddTestProvider(String, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Power, SensorStatus)

Creates a test location provider and adds it to the set of active providers.

AddTestProvider(String, ProviderProperties)

Creates a test location provider and adds it to the set of active providers.

[Android.Runtime.Register("addTestProvider", "(Ljava/lang/String;Landroid/location/provider/ProviderProperties;)V", "GetAddTestProvider_Ljava_lang_String_Landroid_location_provider_ProviderProperties_Handler", ApiSince=31)]
public virtual void AddTestProvider (string provider, Android.Locations.Provider.ProviderProperties properties);
[<Android.Runtime.Register("addTestProvider", "(Ljava/lang/String;Landroid/location/provider/ProviderProperties;)V", "GetAddTestProvider_Ljava_lang_String_Landroid_location_provider_ProviderProperties_Handler", ApiSince=31)>]
abstract member AddTestProvider : string * Android.Locations.Provider.ProviderProperties -> unit
override this.AddTestProvider : string * Android.Locations.Provider.ProviderProperties -> unit

Parameters

provider
String

the provider name

properties
ProviderProperties
Attributes

Remarks

Creates a test location provider and adds it to the set of active providers. This provider will replace any provider with the same name that exists prior to this call.

Java documentation for android.location.LocationManager.addTestProvider(java.lang.String, android.location.provider.ProviderProperties).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddTestProvider(String, ProviderProperties, ICollection<String>)

Creates a test location provider and adds it to the set of active providers.

[Android.Runtime.Register("addTestProvider", "(Ljava/lang/String;Landroid/location/provider/ProviderProperties;Ljava/util/Set;)V", "GetAddTestProvider_Ljava_lang_String_Landroid_location_provider_ProviderProperties_Ljava_util_Set_Handler", ApiSince=31)]
public virtual void AddTestProvider (string provider, Android.Locations.Provider.ProviderProperties properties, System.Collections.Generic.ICollection<string> extraAttributionTags);
[<Android.Runtime.Register("addTestProvider", "(Ljava/lang/String;Landroid/location/provider/ProviderProperties;Ljava/util/Set;)V", "GetAddTestProvider_Ljava_lang_String_Landroid_location_provider_ProviderProperties_Ljava_util_Set_Handler", ApiSince=31)>]
abstract member AddTestProvider : string * Android.Locations.Provider.ProviderProperties * System.Collections.Generic.ICollection<string> -> unit
override this.AddTestProvider : string * Android.Locations.Provider.ProviderProperties * System.Collections.Generic.ICollection<string> -> unit

Parameters

provider
String

the provider name

properties
ProviderProperties

the provider properties

extraAttributionTags
ICollection<String>

additional attribution tags associated with this provider

Attributes

Remarks

Creates a test location provider and adds it to the set of active providers. This provider will replace any provider with the same name that exists prior to this call.

Java documentation for android.location.LocationManager.addTestProvider(java.lang.String, android.location.provider.ProviderProperties, java.util.Set<java.lang.String>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddTestProvider(String, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Power, SensorStatus)

Creates a test location provider and adds it to the set of active providers.

[Android.Runtime.Register("addTestProvider", "(Ljava/lang/String;ZZZZZZZII)V", "GetAddTestProvider_Ljava_lang_String_ZZZZZZZIIHandler")]
public virtual void AddTestProvider (string provider, bool requiresNetwork, bool requiresSatellite, bool requiresCell, bool hasMonetaryCost, bool supportsAltitude, bool supportsSpeed, bool supportsBearing, Android.Locations.Power powerRequirement, Android.Hardware.SensorStatus accuracy);
[<Android.Runtime.Register("addTestProvider", "(Ljava/lang/String;ZZZZZZZII)V", "GetAddTestProvider_Ljava_lang_String_ZZZZZZZIIHandler")>]
abstract member AddTestProvider : string * bool * bool * bool * bool * bool * bool * bool * Android.Locations.Power * Android.Hardware.SensorStatus -> unit
override this.AddTestProvider : string * bool * bool * bool * bool * bool * bool * bool * Android.Locations.Power * Android.Hardware.SensorStatus -> unit

Parameters

provider
String

the provider name

requiresNetwork
Boolean
requiresSatellite
Boolean
requiresCell
Boolean
hasMonetaryCost
Boolean
supportsAltitude
Boolean
supportsSpeed
Boolean
supportsBearing
Boolean
powerRequirement
Power
accuracy
SensorStatus
Attributes

Exceptions

if OpstrMockLocation is not set to ModeAllowed for your app.

if a provider with the given name already exists

Remarks

Creates a test location provider and adds it to the set of active providers. This provider will replace any provider with the same name that exists prior to this call.

Java documentation for android.location.LocationManager.addTestProvider(java.lang.String, boolean, boolean, boolean, boolean, boolean, boolean, boolean, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to