Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Due to business adjustments, we will no longer support new developer registrations for Nearby Service starting from September 10, 2024. Existing developers who have already activated Nearby Service can continue to use it. We will notify you separately if there are any changes. Thank you for your support!
The Android Studio sample code implements the function of quickly transferring files by scanning the QR code.
Sample Code | Find It on Gitee | Find It on GitHub |
|---|---|---|
Nearby file sharing |
The Android Studio sample code implements the beacon message subscription function.
Sample Code | Find It on Gitee | Find It on GitHub |
|---|---|---|
Beacon message subscription |
Sign in to AppGallery Connect, download the agconnect-services.json file of your app, and copy the file to the app directory of the sample project.
Open the build.gradle file in the sample project, and change the value of applicationId to your app package name.
- <uses-permission android:name="android.permission.BLUETOOTH"
- android:maxSdkVersion="30" />
- <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"
- android:maxSdkVersion="30" />
- <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
- <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
- <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
BLUETOOTH_SCAN, BLUETOOTH_ADVERTISE, and BLUETOOTH_CONNECT are runtime permissions. Therefore, you need to explicitly request users to grant the permissions in your app.