Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sample Projects to Play/Learn

ANSWERED

I see a lot of people have posted code snippets and/or screenshots of projects they are working on. Has anyone been keeping a list of projects that are currently shared on GitHub or on other posts here? It would be fun to look through to modify/play/learn on live examples.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

To answer the OP initial question, we have a repository where everyone can add their OSS Fitbit OS project.

View best answer in original post

Best Answer
0 Votes
14 REPLIES 14

I have not seen any other repos or projects yet, but here's one I am in the process of putting the finishing touches on: https://github.com/bayssmekanique/fitbit-gym-card

Best Answer

@BayssMekanique I was able to plug everything into studio and most of the code makes sense. Where would one go to input the card number?

Best Answer
0 Votes

For now, you have to go into the "Developer Menu" inside the Fitbit app (nested in the Ionic Device Page), and Gym Card will appear as a sideloaded app.  Tap it, and you'll get a bunch of options, one of which is Settings.  Tap the settings and you'll be taken to a settings page for where you can enter the card ID.

I'm assuming that once Gallery launches this would be able to be installed just like the rest of the apps and would have a gear icon which would lead to the settings page.

There is the potential to break this app still.  I don't have any validation (still not certain of best practice for this yet) so as long as you only enter Alpha-Numeric values, it should work.

Best Answer
0 Votes

IMG_1686.jpgIMG_1685.jpg

i was expecting what you said but saw this instead. 

Best Answer
0 Votes

That's interesting.  I have been using Android and it works fine, but I haven't tried on iOS.

 

To confirm, you need to copy over the app, companion, resources, and settings folders. (In Chrome I was able to drag all 4 folders into a new empty project all folders)

Best Answer
0 Votes

Yes, same. Copied everything over. I see mostly everything as expected in iOS and the Ionic, but no settings icon like I would expect in iOS app.

I also tried going to the apps section but it only shows the preinstalled apps.

Best Answer
0 Votes

@TunaFin wrote:

Yes, same. Copied everything over. I see mostly everything as expected in iOS and the Ionic, but no settings icon like I would expect in iOS app.

I also tried going to the apps section but it only shows the preinstalled apps.


When you install an app with a companion, you need to enable the developer bridge on the phone and the Ionic, then connect to both in Studio. The companion gets installed on the device and you access settings via the developer menu.

Best Answer
0 Votes

So Developer Bridge on Ionic says "Connected to Debugger"

Studio is connected to both devices.

Now when I run I get a console error:

 

[6:52:45 PM]TypeError: null is not an object (evaluating 'JSON.parse(raw).name')

  • parseCodeSettings at companion/index.js:19
  • restoreSettings at companion/index.js:5
  • onopen at companion/index.js:23
Best Answer
0 Votes

That's a bug!  Atleast you were able to get it working 😛

I'll take a look later

Best Answer
0 Votes

hi, many people are still developing and learning to code apps/clockfaces as well, thus will likely have incomplete and buggy code - nothing worth pushing to github yet.  i imagine in a few weeks there may be some more complete code examples to help out.  in the meantime, maybe get familiar with how javascript works and make use of stackoverflow.com for any queries you have.

Best Answer
0 Votes

I added some additional checks to that particular code.  There seem to be some issues with the Text Input field varying in what it returns, so I added quite a few checks just in case.

Best Answer

@BayssMekanique

I finally got back to this and it worked very smoothly. A little slow to load when I select the icon, otherwise it appears to work great. I'll try it out at the gym tomorrow.

 

Is there some kind of timeout function once you are in the app to return back to the home screen and turn off the display? It seems like that would be beneficial so battery isn't destroyed when you forget to exit the app.

Best Answer
0 Votes

Yeah, I've noticed the slow load and haven't really done any digging to figure out exactly what's causing it.  If I had to guess it's the logic for the synchronous file read.

As for the timeout, I certainly could add something like that.  It hadn't crossed my mind.  I'll dig into it a bit more this weekend.

Best Answer
0 Votes

To answer the OP initial question, we have a repository where everyone can add their OSS Fitbit OS project.

Best Answer
0 Votes