I have an Android app that does text selection and text highlighting using 
javascript and CSS. It's a scripture reading/marking app for the LDS Church 
(https://play.google.com/store/apps/details?id=org.lds.ldssa). Users can 
long press on text in a webview to get an annotation menu where they can 
add notes, change highlight colors, move the selection boundaries, etc. The 
requirements are as follows: I have to be able to get word offsets for the 
selection (i.e. I have to be able to say highlight 1 begins in paragraph 2 
on word 5 and ends in paragraph 3 on word 7). I have to be able to display 
saved annotations as well as create/edit them.

I implemented this annotation feature last year and works pretty well most 
of the time on devices running Android 2.2 and up. But I've found that in 
recent Android releases (ICS and JB) it doesn't always work as it used to. 

Sometimes the behavior is erratic on a particular OEM. Sometimes behavior 
changes with an Android OS update (for example, JB does not allow me to 
change the color of the selected text via the ::selection pseudo element). 
It also doesn't always perform very well, depending on hardware and the 
number of annotations for a particular chapter. 

*My question, is this: What is the best way to approach this task?* Is 
javascript and CSS the best way? Or should I dig into the Android source 
code and try to mimic the text selection code that is used there? Any help 
or pointers would be greatly appreciated.

-Mike

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to