Code sample

更新时间:
复制 MD 格式

Use the code samples and usage notes to integrate location-based services into your Android or iOS app.

Android code sample

See Get code sample for the code sample and usage notes.

iOS code sample

See Get code sample for the code sample and usage notes.

Get started

  1. Run the program and enter the following location-based service (LBS) interface parameter values:

    • Business scenario ID: The type of the current business. Required. Enter the class name for a native project or a URL for HTML5.

    • Location accuracy: Acceptable accuracy in meters. Enter a positive number, such as 500 for accuracy within 500 meters.

    • Cache time: The duration for which the cache remains valid. Set to 30 seconds or more.

    • Timeout length: The time before location times out, in seconds. The default and minimum value is 2 seconds.

  2. Tap Locate to get the location result.

  3. Tap Reset in the top-right corner to reset the parameters.