1

I'm new to Android programing. I'm using retrofit2 to create an API. I'm now wondering if there is a way to hide API url defined as a static variable inside class. I'd like to store the url inside string folder if possible. Is there a way to do it?

Ooto
  • 1,117
  • 16
  • 39

1 Answers1

0

Hi I think the best way to do this in code level is to: - encrypt the variable url and decrypt it when you will use on retrofit instead of putting it on a res / raw file or string folder or xml.

  • don't add httploggingInterceptor on retrofit when building a production apk
  • always use pro guard on retrofit
Rhen
  • 91
  • 3