Android 如何存储富文本数据?
我正在开发一个博客应用程序。目前,在发布博客条目时,您可以上载纯文本,并且每篇文章最多只能上载一张图像 我想添加一个富文本(WYSIWYG)编辑器。如何将富文本格式(样式、字体、颜色等)保存到firebase数据库并从中检索Android 如何存储富文本数据?,android,firebase,google-cloud-firestore,rich-text-editor,Android,Firebase,Google Cloud Firestore,Rich Text Editor,我正在开发一个博客应用程序。目前,在发布博客条目时,您可以上载纯文本,并且每篇文章最多只能上载一张图像 我想添加一个富文本(WYSIWYG)编辑器。如何将富文本格式(样式、字体、颜色等)保存到firebase数据库并从中检索 另外,我如何添加存储任意数量图像的能力?对于文档,他们有以下方法来获取内容和渲染 render(); //Render the editor. This method must be called to render the editor. render(String ht
另外,我如何添加存储任意数量图像的能力?对于文档,他们有以下方法来获取内容和渲染
render(); //Render the editor. This method must be called to render the editor.
render(String html); //Render the editor with HTML as parameter.
render(EditorState state); //Render the editor with the state as a parameter
getContent(); //returns the content in the editor as EditorState
getContentAsSerialized(); //returns the content as serialized form of EditorState
getContentAsSerialized(EditorState state); //returns the provided parameter as serialized.
getContentAsHTML(); //returns the editor content in HTML format.
因此,您可以根据需要使用getContent()
,直接存储内容,并在显示时使用render方法
您可以搜索如何在Firebase中存储序列化对象,以存储
EditorState
对象,或直接将HTML文本存储为String
编辑器生成的格式?