DON'T Use Base URLs Like THIS In Android

preview_player
Показать описание
Follow for more Android & Kotlin tips 🙌
Рекомендации по теме
Комментарии
Автор

I've been using this for a couple of years and It's convenient when you have multiple environments like staging, uat, and production with other API keys. You only need to switch the Build type and the base url, which will reflect the entire project.

allwin_
Автор

PHENOMENAL!!!!
It makes a lot of sense. I wouldn't want to clutter my code with things that depend on build variants. Thanks for the tip

ryugalaw
Автор

Fun fact: There is a concept called build flavours, with this you can have one codebase and multiple build variants for different vendors, you can change everything and not just base urls and strings, you can totally change all the primary colors, images and much more specific to the variants.
I once had a bill generator application, which later sold it to multiple small scale businesses using the flavours, any future modification can affect all the variants and each variant has their own logs, texts, colors etc..

aboutthat
Автор

You can also store the string in res and have a custom debug/res folder for non prod builds.

robchr
Автор

This way I don't have to worry about the Base URL Thankyou mate it helped me a lot 🙂

amit
Автор

Man I love all your contents, every time a learn something new. Thanks for sharing !

angelomarzocchi
Автор

You can even use flavors to have multiple versions for your app, for example, staging environment and release environment, and you can have two version on same device

alyabdel-shafy
Автор

When someone tries to decompile your application, he won't see anything.

olivierloukombo
Автор

Very nice tip, your videos always teach new things, 😄

hill_rider_HP
Автор

Very helpful, I will change my project's code after exam. Thanks for sharing, phillip.

yuhenteng
Автор

This a very basic thing. But yes, there are still people who does it the wrong way. Thanks for taking time to share this

the_nomadic_ajith
Автор

Finally, a content I'm already aware of haha

giocornejo
Автор

are there any advantages over using debug/res ?

kiekiekiekiekiekie
Автор

Can you please provide a tutorial on mongodb Google auth with direct remote mongo database connection in compose kotlin

royalanimations
Автор

Please make more useful video like this

ElamanAytymbet
Автор

careful with the url for release... do test before shipping 😂

Namesake..
Автор

both types of base url are not so good. because it dont give you flexible for change test base url. usually on big projects you can have more than 1 base url for test servers. in debug and internal builds for testers we should have tools for write your own debug or test base url

eriksobolev
Автор

..but the thing is, my gradle takes like a year to build anything.

nuelzemudio
Автор

I have to sync my build everytime i change it

akshat
Автор

What if I want to give signed apk with debug URL?

samsadch