Skip to content

Tag: Android

Meta-Programming with Kotlin for Android

What is programming?; Simply programming means reading some data on input, operating on that data, and giving some output. Metaprogramming is a programming technique in which we can read codes as input, operate on those codes, and provide generated codes or change the running programs’ behavior. Assume we want to manage dependencies between our classes and inject themes in our code-base(dependency injection). Here we must write boilerplate codes to inject our dependencies into our code-base. How can we solve this problem? Do we have tools that generate these boilerplate codes based on metadata? With metaprogramming, we can fix these kinds of problems. All programming languages that developers can use for meta-programming purposes and have meta-features called metalanguage, like Kotlin, C, Java, and Python. Compilers, Assemblers,…

Comments closed

Advantages of RIB(Router, Interactor, Builder)

RIB is the cross-platform architecture framework designed by uber for mobile apps with a large number of engineers and nested states. RIB is short for Router(rouring between RIBS), Interactor(contains business logic), and Builder(instantiate all the RIB’s constituent classes) which are core components of this architecture. RIB is famous for its high SOC and state handling. In this article, I want to talk about the advantages of RIB in general. In the next articles, I explain how RIB implements these advantages and how to use RIB architecture and framework in android. Why uber decided to create RIB ? According to the uber-blog, they had many reasons to create RIBs architecture and framework which you can see them below. Technical dept As the uber mobile code base…

Leave a Comment

Create a custom offline/online gallery with Fallery

Fallery is a solution to create a custom offline/online gallery. But what does this sentence mean? As an Android developer, in many scenarios, we need our app user to select media from the media’s on the mediastore, internet, assets, or cache dir. Fallery offers a solution to this problem. What is fallery solution ? Fallery is a high customizable gallery and media picker for android. fallery has two Interface for providing data AbstractMediaBucketProviderandAbstractBucketContentProvider. You can create two classes and implement these interfaces like this class CustomOnlineBucketProvider : AbstractMediaBucketProvider { override suspend fun getMediaBuckets(bucketType: BucketType): List<MediaBucket> { // get buckets list from any datasource } } class CustomOnlineBucketContentProvider : AbstractBucketContentProvider { override suspend fun getMediasOfBucket( bucketId: Long, bucketType: BucketType ): Flow<List<Media>> { // get bucket content…

Leave a Comment