views:

30

answers:

0

Hi there,

I am thinking of writing a very simple ebook reader for foreign language (Chinese for starters) that doubles as a simple dictionary.

So, basically I envision this app will function like a simple ebook reader (read txt file or epub) and allows you to flip the pages using keys or gesturing, remember where you last stopped etc. As for the dictionary part, when the user taps on any words, a popup or a separate TextView will display the definition of the word.

Ok, this is what I've done so far. I managed to put together a directory browser to allow the user to choose a file and then open it and read the file and set the text (in UTF-8) into a TextView. It works ok so far, but I have 2 big problems: (1) I cannot determine what character the user taps on. I added the some codes to attach an OnClickListener to the TextView to see if I can get anything out of TextView.getSelectionStart or TextView.getSelectionEnd but they are returning the value of -1 all the time. (2) I do not know how I can handle the pagination or store the last viewed position. When I added a ScrollView the scrolling is up to the user, so I have no control of it.

Seems to me that I am not using the right View in the first place.

In any case, can anyone who has experience with this offer any comment/help/guidance? What View should I use and how should I tackle the above two problems?

Thank you very much.

P/S: I did come accross another question on this site (http://stackoverflow.com/questions/2302867/android-how-to-determine-character-index-of-a-touch-events-position-in-textview) but it doesn't seem to answer my questions.