其实使用起来很方便,对藏文完美支持,好像知乎也用了。也没有深入去研究写,主要看到两个项目优点多,几行代码就搞定!
- Custom Fonts
- Custom Text Size
- Themes / Day mode / Night mode
- Text Highlighting
- List / Edit / Delete Highlights
- Handle Internal and External Links
- Portrait / Landscape
- Reading Time Left / Pages left
- In-App Dictionary
- Media Overlays (Sync text rendering with audio playback)
- TTS - Text to Speech Support
- Book Search
- Add Notes to a Highlight
- Last Read Position Listener
- Horizontal reading
- Distraction Free Reading
- can be used in Activity, Service, Fragment, Dialog, popupWindow, Notification and other components
- support the task of automatic scheduling, the user does not need to care about the state of the task switch logic
- Through the Aria event, it is easy to get the download status of the current download task
- a code plus can get the current download speed
- a code can be dynamically set the maximum number of downloads
- code to achieve speed limit
- It is easy to modify the number of download threads by modifying the configuration file
- priority to download a task
- Android Studio 安卓开发工具,被墙了下面是国内地址 http://www.android-studio.org/ 但感觉还是jetbrains的IDE比较牛逼 http://www.jetbrains.com
- FolioReader项目地址 https://github.com/FolioReader/FolioReader-Android
- Ari项目地址 https://github.com/AriaLyy/Aria/blob/master/ENGLISH_README.md
在manifest中配置权限
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
另外加一行配置Android9.0的
<application android:networkSecurityConfig="@xml/network_security_config">
之后在相应的/res/xml/network_security_config.xml配置
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>
在仓库中添加依赖包
implementation "com.folioreader:folioreader:0.5.1"
implementation 'com.arialyy.aria:aria-core:3.5.1'
annotationProcessor 'com.arialyy.aria:aria-compiler:3.5.1'
下载
Aria.download(this)
.load(DOWNLOAD_URL)
.setFilePath(filepath,true)
.start();
打开
folioReader.openBook("sdcard/bookeader/1.epub");
之后运行测试