Links to scripture references

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

Links to scripture references

Postby shaque » Tue Feb 08, 2011 12:29 am

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: 14685
Joined: Tue Nov 27, 2007 8:48 pm
Location: Sandy, Utah

Postby aebrown » Tue Feb 08, 2011 5:36 am

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: 1346
Joined: Wed Jun 11, 2008 8:52 pm
Location: Austin TX
Contact:

Postby RossEvans » Tue Feb 08, 2011 7:42 am

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

Postby shaque » Tue Feb 08, 2011 11:36 pm

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: 5
Joined: Sat Feb 26, 2011 8:11 pm

Postby Ryebrye » Sun Feb 27, 2011 9:55 am

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.php?7117-Implemented-a-patch-to-make-GLA-load-and-parse-http-lds.org-scriptures-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/1609573/intercepting-links-from-the-browser-to-open-my-android-app

jp78
New Member
Posts: 9
Joined: Fri Jan 19, 2007 12:47 am

Re: Links to scripture references

Postby jp78 » Sun Oct 11, 2015 7:38 pm

Why has this not been done in four years?

jdlessley
Community Moderators
Posts: 6522
Joined: Sun Mar 16, 2008 11:30 pm
Location: USA, TX

Re: Links to scripture references

Postby jdlessley » Mon Oct 12, 2015 3:59 am

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 LDS.org Help Center page or the LDSTech wiki?

jp78
New Member
Posts: 9
Joined: Fri Jan 19, 2007 12:47 am

Re: Links to scripture references

Postby jp78 » Mon Oct 12, 2015 8:21 am

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


Return to “Android Gospel Library”

Who is online

Users browsing this forum: No registered users and 1 guest