All Products
Search
Document Center

Mobile Platform as a Service:Code sample

Last Updated:Jun 28, 2023

Android code sample

See Get code sample to obtain code sample and its usage instructions and attentions.

iOS code sample

See Get code sample to obtain code sample and its usage instructions and attentions.

Get started

  1. Run the program, and input the parameter values of LBS interface:

    • Business scenario ID: The type of the current business, required. We recommend that you pass in class name for native project while URL for HTML5.

    • Location accuracy: In meters. It is suggested to pass in an acceptable positive number, such as 500, which means the accuracy is within 500 meters.

    • Cache time: Time period in which the cache is valid. It is recommended to set the cache time to 30 seconds or more.

    • Timeout length: The time length before locating timeout, in seconds. Both the default value and the minimum value are 2 seconds.

  2. Tap Locate to get the positioning result.

  3. Tap reset on the top-right corner to reset parameters.