简体   繁体   中英

Android: Display large amount of formatted text in an app

I am creating an informative application for school students I am having all the contents in word file which is formatted. It contains tables and various styles of fonts,spacing and new lines in it. Can some one tell me how can i display this content in an android application. Or is there any way to display the word file as it is. Thanks in advance

you may upload all your files on server and view directly using webview you need to approach like this

WebView urlWebView = (WebView)findViewById(R.id.containWebView);
urlWebView.setWebViewClient(new AppWebViewClients());
urlWebView.getSettings().setJavaScriptEnabled(true);
urlWebView.getSettings().setUseWideViewPort(true);
urlWebView.loadUrl("http://docs.google.com/gview?embedded=true&url="
                + "YOUR_DOC_URL_HERE"); 

public class AppWebViewClients extends WebViewClient {

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        // TODO Auto-generated method stub
        view.loadUrl(url);
        return true;
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        // TODO Auto-generated method stub
        super.onPageFinished(view, url);
    }
  }

我有一个解决方案,我已经将我的word文件在线转换为HTML文件,然后使用webview容器显示了它,谢谢大家的帮助

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM