Back to project page demo-flickr-feed-android.
The source code is released under:
This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...
If you think the Android project demo-flickr-feed-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.org.tomek.flickrfeed.utils; /*w ww .ja va 2s. co m*/ import android.content.Context; import java.io.IOException; import java.io.InputStream; /** * Some utilities for Sting operations. * * Created by tomek on 01/11/14. */ public class StringUtils { public static String loadJSONFromAsset(Context context, String fileName) { String json = null; try { InputStream is = context.getAssets().open(fileName); int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); json = new String(buffer, "UTF-8"); } catch (IOException ex) { ex.printStackTrace(); return null; } return json; } }