pleco://x-callback-url/clipboard implementation for Android

mikelove

皇帝
Staff member
#2
We added that on iOS for the sake of Shortcuts but didn’t bother with it on Android because we figured people would just use intents (iOS doesn’t have those); our other URL protocols are things people might wish to invoke from a cross-platform website, but “open clipboard reader” didn’t seem like something anybody would want to do that with.

Is there some reason why an intent won’t do the job in your case?
 
#3
Ah I see. Is there a list of the intents available on the Android app somewhere? (Sorry if I'm asking a trivial question)
 

mikelove

皇帝
Staff member
#4
Most launcher type apps can query other apps for their available intents (in order to let you assign shortcuts to them). You can also just “share” the text to Pleco Reader from the regular Android context menu.
 
#5
I spent some time looking through Google / Stackoverflow and I can't figure out how to query another app for their available intent. Do you mind sharing some sample code on how to do that?

I've also tried to launch an intent with action set to ACTION_VIEW and the data passed as uri = 'pleco://x-callback-url/clipboard', which did not work.
 

mikelove

皇帝
Staff member
#6
To be honest, I've never had to do that for any app I've worked on - I know it's possible because other apps do it but I've never had a reason to investigate how.

The basic activity for our document reader is com.pleco.chinesesystem.PlecoDocumentReaderActivity so if you simply VIEW or SEND your data to that as text it should give you what you want.
 
Top