Skip to content

Mehdi Yari Blog Posts

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

Disadvantages of RIB(Router, Interactor, Builder)

In the previous article, I talked about the Advantages of RIB in general. In this article, I will try to describe the disadvantages of RIBs. In the previous article, I talked about the Advantages of RIB in general. In this article, I will try to describe the disadvantages of RIBs. below you can see the list of the RIBs disadvantages BT disadvantages Not much help in the community Overdrawing dependency on some libraries(RxJava, Dagger2) Complicated framework No full support screen orientations Boilerplate code Poor documentation Just support activities as the base component 1. BT Disadvanta 1. BT Disadvantages As you may know, BT has entered the world of android development from the game industry and AI. Uber RIB BT is different from BT used in…

Leave a Comment

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

Fallery – A fully customizable media picker for android

Fallery is a solution for creating custom online/offline galley that is written with kotlin. I’m an Android developer and I have not seen a gallery and media picker with high customizability for android. There are a few libraries that are interesting but that not highly customizable. This is the main reason of creating Fallery. Key features Select media(photo, video) from android media store with custom offline gallery or custom online gallery. Compatible with android API Level 14 to 30. Content Observer. Filter media based on types(Photos, videos, both). Modern user interface with the capability to add new themes and languages.  Select media with a caption.  Taking photos from the camera with the intent.  Showing bucket list in two different UI(grid and linear) which user can…

Leave a Comment

Aspect ratio image view

What is aspect ratio ? Based on Wikipedia: The aspect ratio of an image is the ratio of its width to its height. It is commonly expressed as two numbers separated by a colon, as in 16:9. For an x:y aspect ratio, the image is x units wide and y units high What is problem with aspect ratio in android ? Android is the operating system of smartphones, tablets, TVs and etc with different screen sizes. that mean if you want to show photos or videos in this screens you shuld take care of device size and device aspect ratio.in http://screensiz.es/ you can see devices screen size and aspect ratio with many other properties What is ariv solution for aspect ratio problem ? ariv is…

Leave a Comment