Help with passing and displaying information


#1

Hey everyone,

During my development process I’ve picked up different methodologies on how to implement certain parts of our mobile app. However, I think learning different methodologies can be a double edged sword and I need some help on best practices. In our mobile app we pull our list of locations from our API and display them in a collection view with minimal data(name and city/state). Once you tap a location it then pushes the user to a new page to display all of the locations data. This is where I need some advice.

When the user pushes to the new page, I have a create page variable for the id of the location. Then when the new page loads, an API request is made for the specific locations data based on the id. After that I bind the information to the individual fields. Works fine. However, some things like displaying a pin on a map or creating location object become have to be done in the 200 response of the API call. I guess it’s no big deal but I was wondering if the better way would be to pass everything needed as a device variable to the information page or is the way that I’m doing it the recommended way?

I feel like the way that I’m doing it is better but I’m just not sure of any advantages of one way over the other. I’m probably like most of the developers using Dropsource in that I have enough coding knowledge to make me dangerous and I also don’t enough to also make me dangerous.

Thanks in advance for the feedback.


#2

Personally if the amount of data to pass to the next page is minimal (say about 4 fields) and I already have it, i just pass it to the next page. This saves me an extra trip to my backend to fetch data making the app more snappier. Also if my app backend charges me based on the requests this saves me some few dollars :smile:

But if there is a lot of information to be passed to the next page it becomes tedious passing them over so I will just use the id to re-fetch like you’re doing.


#3

Thanks @seanhoots. That’s what I was thinking. In the end I would be passing around 12-14 fields of data. I could potentially cut that down by combining a few fields into one. It wouldn’t affect the data structure. I definitely want to keep the app snappy for the end user but as it stands now Backendless pushes out a response so quickly I’m not sure that it’s really that noticeable. Do you think storing the variables vs pulling real time has any affect on the devices processing power? It doesn’t seem like it would.