Links to scripture references

8 postsstarted by shaque 3,565 viewsoriginal topic

New Member
#1
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.
Community Administrator
#2
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.
Questions that can benefit the larger community should be asked in a public forum, not a private message.
Senior Member
#3
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.
New Member
#4
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.
New Member
#5
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
New Member
#6
Why has this not been done in four years?
Community Moderators
#7
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.
JD Lessley
Have you tried finding your answer on the ChurchofJesusChrist.org Help Center or Tech Wiki?
New Member
#8
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