简体   繁体   中英

how to integrate offline dictionary with pdf reader in android

我正在开始开发自己的带有字典支持的应用程序pdf阅读器,但找不到找到将离线词典与pdf阅读器集成的有用方法。

From what we discussed in comments, here is a posssibely solution:

The most difficult should be the pdf reader implementation. As you told me, you have found an open access pdf reader for android, so it is fine.

In order to implement an offline dictionary with your existing pdf reader, I suggest you this:

1. Modifie your pdf reader to catch a word click (or long click). You have to be carreful with that because I don't know how you implemented the pdf scroll. So the system hould be able to distinguish if the user is trying to scroll, zoom the pdf, or to click a word in order to see the definition.

2. Once you can catch the word click, you wil have to use the clicked word and search in your offline dictionary. for that, create a SQLite database: see: http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html and search for the clicked word.

3. Once the results obtained, you can display your result in a dialog or another view, or even in your pdf reader if you implement this function.

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