mergeconflict267 === [00:00:00] James: Frank Krueger. We love Bluetooth on this podcast. [00:00:14] Frank: We do seem to talk about it quite a bit, but that's because I love Bluetooth too. Yeah. I had a, [00:00:20] James: I was literally answering a Bluetooth question today. Um, The Xamarin essential is there was some people that are like, Hey, when are you going to, you know, there's a big threat about Bluetooth and this game and that scheme. And I was like, oh, there's great libraries out there. Like, I don't know if it's going to happen, but you can just do so many things with Bluetooth. Right. Because it's out there. It's just out there. [00:00:39] Frank: I'm pretty sure I've told the story on this show already, but w my, for my senior project in college, it was like a group project. It was a big deal. Worked on it for an entire year. We were doing smart scales and smart blood pressure, meters, all that kind of stuff, and collecting it into a nice little thing that all sounds like so commonplace these days, but this was all old times. I'm old and it was kind of. Kind of a new thing and it was all done doing Bluetooth and. Just as we were finishing the project, I read an I Tripoli spectrum article that said Bluetooth is dead. And that was 2004. So it turns out Bluetooth, although it is crickety and we all hate it in different ways. It is with us for seems time and mortal. And you might as well learn it at some point. [00:01:30] James: Yeah. It's uh, w we've done many, uh, podcasts on Bluetooth already, and we are. Experts because I, since I've made an app that uses Bluetooth, I get people questioned all the time. Like what about this one? I was like, how do you send messages? How do you send, I want to do an app that does voice over Bluetooth. I'm like, I don't know. I don't, I don't know. I don't know. All I know. Is it exists? It's it's, it's, it's out there in the world, the Bluetooth standards. That's the one thing I think I like about Bluetooth is that there are technically standards and I was getting, I was working on my Caden. We've gotten support emails and, and the fun part here is if, if the sensor works like the app works, you know what I mean? And that's been sort of, the fun part is I had someone that was like, Hey, like, you know, I'm having this issue that like, whenever I can connect it, like one out of 25 chances, blah, blah, blah, this. And I was like, okay, I'll go buy your sensor and turn off the sensor is fine. And I said, well, here, download this other app. Whatever that we'll connect and see if it see if it's the same thing, which I know it will be. Because again, if, if the sensor works, it totally works. Right. And sure enough, I had the same problem. So they got another sensor. Now it's all work in gravy train. So that's what I like about it is like, I know what it is. And that means anything that, you know, binds to that specification just works out of the box. And that's one thing, at least for me as a developer, I find appreciative, but I have a feeling Frank that. That you're using for Bluetooth does not have a specified. [00:03:04] Frank: Uh, no. The thing that I am talking to you are alluding, and I'm pretty sure I've mentioned on here before, but I'm always trying to talk to my one wheel with Bluetooth. Why? Why not? That's always my answer. They have an app for the device, but it's not the greatest app on the planet. It just, you know, there's little things that you want to tweak. And for something that I use every day, I just want a little custom app for it. So just kind of on my off time and while I was on vacation, I was trying to do one of those cool weekend project apps where you finish the whole thing in a weekend. And I totally got it. And running, but there were two things that I wasn't happy with. Number one, my UI was just so boring. It was, it was making me feel bad. Well, actually, let's go with three things. Number two, it was flaky, James. This was some of the buggies worst software I've ever written in my life. It turns out and I didn't intend it to be, but oh my goodness, it was flaky. And three, I was doing it on the apple watch and boy development for the apple watch has not gotten any more pleasant, recent years. [00:04:13] James: And to me, it's astonishing. Even if you try to do anything over Bluetooth with a watch, because. It's just really slow. I don't know if there's some throttling that they're doing because I, I was, I was trying to be clever. The other, when I was on my last trip at home, I, I was like, I'm going to go on, on these runs. And I only run when I'm there with my sister, cause she's a runner and I pretend that I can keep up. But I was like, there was one afternoon where she went in the morning I was going to go in the afternoon. Just, just our timings were a little bit different in that day. So I'm like, I'm going to install. The podcast app on my watch and then I'll connect my buds to my watch. And then I don't got to bring my phone, like that's amazing, right? Mind [00:04:56] Frank: blown. I've been wanting to do that forever because I, for, for running the watches pretty much ideal. Cause I used to carry my phone, but it's so annoying. Carry a phone. And then I tried the arm band thing and it turns out I hate arm bands too. Yeah. So the watch is what I love, but the problem is I don't have any apps on my watch. No, it just the app, the app world never really took off on the watch. And it annoys me a bit because I know there are podcast apps out there. The works with the watch, but it doesn't put the data on the watch. Uh, does overcast put the data on the watch? Which app did you get? Okay, [00:05:35] James: CAS. Um, that's the one that I use theirs got acquired by someone too, I think. Um, but overcast does as well, but. To get a podcast onto the watch. It literally takes 18 billion hours. It just is the slowest. It's like, keep it's like, keep the watch on and open and also like, keep your phone on and open and make sure everything's charging. And you're like, well, I don't understand what's happening. [00:05:59] Frank: Well, let's start there. Okay. So early watch days, you've written a watch app, right? I almost remember. Doing one? No, I would never, no. Okay. Okay. So in the early days, the watch apps were very thin clients and your phone was running all the logic of your application. It was even running a lot. The UI logic, all the watch would do is render the views and take touch events, and then relay back those back to the phone. But those were the terrible days. Uh, no one liked it because there was late latency on everything leg on everything. So there was an improvement though, where more of the software could run on the watch, but huge chunks of it, namely the data and all the sinking stuff. It still runs on the phone and that's. What I've decided is terrible. And that's how the one wheel app from future motion actually works. So it's the phone app talking Bluetooth to the device. And then in addition to that, talking Bluetooth to the watch, to do. Update the display on the watch. And you can imagine that going through all that recommend role, the failure scenarios are various. Everything is laggy, all that. And so what I wanted to do was write a watch native app, which you can now do. Gosh, I think starting in watch away. I can't even guess what version James let's go with? Like three or four years ago. Three-ish years ago, you could actually write real watch apps that have no phone backing. They never talk to the phone. And I have a feeling that if your podcast app did that, it would actually perform a lot better because the wifi on the watch it's actually perfectly fine. The Bluetooth on the watch is perfectly fine. All that latency and terribleness happens when you're talking to the phone. At the same time. [00:08:00] James: Yeah. Yeah, I think that makes sense. I have no idea how it works, but it is something, I mean, um, you know, magic it's it's, you know, it's out there. Yeah. Bluetooth. I always, so I able to synchronize one of my NPR ones. It's very short. And then the longer one, which is like an hour podcast. Yeah. Decided not to, to work so well, but anyways, I think the watch is cool. I like my watch. I use it to track rides and that's about it. And apparently that's all I'm ever going to do. Um, but you know that that's something and I'm, I'm, I'm happy with it. You know what I mean? That's the watch, but you, Frank said, I'm going to take the, watch a step further. And you, you, you built a, uh, an actual app, a full, fully. [00:08:44] Frank: Yeah. Yeah. I was actually a bit inspired by, there was a WWDC video and they were for the very first time, Bluetooth is allowed to run in the background on the wall. That is totally new. What would happen in the past? You would, uh, when your app launches, you have to go scan for a bunch of Bluetooth devices and then find one that you want to connect to connect to it, do all your Bluetooth thing, but watch apps, uh, get closed even faster than iOS apps. You know, all the user has to do is turn their wrist away. The timer is like a one minute timer, a two minute timer and your apple just get shut down. And so what you're supposed to do is a bit complicated because this is where my app was not robust. When I finished it after two days, what you're supposed to do is when your app is notified that it's coming back into the foreground, you. Don't scan for all the devices. Again, you just say scan for this one particular device. If it's found or not found, then you have to either scan for all the devices are not, you have to reconnect to it, but it should be a fast connection because iOS does all this magic stuff for you. It's it's honestly a bit of a pain. Did you put in all those smarts into your app or do you go into discovery mode constantly? [00:10:06] James: Um, for the Mike Hayden's yeah. Yeah. So how am I? Cadence works is I was using the Peloton app and the Peloton app. They, um, don't disconnect from Bluetooth. They just like go to, yeah, keep it going, keep it going. And I found this to be a problem because sometimes it wouldn't like reconnect or, you know, if you didn't, if you don't force close out of the app, It won't let go of a won't let go of the center. Uh, I'd imagine at some point in time it was, but this was kind of a pain when I was testing, because I would go between Peloton and another app back and forth and, and, and only one thing can be connected to that device at a time. So what I ended up doing was whenever the, the user, um, Basically navigates away. So if they, they, they close the app, they navigate inside the app. They put the app into the background. I disconnect from the Bluetooth sensor. And then when they come back into the application, they just hit start again. And that will, will reconnect to the app. So. The, or to the sensor. I mean, so what I do is you scan, once it saves the information, like your ID, all the information, it needs to reconnect. And then I just try to connect directly to that device. I don't scan again because I mean, I might scan again, I don't know how to make any difference. Like it can either connect or it can't connect. I don't, I don't quite understand the difference, but anyways, so I get it and then go, however, in the newest version that I'm in beta right now, Is I put a resume ride and the resume ride, um, for all intents just keeps all of your stats because that was someone's complaint is they're like, oh, I got a phone call in the middle of my ride. And then the app went into the background and then I came back and all my stats were removed because they had to like reset it and start with like, do a new session. So, um, I kept it simple, which is like disconnect when anything happens and reconnect when it happens. And I assume that people will just force close the app and then have it. [00:12:09] Frank: Yeah. Okay. So it sounds like you are doing it perfectly right for how you're supposed to do a non backgrounding. Um, Bluetooth the app, [00:12:18] James: because my app, remember it's not on the watch, it's on the phone. And the idea is that it is a, it's a number on the screen and you want to basically always be looking at that number because when you're doing spin classes, You're being told what number to hit and that number is constantly changing. So for me, I get lucky in my app that I have to worry about backgrounding or sending and transmitting data. It's like, it's just, it's just a. Display of it. I'm really good. Frank, I don't know if you know, apps that I write. They're very good at like displaying a number and it happens to change up or down. Like that's literally all of my apps that I do, my stream timer, my cadence, um, the island tracker is literally just displaying your turn prices. I mean, sometimes you get even a graph out of it, you know, it's awfully to you, but that's what I love to create is his number. [00:13:11] Frank: I think I was a little bit jealous of your single number apps. That's why I started working on my one wheel watch app, honestly, multiple parts to it, but I wanted to make my number of glorious and animated. I wanted to use a 3d engine. James, did you know that you can run, seen kit on watchOS now that [00:13:30] James: doesn't even make any sense, but that's amazing. [00:13:33] Frank: It really is. And you can write pixel shaders and do crazy. Yeah. I'm doing a procedurally generated grid and like all this code and metal, I think I'm coding it in metal. Who knows it's either open GL or metal and it's really great. The full scene kit, the full 3d system. Uh, that's on Mac and iOS is available on the watch. And so I, I said, James, I'm, I'm just displaying a number also. So I had to make it a little crazy. So I'm at least displaying the number in 3d with like cool and bossing and I'm adding reflections to it. So if you are just going to display a number, I highly recommend wasting an entire day playing with a 3d engine to display that number. Cause why. [00:14:20] James: Well, and that's kind of the cool part is like, now that you have the code, I could just steal your code and I could have a premium upgrade, which is like retro neon deluxe edition, which is like displays, you know, drain, drain your battery addition. [00:14:34] Frank: So I am a little bit worried about it being the drain, your battery addition. So here, here's my logic that I've had so far when you're actually using this app. This isn't like your app where you're just staring at the number, right. Begging for the time to go by so that you can stop paddling because this is miserable. One wheeling is a joyous activity and you are focused on the outside world and embracing nature. You only ever look at this app from time to time, mostly to see your battery and for funsies to see your speed. And so I figured I could get away with a little bit of high CPU rendering because it's honestly only on the screen for like 10 seconds or so. So no big deal. There might as well burn it. [00:15:16] James: Yeah, might as well go for it and talking about going for it. You might as well check out our sponsors by going to their website, sync, fusion.com/merge conflict. That's right. It's sync fusion there back. And they're here with hundreds of thousands of amazing widgets and gadgets and controls for your application charts, graphs, you name it, they got it. Excel, PDF image, cropping. I just got everything I've been using sync fusion for like over 15 decades. And they had literally everything that you could possibly want for yours. Applications, whether they're mobile desktop web, whether they run on, I dunno if they run on your watch, but why not? They've run everywhere. Frank. That's what I'm saying. They got something for everything. Don't call me on the watch stuff from sync fusion, but they got everything. I use them in my island tracker application. I've used them in my meta manager application. I've used them. At big enterprises, they have beautiful, wonderful controls, dashboards, and widgets and PDF processing, all that good stuff. You totally, definitely in your application. Yeah. Are you going to write your own? Just let sync fusion handle it for you. They've been doing it for decades and it's going to sync fusion.com/merge conflict. There's a link down there. You can just click on it. Boom, boom, boom. Tell them that James and Frank Sencha and check them out. They're all sorts of good stuff, especially with doing open source stuff or your, you know, um, uh, startup or, or, you know, uh, you know, independent business, take a look at all their different plans. They got whole bunch of good stuff. Community additions, things like that. Sync fusion.com/merge conflict. They say fusion right by the end [00:16:41] Frank: of this. Be fine. Thank you. Thanks, fusion. I mean, we talk about the, a number in a fancy way. Sync fusion. Has you covered there? They have all the fancy numbers. [00:16:50] James: Yeah. If you want a fancy number, boom. They got the fancy numbers. I, um, I love a good fancy number American. So you are doing this Bluetooth. So the Bluetooth, how does, how does it work? Because it's on the watch. I mean, you know, my watch literally goes asleep every five seconds or then come see a weight. So if it goes under the lock screen, is it. Like, does that the apple, the watch, like sort of stop rendering stuff? Or like, how does that work? [00:17:17] Frank: Yeah, pretty much as of today right now. That is how it is, but there is Bluetooth backgrounding coming out and watch the next, whatever, whatever the current beta is, you haven't installed it. You should know the version number. I don't eight. Eight. Okay. So in watchOS eight, you get backgrounding. Now, why would you ever want backgrounding for Bluetooth? Because I just described, I only intend for my app to be in your face for like 10 seconds. You want it because apple won't let us program the watch face. And the only way to get information on the watch face is to create a complication or to create notifications. No one wants a notification. So let's just, let's just push that one aside. Or at least I'm not going to write an app that puts a lot of notifications, but you could think like, oh, I don't know if you're monitoring your bread, making. Um, I don't know the lawnmower or something via Bluetooth, then maybe you would want notifications for different events like that. But I think the more interesting one is complications because now theoretically, you can update your complication data in the background and hopefully have that information displayed on the watch face itself. If the user has it selected. Yeah. Clever. Right, right, right. Cool. But the problem is there's a million question marks around all of it. And that's also why I'm writing this app because I'm just myself a bit curious in the past, um, complications got updated. Sporadically, randomly they work. If you haven't done watch programming before is you don't tell the watch what the display right now. You actually tell it what to display now and into the future. You want to cover yourself for at least a few hours into the future because your app may not execute for at least a few hours into the future. So that's the design of complications. They're meant to be a timeline, not just okay. But that flies in the face of real time information. What is my current battery status of the one wheel? What is my current speed? And in order to get current data, you have to be updating those complications. Again, apple won't give us a way to just say, update my complication, but you can update the data, cross your fingers, pray that it's a false moon and hopefully. The watch face will update. I'm really curious. I actually, haven't gotten to that point where I'm doing that update, but it's for those two things, notifications and complications, or I guess uploading to a server into a database that you could ever want. Background notifications. [00:20:04] James: Got it. Yeah. Cause, um, it's funny. Cause like other, now we'll go on walks and we're like, well, what's the weather and we have like a weather it's always different. Like, uh, her weather never matches my weather and it's like, oh gosh, would be like literally 25 degrees off. And I'm like that. Doesn't how, how does that even, you know what I mean? It's just, it's a, it's a hot mess. I, I, um, I try to minimize the complications. I don't want to make it so it might as the time the weather and then. My workout stats and that's it done? You know, and those workout stats I think, are on. No, they're not on the watch. They're on the phone. So they are slowed update as well. [00:20:45] Frank: I use a lot of my complications, three of them as app launchers. So just like my favorite apps, I put them at the, I found what I said, the modular or whatever. You can put three little complications at the bottom and those become the three little apps that I use all the time. That way they're single click away from the home screen from the watch face. Yeah. I like that. The problem is, I mean, I'm wasting an icon space. This is not supposed to be an icon screen. It's supposed to be a widget screen. And it frustrates me that there's just not information associated with that icon. This is supposed to be the most accurate time keeping device on the world existence. I don't know, obviously it's bad at weather, but I want it to be good at batteries. Is that so much to ask good batteries, [00:21:30] James: your batteries? I think that's completely normal. You know, what they need is they need a way of, instead of bringing up the. The button, stupid thing. They just need a way of having another screen. Like if I press the key, the circle key thing, the circular do you hit that should bring me first into a, let me pin four or five or six apps. Right. As I pop the bubble pop, and then let me, let me, you know, and say, show wall, come on, outro. [00:22:00] Frank: Pro tip out there. Uh, if you do use that little beehive of app icons, I really hate it because I can't remember an apps icon. I just can't. Um, you can actually switch that to a list mode and it's so much better James, because then everything's just an alphabetical order and you can actually find it. It's it's listed by name. What an innovation. [00:22:22] James: What's your, if you want you as I'm planning on it, because you cause it's so slow, but that's okay. I mean, you know, what the watch is for is for showing time and one week, one week, [00:22:34] Frank: Because it's actually really good at the one wheel speeds when it's running. Um, I was, I wrote Spacey my little space video game for the apple watch. And that's the kind of app that had to talk to the phone for absolutely everything. And it's a little bit frustrating to play. Like the graphics are a little slowly load. Every click takes a little millisecond pause or two. But when you're writing these watch only apps, I've actually been very pleased. Like. Uh, I don't know which version of a watch I have as a red ring on it, whatever that means. Um, apps run pretty well on it. It feels like an old iPhone or something like that. It's there it's running. What really kills me is that 3d? Yeah. Wow. I could have made that space game so much better. Now. I just want to like pour it over doom or something and play that on my watch, but I know it will absolutely kill the battery. I know it will, but it's, it's just so much fun, uh, having that there. So Bluetooth got to get it stable and then I'm just having an absolute joy time, uh, writing that single number display using a 3d app. If [00:23:49] James: you need to display a single number, you might as well make it look absolutely fantastic. I mean, mine is just white or black on the black or white background. [00:23:58] Frank: So it's a choice. It's a spiral. [00:24:00] James: It's a style minimalistic. It's more of a gray, not, it's not a pure white it's. Do you [00:24:06] Frank: change the font? Do you make it like a cool digital font? Nope. Just whatever the details he felt. Chains came with me. So that's what happened to me when I first wrote the app. I, I did everything that you just said. Default font white on black, minimal, uh, 1960s modernism. Yay. And it was fine and I was riding around and it was perfectly readable. It was just. Um, I wanted the app remember skew morphism. Remember when we used to design apps and try to make them look pretty and fun. Remember those days I miss those days and I just want to have a little fun making an app pretty and fun. Remember when we were talking about, um, Beep all of my apps, all of my original iOS apps had a sound for every command you ever did because it was early days of phones and all the original apps did that. Everything had a cutesy, little sound associated with it, and I just don't put that into my apps anymore. And it made me a little sad that I don't. So I'm going to start with putting some fun 3d graphics and, but I'm going to put some wacky sounds into, well, [00:25:14] James: I think that's the cool part is like your apps. To me. When I looked at the animation, I'll put that link into your Twitter tweet. And to me it looks like a game, right? It's not a game because it's just the speed of it. But it got that vibe that it was interactive. Like when you look at this, it's not only like going down this eighties, neon Tron. Path, but also there's like a sun or whatever. That's like moving and setting and it's like shifting a little bit to the left and right. So there's actually more than just displaying a number that, that looks like it's moving and everything is moving based on your speed. So things are moving faster when you're going faster. So it's very clever and you sort of gamified enough. [00:25:54] Frank: Yeah, but, um, I'm also, I have multiple numbers. You're, you're a little sensors. Give you a one number. I get lots of numbers. So I have, um, the speed. I want to display the battery. I want to display, but I'm also displaying the angles of the board because they have an accelerometer on them. It's a big, fundamental part about how these sports work and so. Um, as you're, uh, pitching the board up and down, the display will also pitch up and down as you roll the board left and right. The display will also roll left and right. And I did that. It's really not useful information when you're, when you're riding at any speed, you're basically level and you're not doing any roll because that's dangerous. You only do that during a turn. But what I found was it just made the, uh, app. Happier to see how responsive it was, because you could walk over and just wiggle the board with your foot and see that perfectly emulated within the app. So just trying to push that real time data into a form, that's something other than just a number, because as much as I love a gorgeous giant number in the middle of the screen, you can't have phones. Gorgeous numbers in the middle of the screen. All of a sudden you look like a NASA display for a space shuttle or something, and that's cool for some users, but most people want something a little more interesting. So finding clever, not too annoying ways to display some other bits of information. That's one thing I've always just loved in user interface programming it's uh, how do you display this information without overwhelming the user? Yeah. Fun to do that [00:27:31] James: stuff. Yeah, that's true. That's definitely. One of my problems is, is, is what you just said is it's easy to throw a bunch of number numbers on the screen. It's hard to put a bunch of different numbers on the screen and make them look pretty. [00:27:43] Frank: Yeah, you can make them look pretty. You can just hire a designer, they'll show you how to make a number to look pretty, but how do you make them informative and how do you spark joy [00:27:52] James: in the user's mind? I don't, I do, I do have a pretty graph with multiple colors. I decided. I had two colors, which was if you're above or below your average cadence, but then I had four colors, which is, are you in the bottom 25? Are you in the middle 25 to 50, 50 to 75 or over 75% like of the four colors? [00:28:17] Frank: I love those. I love multicolored grass. Are you failing in the craft or is it a line graph? I'm, I'm very excited for this. It's a [00:28:23] James: line graph, but then underneath it, the color. The filth to the bottom. Excellent. [00:28:30] Frank: Excellent. I love it. This is the one feature after our episode last week, I've been debating whether I need to put into my app, but I don't know, feature creep too much. I've already, uh, I spent two days getting it working, uh, one day, getting it working reliably another day, just playing around with the user interface. What should I spend my next day on? Well, [00:28:51] James: what I think it really does need is a. Is a phone app and the phone app would keep a history. Hold on, hang on, hang on, hang on, hang on there, Frank. It needs, it needs to, to be able to start a and they can track right. Attracts it, but then you can play back your ride. And what it does is it has a 3d. One wheel and it, and it shows you your curves, your, this your speed in real time. You know what I mean? Like, it shows you all this, but it could be like the same background, but like, but the, the one wheel and it's like, here's its angles and it's moving. It seems like it plays back. If you want to get real nutty with it. Like it would like do it, like on a real-world map or whatever, and you would just like cruise. Um, but I I'm thinking more of like, you know, those little, um, the, uh, what do they call them? The, the finger skateboards, you know, those. Yeah. But like that, but like, it's like, it's like a little skateboard. It's like playing it back. I just, I just figured, like, it's just like this little thing on your phone. I know, I know this is [00:29:52] Frank: just genius. I love, I love these kinds of ideas, but no, it's not going to go onto the phone. Uh, I believe you have access to cloud kit on the watch so I can upload to apple servers. There you go. Do it all wirelessly. So I could totally do that. Um, boy. Wow. That's fun. No, I'm not going to do that renter. Sorry. I'm a little distracted because one of my early apps I did start to write was a psych. Um, it was a driving app. And so you would put it in your car and it would record all your routes. Here's the fun part that it would do the next morning. When you went to commute, it would replay yesterday as a ghost car on the map and you would end up racing. To see if you could beat yesterday's time. And then I decided releasing a car racing app. Bad idea. That's true. I never released it, but I still, golly, I really wish I had released that out because it was really fun to try to beat your daily commute every day, racing yourself. [00:30:56] James: I feel like that would be more acceptable on a one week. [00:31:01] Frank: Um, [00:31:05] James: there's your next challenge, sir? Anyways, I had fun. I'm glad that you got the Bluetooth working on the watch. I think it's such a cool application and such a cool way of displaying all sorts of fun data. If you haven't seen. Hopefully you've seen it before. We started talking about 30 minutes ago. So go look at the tooth down below. Uh, it's super cool. Frank. I love everything that you make. It's all gorgeous and amazing, and I wish it had, uh, of your talent, but I don't. So we're going to end this podcast. So until next week there's been another merge conflict. I'm James Monson. [00:31:33] Frank: And I'm Frank Krueger. Thanks for listening.