Page 1 of 1

Links to scripture references

Posted: Tue Feb 08, 2011 12:29 am
by shaque
Is it technically possible in Android to create links to scriptures and other "e-book positions" in the Gospel Library app, that can be pasted into other apps? For example through a special url, like "scripture:/Book_of_Mormon/1_Nephi/3/7"?

If so, this would be a wonderful feature. It could perhaps be reached through pressing verse numbers, and then pressing a button "Copy link" in the highlighting/notes popup window.

Posted: Tue Feb 08, 2011 5:36 am
by aebrown
shaque wrote:Is it technically possible in Android to create links to scriptures and other "e-book positions" in the Gospel Library app, that can be pasted into other apps? For example through a special url, like "scripture:/Book_of_Mormon/1_Nephi/3/7"?

If so, this would be a wonderful feature. It could perhaps be reached through pressing verse numbers, and then pressing a button "Copy link" in the highlighting/notes popup window.
A similar request for Apple devices was made in the thread iPhone/iPad URL Schema.

Posted: Tue Feb 08, 2011 7:42 am
by RossEvans
These links are just generic URLs, and technically should work in any browser or app on any device. The only restriction I can see is a legal one, dependent upon the Terms of Use in LDS.org.

Posted: Tue Feb 08, 2011 11:36 pm
by shaque
aebrown wrote:A similar request for Apple devices was made in the thread iPhone/iPad URL Schema.
Yes, this is the same feature. I haven't looked into it, but I can imagine that getting a URL schema registered in Android may be as simple as adding some field in the "app description file". It would be cool if it were possible to register Gospel Library as an opener for http://scriptures.lds.org/*, but I suppose that such a field probably can't handle patterns.

Posted: Sun Feb 27, 2011 9:55 am
by ryebrye
shaque wrote:Yes, this is the same feature. I haven't looked into it, but I can imagine that getting a URL schema registered in Android may be as simple as adding some field in the "app description file". It would be cool if it were possible to register Gospel Library as an opener for http://scriptures.lds.org/*, but I suppose that such a field probably can't handle patterns.

Yeah, it's actually pretty easy to do that. You just create an activity with an intent filter that handles http://lds.org/scriptures URLs and then in that intent you get the entire URL and you parse it out and adapt it to the format that is used internally in GLA. You can also handle this by throwing the intent filter on the ScriptureView activity and then look for it on the onCreate method - but I think it's a lot cleaner to just have another activity set up to handle the intent and adapt the URLs to the internal format than to have a really long onCreate method.

When you have this implemented and you tap on a http://lds.org/scriptures/* link in the browser it brings up a window asking you what app you want to use to get that link - you have a choice of either Browser or GLA. You can tell it to always remember your selection and pick GLA and then from then on it wont prompt you - it will just open GLA.

I've implemented this and it works fine on my device. I'm working on getting it to apply the transient highlight (i.e. it shows the verses you requested with a highlight or some other visual indicator around them but doesn't store it in the database) but haven't been able to figure out how to get it to work (perhaps once I clean up the patch and post it somewhere a person more familiar with the inner workings of the app can figure it out)

https://tech.lds.org/forum/showthread.p ... ptures-url

I'm not an iPhone / iOS expert - but this should be significantly easier to implement on android simply because you can use http links to do so.

Here's an example of doing it in android in another app to give you an idea of how easy it is.

http://stackoverflow.com/questions/1609 ... ndroid-app

Re: Links to scripture references

Posted: Sun Oct 11, 2015 8:38 pm
by jp78
Why has this not been done in four years?

Re: Links to scripture references

Posted: Mon Oct 12, 2015 4:59 am
by jdlessley
jp78 wrote:Why has this not been done in four years?
You can ask that of the developers by sending feedback through the app Help > Send Feedback.

Re: Links to scripture references

Posted: Mon Oct 12, 2015 9:21 am
by jp78
Feedback has been sent.

FYI, it looks like the forum URLs changed at some point since 2011... the link referred to by user Ryebrye is still available here: https://tech.lds.org/forum/viewtopic.php?t=7117