Code example for Gson

0
			File memory = Environment.getExternalStorageDirectory();
			File dir = new File(memory.getAbsolutePath() + DIRPATH);
			dir.mkdirs();
			File file = new File(dir, Utils.FILENAMECONN);
			InputStream is = new BufferedInputStream(new FileInputStream(file));
			Gson gson = new Gson();
			final Reader reader = new InputStreamReader(is);
			return gson.fromJson(reader, Connections.class);
 
		} catch (Exception e) {
			e.printStackTrace();
			return null; 
		} 
	} 
 
	public static InputStream DownloadJsonFromUrlAndCacheToSd(String url,
			String dirName, String fileName, Context context) {
 
		InputStream source = UtilsWeb.retrieveStream(url, context);
 
Connect your IDE to all the code out there  Get Codota for Java