samples/android/app/src/main/java/com/amazon/sampleapp/impl/CarControl/CarControlDataProvider.java
/**
     * Opens file path and creates JSON object
     */
Opens file path and creates JSON object
Opens file path and creates JSON object
private static JSONObject parseFileAsJSONObject(String filePath) {
        JSONObject obj = null;
        try {
            File file = new File( filePath );
            FileInputStream is = new FileInputStream(file);
            byte[] buffer = new byte[ is.available() ];
            is.read( buffer );
            String json = new String( buffer, "UTF-8" );
            obj = new JSONObject( json );
        } catch (Exception e) {
        }
        return obj;
    }
private static JSONObject parseFileAsJSONObject ( String filePath ) { JSONObject obj = null ; try { File file = new File ( filePath ) ; FileInputStream is = new FileInputStream ( file ) ; byte [ ] buffer = new byte [ is . available ( ) ] ; is . read ( buffer ) ; String json = new String ( buffer , "UTF-8" ) ; obj = new JSONObject ( json ) ; } catch ( Exception e ) { } return obj ; }
Opens file path and creates JSON object
Opens file path and creates JSON object