06-21-2018 19:46
06-21-2018 19:46
I'm looking for some guidance from some experienced developer. I'm a FPGA/ASIC designer so javascript is not native to me but it's been pretty easy to pick up. I'm trying to create a golf app to track my shots. I've figured out the svg and I've been able to create some interfaces and set up GPS captured but I'm stuck on flow of the app in a complex UI. I really want a mix of activity and spoke and hub but I can't find some good examples.
Can anyone recommend some material to read through? I've done some searching but I can't seem to get unstuck. I learn best by example, so if you could point me to some sample apps to load up in the simulator that I can look through the code for to get a feel that would be great!
06-22-2018 01:44 - edited 06-22-2018 01:47
06-22-2018 01:44 - edited 06-22-2018 01:47
Hey, I learnt most about the possibilities for the UI by reading(/scrolling) through everything in the references and guides. Most notable for me was the part about the user interface. Within this part I found the view components most interesting. The design guidelines provide a more highlevel view of what you could do or what you "should" follow (less code examples but there are some links to more in depth info which have code examples).
For "full" projects you can take a look at this page. It has some smaller examples. But for a more complex example you could perhaps take a look at this project. I haven't run it my self but by looking at the code I can see it has some usecases of the scrollview. Next to that it makes use of multiple .gui files for the different screens it provides which are loaded in the main UI file, the index.gui .
I hope this provides you with some ideas for creating a more complex UI. I'm afraid I didn't understand what you're trying to say with "a mix of activity and spoke and hub".
06-22-2018 03:26
06-22-2018 03:26
The GOLF GPS app is open source and available on github
06-23-2018 12:59
06-23-2018 12:59
Thank you! I appreciate you taking the time to respond. I was struggling with the high level in the design guidelines on how to actually implement things. I was able to take the screen switching function out of the more complex project you reference and get that to work. I'm a little confused about *how* it works still, but now I have a framework to play with. I also like how the developer of the complex app broke out the functions that I can work with.
06-23-2018 13:05
06-23-2018 13:05
I was looking for something a little further than what is in place for the existing golf app. Plus it doesn't work at all for my versa. I've got some grand ideas for what I want to implement.Though I would like to figure out how to pull distance from green from a website to add in, but my main goal is to track club distance and score. Then have some backend analytics to suggest club based on history and provide graphs of performance over time.
06-23-2018 13:22
06-23-2018 13:22
Hi Brwhite,
The main problem for versa is that you need to pull the gps from the phone to the device. Since I have no versa, it is hard to test this functionality.The app was not working last week, my server got overloaded and my host blocked my API. I've received 6 api calls per second last weekend which caused this. I upgraded the hosting and the app should work fine now on your versa.
There are limited datasources for Hole GPS positions. I've gather 40k courses over the last 13 years. I am the developer of the GOLF GPS app and you are more than welcome to add the shot tracking and score card.
I made a start with shot tracking and club suggestion. Actuallty, if Fitbit approves my latest build, you will get club suggestions on the versa as well.
06-23-2018 19:15
06-23-2018 19:15
@Pietero wrote:Hi Brwhite,
The main problem for versa is that you need to pull the gps from the phone to the device. Since I have no versa, it is hard to test this functionality.The app was not working last week, my server got overloaded and my host blocked my API. I've received 6 api calls per second last weekend which caused this. I upgraded the hosting and the app should work fine now on your versa.
There are limited datasources for Hole GPS positions. I've gather 40k courses over the last 13 years. I am the developer of the GOLF GPS app and you are more than welcome to add the shot tracking and score card.
I made a start with shot tracking and club suggestion. Actuallty, if Fitbit approves my latest build, you will get club suggestions on the versa as well.
Thank you for taking an interest in my dabbling!
I just tried the app again and it's behaving a little better. (i live on a golf course and I'm a 5 iron away from the green on 6) It's still taking a long time at the "load course" stage.
Is there a way to use the file system to make a one time download of data? I haven't played with filesystem yet but I'm getting close.
06-24-2018 04:15
06-24-2018 04:15
Loading a course takes long on the first time you load a course. The steps that it takes are
1) Send message to phone that you want to receivce a course
2) phone makes API call to server
3) server has to build the correct course format if the course version is not correct (because of changes in the structure) this takes several seconds.
4) Phone parses json to object
5) phone encodes the object, makes a file and send it to the device
6) devices will detect the new file and decode it.
Now, when the course opens the second time. (only from version 0.3, release is next week)
1) Check if the course file is already on the watch
2) decode the file.
Your other question about loading all courses.
All the courses together are 120MB so that should work. The file transfer system is real realy slow however. As far as i can derive from the documentation, there are no file size limits. However, if you would read a file you have to put it in an object. I encoutered a maximum size of an object (When i was making my GPS logger with GPX export).
So we need to think of something smarter.. Something that is totaly independent from the phone. Maybe we can store an array of all courses within 250km of your house? We can store it by only using lat long as integers.
{crouse_id:25000,lat:52.123456,lon:4.123456} or to make it short {id:25000,a:52,o:4}
Backlog / Roadmap
You can take a look on my backlog if you want: https://trello.com/b/2v8bnyxk/golf-gps
06-27-2018 05:51
06-27-2018 05:51
Hello, I'm the developer of the the complex app. Thanks for the reference and the comments about the code structure.
The screen switching works by making one SVG symbol (screen) visible and hiding the rest. I broke the SVG symbols (screens) in separate files and included them in the main layout (index.gui) to make the project easier to manage, but all of the screens could have just been put right into index.gui.
To follow up on @Pietero statement about file size. As far I as I can tell there is no file size limit but there is a max app size limit of 15mb https://dev.fitbit.com/build/guides/application/
I've been playing around with idea hosting the course data for my app on a web server and letting the users pick which course they want to cache to there device. But I have not found a way yet of creating a dynamic list in the companion app to allow the user to pick the courses they want.
06-27-2018 11:57
06-27-2018 11:57
To follow up on @Pietero statement about file size. As far I as I can tell there is no file size limit but there is a max app size limit of 15mb https://dev.fitbit.com/build/guides/application/
@Durus, I was not talking about maximum file sizes, but maxium object size. I've made a GPX logger and stored all GPS points into one object, but it crashed due to the large object.
I've been playing around with idea hosting the course data for my app on a web server and letting the users pick which course they want to cache to there device. But I have not found a way yet of creating a dynamic list in the companion app to allow the user to pick the courses they want.
I was now curious about your app and I can learn a lot from it. The Game Golf app made the settings with an autocomplete, that could be an alternative to your desired solution.
06-27-2018 13:46
06-27-2018 13:46
I think you're only allowed about 64k of javascript memory on the watch, so trying to load or create a massive object won't work.
https://dev.fitbit.com/build/reference/device-api/system/
06-29-2018 05:52
06-29-2018 05:52
@Gondwana is correct. Loading large object is not going to work.
I have to jump though hoops to keep the memory usage below the limit; I had to refactor the javascript several times to keep the getting the out of memory error.
Here is a good article on memory usage https://github.com/gaperton/ionic-views/blob/master/docs/optimization-guidelines.md