of your app performance. •CDN — Global network of edge locations to deliver a cached copy of your APIs content •DNS — Every domain request made on the internet essentially queries DNS cache servers in order to resolve the IP address
{ @PrimaryKey var idProduct: String, var imageUrl: String } data class AllProductsWithPictures { var idProduct: String, var name: String, @Relation(parentColumn = "idProduct", entityColumn = "imageUrl") var pictures: List<PictureProduct> }
Synchronous @Insert suspend fun insertUser(user: UserEntity) - > Suspended •Can be used in anything @Query("SELECT P.id, P.name, P.price FROM Product P WHERE P.active = 1”) suspend fun getAllProduct(): List<ProductEntity> @Transaction suspend fun insertAndDelete( newProduct: ProductEntity, oldProduct: ProductEntity ) { insert(newProduct) delete(oldProduct) }
so we use a suspend function @Insert fun insertProduct(product: ProductEntity) - > Synchronous @Insert suspend fun insertProduct(product: ProductEntity) - > Suspended
P WHERE P.active = 1”) suspend fun getAllProduct(): List<ProductEntity> •Normal suspend function •Flow suspend function @Query("SELECT P.id, P.name, P.price FROM Product P WHERE P.active = 1”) suspend fun getAllProduct(): Flow<List<ProductEntity > >
block: suspend FlowCollector<T>.() - > Unit ) : AbstractFlow<T>() { override suspend fun collectSafely(collector: FlowCollector<T>) { collector.block() } } •What is inside of a SafeFlow?
: Flow<T>, CancellableFlow<T> { @InternalCoroutinesApi public final override suspend fun collect(collector: FlowCollector<T>) { val safeCollector = SafeCollector(collector, coroutineContext) try { collectSafely(safeCollector) } finally { safeCollector.releaseIntercepted() } } public abstract suspend fun collectSafely(collector: FlowCollector<T>) } •What is inside of a AbstractFlow?
val secureEncryption = EncryptedSharedPreferences.create( This, SECURE_SHARED_PREFERENCES, masterKeyAvailable, EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM ) •How do you do it?