Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

AndroidDocumentViewer

> 编程语言
Open source

deprecated( tencent started charging); Android 文档查看: word、excel、ppt、pdf,使用mupdf及tbs

395 stars0 likes1 views
WebsiteGitHub

About

deprecated( tencent started charging); Android 文档查看: word、excel、ppt、pdf,使用mupdf及tbs

在 Android 上查看word,excel,powerpoint,pdf

示例app效果:

如何使用?

参考: 示例

  • 复制lib_fileviewer模块,加入到project
  • App中build.gradle中加入以下配置:
groovy
ndk {
            // 此处必须设置为 armeabi ,TBS 文件浏览不支持其他类型
            abiFilters "armeabi"
    }
  • TBS初始化(在Application中):
java
QbSdk.initX5Environment(getApplicationContext(), new QbSdk.PreInitCallback() {
            @Override
            public void onCoreInitFinished() {
                Log.d(TAG, "onCoreInitFinished");
            }

            @Override
            public void onViewInitFinished(boolean initResult) {
                Log.e(TAG, "onViewInitFinished" + initResult);
            }
        });
  • 查看文件统一入口:
Uri uri = Uri.fromFile(new File(filePath));
FileViewer.viewFile(context,uri)
  • 直接使用mupdf查看:
java
FileViewer.viewPDFWithMuPDFByPath(Context context, String filePath)

或:

java
FileViewer.startMuPDFActivityByUri(Context context, Uri documentUri)
  • 直接使用TBS查看word文档:
TBSFileViewActivity.viewFile(context, filePath);

注意事项

  1. office文件无法查看(TBS初始化失败),可以查看这个文档:无法加载x5内核的解决方案.doc

使用到的库:

PDF查看: mupdf

版本: v1.11.1

介绍: MuPDF is an open source software framework for viewing and converting PDF, XPS, and E-book documents. There are viewers for various platforms, several command line tools, and a software library for building tools and applications.

项目地址: https://mupdf.com/docs/

Android 文档: https://mupdf.com/docs/android-sdk.html

word等文件查看 : TBS(腾讯浏览服务)

简介: web内核

官方页面

Issues· 10 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroidexcelfilereaderfileviewer

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言