I want to store the api urls somewhere , if I require I can change easily. If I keep in my server still I need url to access server which requires authentication. If I store in assets then there is a chance of stealing it by decompiling the apk. I don't want to hardcode urls in code or String.xml. Please suggest the best way where I can keep safe and change url easily. Thanks !!
The best way in your case is store api url's in server because you can change them later. You'd create one url to fetch your api urls. Build your app based on an architecture like this.
[
{url: "/user/login", type:"login"},
{url: "/user/register", type:"register"}
]
And don't forget anyone can see your server urls. It even doesn't have to decompiled because there are tools to watch device's network traffic:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With