I am brand new to Stack Exchange API and Android (well, self taught in the last four months). I have been working on creating a school project focused around Android and JSON. My initial idea was to create an app for Stack Exchange but many have been there, done that and it turned out to be far too complicated for my current programming skills.

I finally have a simple working app to explain and demonstrate JSON parsing with Android for my project using the Stack Exchange API but I just encountered an error I don't know how to handle. 

I trimmed my project down drastically to create basically this: An app that shows the Top Ten Users on Stack Overflow and displays their name, age and location. I know this app isn't useful for much, but it is just a demo of parsing the JSON in Android (and also gzip the JSON which I didn't know until I got outside help).

Using the Stack Apps Usage/Try It I formed a query/filter to find only the top ten users of Stack Overflow with their display_name, age and location listed. However 8 of the 10 entries do not contain the key/value pairs for age and/or location so now my app is not working and returns 'Could not fetch data from server' Eclipse LogCat showed me the org.json.JSONException error that there is No value for age.

Now, I know I have to research how to handle this exception but wondering if anyone has a easy to understand answer on how to handle this exception?

I am using 
Windows 7
Eclipse Indigo Service Release 2
Android SDK 22.6.2 (hate it b/c I don't know how to use it as well as the SDK I started with)

Running on:
Galaxy Tab S3 Android 4.1.2

Thanks for any tips!

Update: I resolved this by putting if/else statements with the variables that were missing and setting the values to 0 or null if the key/value pair was missing.

This is the URL I used to return Stack Overflow's top twenty users sorted by reputation and listing only their name, age and location:
https://api.stackexchange.com/2.2/users?pagesize=20&order=desc&sort=reputation&site=stackoverflow&filter=!T6ovp2_VscH*jnbDel