Back to project page jpdroid.
The source code is released under:
GNU General Public License
If you think the Android project jpdroid 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 br.com.rafael.jpdroid.util; /*w w w . jav a 2 s . c om*/ import br.com.rafael.jpdroid.core.JpdroidWriteFile; import android.database.Cursor; /** * Classe respons?vel por exportar arquivos no formato JSON para o cart?o de mem?ria. * * @author Rafael Centenaro */ public class JpdroidJsonFile extends JpdroidWriteFile { public static void export(Cursor cursor) { export(cursor, "JsonFile" + getDateNow() + ".JSON"); } public static void export(Cursor cursor, String fileName) { String card_string; try { card_string = JpdroidConverter.toJson(cursor).toString(); writeFile(card_string, fileName); } catch (Exception e) { e.printStackTrace(); } } public static void export(Object entity) { export(entity, "JsonFile" + getDateNow() + ".JSON"); } public static void export(Object entity, String fileName) { String card_string; try { card_string = JpdroidConverter.toJson(entity).toString(); writeFile(card_string, fileName); } catch (Exception e) { e.printStackTrace(); } } }