Is there an easy way to map data from JSON to fields of my class by means of android APIs?
JSON:
{ email: \'email\', password: \'pass\' }
Use Jackson. Much more convenient (and if performance matters, faster) than using bundled org.json classes and custom code:
Credentials c = new ObjectMapper().readValue(jsonString, Credentials.class);
(just note that fields of Credentials need to be 'public' to be discovered; or need to have setter methods)