Path parameter | Query parameter | |
---|---|---|
Used for | required arguments | optional arguments collections (arrays and lists) |
Example fields | val id: String val code: Int? |
val color: String? = null val variants: List<String> = emptyList() |
Generated URL format | /{id}/{code} |
?color={color}&variants={variant1}&variants={variant2} |
Example URL | product/ABC/123 |
product?color=red&variants=small&variants=medium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qtconnectivity$ git diff | |
diff --git a/src/bluetooth/qbluetoothserver_android.cpp b/src/bluetooth/qbluetoothserver_android.cpp | |
index ff100d3..a2d0875 100644 | |
--- a/src/bluetooth/qbluetoothserver_android.cpp | |
+++ b/src/bluetooth/qbluetoothserver_android.cpp | |
@@ -145,7 +145,7 @@ bool QBluetoothServer::listen(const QBluetoothAddress &localAdapter, quint16 por | |
} | |
if (!found) { | |
- qWarning(QT_BT_ANDROID) << localAdapter.toString() << "is not a valid local Bt adapter"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compression format | Decode time (seconds) NDKMediaCodec | Decode time (seconds) FFmpeg | |
---|---|---|---|
MP3 | 16.7 | 1.2 | |
AAC (with M4A container) | 18.8 | 0.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$ANDROID_NDK" ]; then | |
echo "Please set ANDROID_NDK to the Android NDK folder" | |
exit 1 | |
fi | |
#Change to your local machine's architecture | |
HOST_OS_ARCH=darwin-x86_64 | |
function configure_ffmpeg { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script which copies libraries from the FFmpeg build folder to a | |
# folder within an Android Studio project in the correct structure | |
# Should be run from the FFmpeg root folder. | |
# Check that a target directory has been supplied | |
if [ -z "$1" ] | |
then | |
echo "Usage: copy_to_project.sh <target directory>. Example: copy_to_project.sh \${ANDROID_PROJECT}/app/libs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OptimalVideoSettings(context: Context){ | |
private val devicePerf: DevicePerformance = DevicePerformance.create(context) | |
val encodeHeight by lazy { | |
when (devicePerf.mediaPerformanceClass) { | |
Build.VERSION_CODES.S -> 1080 // On performance class 12 use 1080p | |
Build.VERSION_CODES.R -> 720 // On performance class 11 use 720p | |
else -> 480 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyApplication : Application() { | |
private lateinit var devicePerf: DevicePerformance | |
private lateinit var firebaseAnalytics: FirebaseAnalytics | |
override fun onCreate() { | |
devicePerf = DevicePerformance.create(this) | |
firebaseAnalytics = Firebase.analytics | |
firebaseAnalytics.setUserProperty( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2022 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
class BookmarksViewModel @Inject constructor( | |
newsRepository: NewsRepository, | |
private val userDataRepository: UserDataRepository | |
) : ViewModel() { | |
// #1. Obtain a list of bookmarks. | |
private val bookmarks: StateFlow<Set<String>> = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2022 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
class GetSaveableNewsResourcesUseCase @Inject constructor( | |
private val newsRepository: NewsRepository, | |
userDataRepository: UserDataRepository | |
) { | |
private val bookmarks = userDataRepository.userDataStream.map { userData -> | |
userData.bookmarkedNewsResources | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2022 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
class BookmarksViewModel @Inject constructor( | |
getSaveableNewsResources: GetSaveableNewsResourcesUseCase | |
) : ViewModel() { | |
val feedState: StateFlow<NewsFeedUiState> = getSaveableNewsResources() | |
.map { newsResources -> | |
newsResources.filter(SaveableNewsResource::isSaved) |