private String getAssetAsString(String url)
   {
      InputStream is = null;
      try
      {
         is = assetManager.open(url);

         Reader r = new InputStreamReader(is, Charset.forName("UTF-8"));
         char[]         buffer = new char[4096];
         StringBuilder  sb = new StringBuilder();
         int            len = r.read(buffer);
         while (len > 0) {
            sb.append(buffer, 0, len);
            len = r.read(buffer);
         }
         return sb.toString();
      }
      catch (IOException e)
      {
         return null;
      }
      finally {
         try {
            if (is != null)
               is.close();
         } catch (IOException e) {
           // Do nothing
         }
      }
   }
private String getAssetAsString ( String url ) { InputStream is = null ; try { is = assetManager . open ( url ) ; Reader r = new InputStreamReader ( is , Charset . forName ( "UTF-8" ) ) ; char [ ] buffer = new char [ 4096 ] ; StringBuilder sb = new StringBuilder ( ) ; int len = r . read ( buffer ) ; while ( len > 0 ) { sb . append ( buffer , 0 , len ) ; len = r . read ( buffer ) ; } return sb . toString ( ) ; } catch ( IOException e ) { return null ; } finally { try { if ( is != null ) is . close ( ) ; } catch ( IOException e ) { } } }
/*
Read the contents of the asset whose name is given by "url" and return it as a String.