code: private static String getJsonFromRaw(Context context, int resource) {
          String json;
          try {
              InputStream inputStream = context.getResources().openRawResource(resource);
              int size = inputStream.available();
              byte[] buffer = new byte[size];
              inputStream.read(buffer);
              inputStream.close();
              json = new String(buffer, "UTF-8");
          } catch (IOException ex) {
              ex.printStackTrace();
              return null;
          }
          return json;
      }
docs: Fetch JSON from RAW resource
  
  @param context  Context
  @param resource Resource int of the RAW file
  @return JSON