Creating relationships in Glide

I am building an app to promote a bike trail in my city. The bike trail is divided into separate lines and I want to feature five landmarks in each line.

I have the lines set up under one Glide table called Trail Lines.

Then I have Glide tables for each trail line listing the five unique landmarks.

The Trail Lines screen appears just fine; each trail line is listed.

For the next screen where the five landmarks need to appear, I have the components set to display an inline list. The data for this list comes from the table listing the five unique landmarks for that particular line.

When I tap on the first trail line “card” (I’m using the cards style) in the layout, the correct five landmarks display for that line.

I have then gone to the second trail line to set up the inline list for that line, using the table listing for that line’s unique landmarks.

When I go back to test, tapping the second line’s “card” gives me the correct landmarks. However, tapping the first line’s “card” gives me the landmarks that are assigned for the second line.

When I look at the inline list for the first line, I see that the data is being pulled from the second line’s table.

It seems like these are linked, and I don’t want them to be linked. Each line should go to its own unique set of landmarks.

I am working with the free version of Glide right now, but am looking to purchase a subscription if I can get the basics of this app to work.

What do I need to do to make sure each trail line “card” goes to its unique set of landmarks?

You’ll want each point on the trail to have a unique value that’s assigned to that line. Could be the Row ID, or some other unique ID. Then you want to create a multiple relation column from the line to the points on the line. The detail screen for each line (when you click on the card), should contain a collection of the relation.

This might help:


Hi, Robert:

Thank you so much for your tutorial! This really helped me out a lot! The app is now doing what I want it to do, and I understand how to create relationships between tables.

I have an unrelated question for you. I didn’t see any information about this in Glide’s app development site. Is there an optimum size for images in Glide? I noticed some of the photos I’m using are not focusing on the main object like I want them to be. I also want to make sure the file size for images is not too large either, so the user doesn’t get discouraged from using the app.

Thank you again for all of your help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.