Links to scripture references

Discussions around the Android version of the Gospel Library application.
Post Reply
shaque
New Member
Posts: 4
Joined: Tue Feb 08, 2011 12:19 am

Links to scripture references

#1

Post 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.
User avatar
aebrown
Community Administrator
Posts: 15153
Joined: Tue Nov 27, 2007 8:48 pm
Location: Draper, Utah

#2

Post 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.
Questions that can benefit the larger community should be asked in a public forum, not a private message.
RossEvans
Senior Member
Posts: 1345
Joined: Wed Jun 11, 2008 9:52 pm
Location: Austin TX
Contact:

#3

Post 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.
shaque
New Member
Posts: 4
Joined: Tue Feb 08, 2011 12:19 am

#4

Post 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.
ryebrye
New Member
Posts: 6
Joined: Sat Feb 26, 2011 8:11 pm

#5

Post 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
jp78
New Member
Posts: 9
Joined: Fri Jan 19, 2007 12:47 am

Re: Links to scripture references

#6

Post by jp78 »

Why has this not been done in four years?
jdlessley
Community Moderators
Posts: 9902
Joined: Mon Mar 17, 2008 12:30 am
Location: USA, TX

Re: Links to scripture references

#7

Post 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.
JD Lessley
Have you tried finding your answer on the ChurchofJesusChrist.org Help Center or Tech Wiki?
jp78
New Member
Posts: 9
Joined: Fri Jan 19, 2007 12:47 am

Re: Links to scripture references

#8

Post 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
Post Reply

Return to “Android Gospel Library”