I thought this would be a fairly simple and frequent issue, but it is surprisingly not, because I can't find any discussion around this topic online.
It's simple: Android's naming convention ensures that all member variable's name starts with "m", like "mId", "mName". I need to convert a json object to a Pojo using Gson. However the json object's field names do not start with "m" prefix. Hence it fails to convert.
I don't have control over the json format as it is a response from the internet. I also don't want to change all member variables in the project as there are a lot. Is there any work around so that I can still use Gson to do the conversion?
Also I have checked that Gson has FieldNamingPolicy that you can set to match the fields, but there're only 4 pre-defined policies and I can't figure out a way to add a customized one.
Thanks!