Places Android KTX مجموعه ای از افزونه های Kotlin برای Places SDK برای اندروید است. این برنامههای افزودنی ویژگیهای زبان Kotlin را ارائه میکنند که به شما امکان میدهد هنگام توسعه برای Places SDK برای Android، Kotlin مختصر و اصطلاحی بنویسید. Places KTX منبع باز است و همراه با مثال در GitHub در دسترس است.
KTX را برای Places SDK نصب کنید
برای نصب KTX برای Places SDK برای Android، وابستگی های زیر را به فایل build.gradle.kts سطح برنامه خود اضافه کنید.
dependencies{// KTX for the Places SDK for Android libraryimplementation("com.google.maps.android:places-ktx:3.3.1")}
نمونه برنامه را امتحان کنید
مخزن GitHub برای این کتابخانه همچنین حاوی یک برنامه آزمایشی است که نشان می دهد چگونه می توانید از کتابخانه Places KTX در برنامه خود استفاده کنید.
برای امتحان برنامه آزمایشی، مراحل زیر را دنبال کنید:
تاریخ آخرین بهروزرسانی 2025-02-28 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-02-28 بهوقت ساعت هماهنگ جهانی."],[[["Places Android KTX offers Kotlin extensions for streamlined Places SDK interaction using idiomatic Kotlin."],["Native Kotlin APIs within the Places SDK for Android (version 4.0.0 and later) can be used as an alternative to Places Android KTX extensions."],["Developers can easily integrate Places KTX by adding the specified dependency to their app's `build.gradle.kts` file."],["A demo application within the GitHub repository provides practical examples of utilizing the Places KTX library."]]],["Places KTX provides Kotlin extensions for the Places SDK for Android, enabling concise Kotlin development. Install it by adding the `com.google.maps.android:places-ktx:3.3.1` dependency to your app's `build.gradle.kts` file. A demo app is available on GitHub; to run it, clone the repository, obtain a Places API key, and store it in a `secrets.properties` file in the root directory. Select and Run the **app-places-ktx** module in Android Studio. The Places SDK also offers native Kotlin APIs as of version 4.0.0.\n"]]