Jon (00:07.621) Welcome back to another Gone Mobile. Alan, what are we talking about today? Allan Ritchie (00:11.842) Oh, you're jumping right to the topic today. We're right to the topic. Jon (00:14.169) Well, I mean, we should probably follow the template we have for a show, but you know. Allan Ritchie (00:20.928) you don't want to make fun of my coffee or anything today. Jon (00:24.213) No, no, I just wanted to, uh, you know, get my dad joking with template there and talking about. Yeah. Allan Ritchie (00:31.374) Okay, you want to open with that? So yeah, we're talking about dotnet templates today Topic that's somewhat near and dear to my heart somewhat Well, I make one but that's not the reason I'm it's because templates are good for my old memory So if you do a lot of mobile apps, which we tend to do I don't know about you, but I forget about things like the Android manifest and the info p list Jon (00:39.472) Why is that? Jon (00:48.843) Mmm. Allan Ritchie (01:01.906) I mean, hell, I even forget about the plugins. I don't even remember my own stuff sometimes. I'm like, oh yeah, I made one of those, didn't I? So. Jon (01:02.012) Yeah, there's a lot of items. Yes. Jon (01:09.029) Yeah, you know what? I hadn't really thought about that perspective. So if we're talking about templates, obviously there's Maui templates in the box when you installed that Maui. When we were building those templates and we talked to, I think a little bit on a previous episode with source generators and stuff where I think I had mentioned, you know, we had considered at one point, could we source generate some of the things that are in the template by default, like the app delegate or like. I, at one point I had thought. Is it better to have those things in the template or would it be kind of nice if they were just hidden from you and we made things work? I think we made the right decision by leaving some of them in the box because if you get to the point where you need to know how to do them, then like you're saying, oh, well, what does the Android manifest look like? How do I just scaffold that out, right? Allan Ritchie (01:59.754) Yeah, and if you had have actually generated those, I would have had some problems, right? Life cycle events, stuff that you guys don't bring out in Maui, kind of would have shot me in the foot. Although you would have generated as a partial, right? You would have been a good citizen about your source generators. Jon (02:16.069) We, yes, we would have made a partial generation of all those types and stuff, but then that does raise the question of, yeah, when I go to add those things, how do I know what to do? And actually that's kind of recently familiar too. I don't know if you've tried out some of the VS code support for Maui. Allan Ritchie (02:35.875) I played with it. I just I can't I can't quite get myself fully over because I still have a lot of dandruff. I'm waiting. Jon (02:37.199) Yeah. Jon (02:42.057) Right, well, and in early days, and honestly, I'm trying to remember if this got added in yet or not. I think it did. I think it has support for item templates now, right? So we can talk about the difference of those in a bit as well. There's multiple times, yeah. I think it has the item templates now, but I do remember early on at least, when you tried to use it, it was kind of like, okay, I need to add a new page. Allan Ritchie (02:55.01) VS Code has those. Oh, I didn't know that. Allan Ritchie (03:03.047) so we can't quote you yet. Jon (03:11.645) what, how do I do that? I don't remember what that looks like. And so like, you know, you'd go like find a file from another project and copy and paste it in. And yeah, so obviously at some level, templates are nice out of the box. Allan Ritchie (03:28.17) Well, I even on that topic, right? Like just making a XAML file, just making a XAML file. Do you remember off the top of your head, the XML namespace that goes at the top? Do you ever remember those? I sure as heck don't. Jon (03:40.353) Uh, no, I don't. I, and, and we changed it with Maui, right? It was a little bit different for forms. Allan Ritchie (03:47.906) even if we go up higher just the XML versioning and encoding I don't even remember those half the time I know it has to be there but if you asked me what it was thank God we're not in school anymore because again I'd be like yeah I know there's an XML thing that doesn't look like an XML tag but it goes right at the top it's always there Jon (03:50.57) Oh the... yeah... Jon (03:55.738) Yeah. Jon (04:06.061) Yeah, I would need open book tests for that, right? Yeah, so that's templates, you make some templates, there's some that come in the box. I've always also kind of debated back and forth, like, did you ever have the, I think in forms we had it too, where you do like a file new project and. Allan Ritchie (04:11.97) I'm gonna turn that speaker off. Jon (04:30.837) Sometimes templates contain a whole bunch of stuff in them. And like even the, the blazer templates, the project templates, they've got a couple of things, right? I think it's been pared down over the years, but there's like a counter example and maybe you can select different options for those templates, but I remember in, in forms day, always being like starting a new project and be like, I just want these things to get out of my way. Right. I want like the blank template experience. So like when. Allan Ritchie (04:44.835) Oh, I do remember that. I meant. Allan Ritchie (04:58.378) I know who we can blame for that. I got on his case about it was James Montemagno. I love you, James, but he argued with me about that. I'm like, I want to play template. I don't want all this junk in my face. I want it all gone. Get rid of it. Jon (05:02.955) Yeah Jon (05:11.993) Yeah, one, and it's kind of, I think, a progression of where you're at in understanding what you're working with too, right? For a new user to jump in and be able to see like, oh, this is kind of how things are laid out. This is how I would do some of these simple things. That's really nice. But then if you're like me, maybe what we should do, do you have a folder where you do file new Maui projects? You probably don't do this as much as me for testing random bugs. Allan Ritchie (05:38.854) Oh, I do more than you think. Jon (05:41.622) What's your count at? You know how it like automatically increments? Okay, I'm only. Allan Ritchie (05:44.546) Oh, I clean out the junk though. The reason I do that is that recently I cleaned out almost 400 gigs worth of bin obj folders. So I needed to go. Jon (05:54.457) Yeah, it adds up, it adds up. So if I check now, I'm at Maui app 32 only, but I'm pretty sure that I don't ever let that get over 100 basically, but then I delete them. Allan Ritchie (06:08.062) I'm a bit OCD clean about my computer. I'm weird like that. I accept that factor, but I usually get rid of them unless there are issues I need to track, right? But then I usually just upload it to GitHub. And even GitHub I tend to clean up sometimes because people are like, hey, this doesn't work. And I'm like, dude, I made that like five years ago. Let's get past it. Jon (06:16.506) Yeah. Jon (06:23.385) was never meant to. Yeah, so I think, you know, there's kind of the two worlds, right? And ultimately, maybe we need both of those worlds, like the one for, hey, I'm not sure what I'm doing, I'm new to this, I wanna start out, I wanna create a new project and have something that does kind of, you know, not just nothing. But then as you get used to doing that and then you know what you're doing, it's like, yeah, no, I just want the most basic. project set up so that I can do what I want and not have to go in and delete stuff as the first step that I'm doing, right? Allan Ritchie (06:55.198) Yep. I mean, I tend, I tend to usually get the stuff that's like the background jobs and the Bluetooth and all the 6 million permissions that come with that. It's never usually just UI. So, and I forget those. I, for the longest time, I would spin out my project and you'd install all the new gets, but it takes forever. I just wanted to be able to check some boxes and now I can, I can just whip these things out in record time. Jon (07:02.478) Mm-hmm. Allan Ritchie (07:23.146) Right. And you go to the documentation like, why am I doing this? I have to remember this. I don't remember. I'm too old. I can't remember this stuff. Yeah. Let's just put all the stuff I use. Let's put it in a template. It's great. Jon (07:28.153) Yeah, step by step by step. Jon (07:35.441) So what, you know, diving a bit deeper into that, like what do you all have in the box these days? So tell everyone a little bit about your templates. Allan Ritchie (07:45.41) So I have templates that started as, I mean, obviously for Shiny, I'm a big Prism user. You know, I love my Prism. So I had to have that stuff out of the box and reactive UI, which we're gonna talk about some, I'm gonna convert John at some point. We're gonna get him in Rx. I promise you it's coming. We're gonna do an episode on that. Anyhow, on that stuff. Jon (08:05.565) Yeah, we'll see. Allan Ritchie (08:10.738) I had to have that out of the box, right? So there's at least three or four new gets right away. Those ones are pretty easy to set up, right? You get your Maori program, blah, blah. It's a piece of cake. Now enter the permissions or the info P lists or the entitlements, right? I don't ever remember that stuff like ever. Jon (08:27.274) Mmm, yeah. Allan Ritchie (08:32.794) I don't ever remember what I have to put in anymore. I have to go read my own documentation. So I was like, okay, we're getting a little stupid. Let's just, let's just, you know, I'll put all my shiny plugins there and I'll have a bunch of check boxes and I'll go check, check. And then it'll do all that stuff for me. Jon (08:37.199) Right. Jon (08:49.333) And, and when you, and you know, like, yeah, you're talking about all of the different things and none of them individually are that onerous or difficult to do, right, but it does, the more that you kind of walk through every little piece, it's like even, even copying and pasting, you know, one line from here into there, another from there into here. Allan Ritchie (08:59.419) Exactly. Jon (09:09.681) That takes time by the time you go through it. And it's probably really easy to miss or, or slightly, you know, do one step wrong or something, right. And then you end up at the point where your app's running and you're like, Hey, I'm good. I've done this a million times. And you don't know why something's not working in. Maybe figure out only after hours of debugging. Oh, I missed this line or I, I pasted something incorrectly, right. Allan Ritchie (09:18.592) Exactly. Allan Ritchie (09:28.366) I'm going to go ahead and turn it off. Allan Ritchie (09:31.966) And it really is that easy. I've done that before. I think I was telling you last week how I was losing my marbles because I missed one line of something. And I was like, okay, that's going in the template too. So I don't forget. All right, let's grow up again. Jon (09:44.141) So for things that go in the platform files, so you mentioned Android manifest, there's the info plist on iOS, these types of things, the titlements, yeah. And so we have some of these things in a new Maui app template, and they're there for you to edit and everything. I've always gone back and forth on sort of the, like where's the right spot for people, one, for people to learn how to actually. Allan Ritchie (09:51.342) Occasional entitlements. Occasional, yeah. Jon (10:12.517) use those things, right? Cause if I'm following some documentation for like an Android thing, they're gonna tell me the XML to put in my Android manifest. And that's pretty easy for me to manually do, you know, one-to-one, but I also kind of always prefer that kind of stuff is in my more.NET kind of area. So like for Android permissions, forever you've been able to use an assembly level attribute to do some of the manifest stuff. What... Allan Ritchie (10:24.056) Yep. Allan Ritchie (10:39.438) true. They weren't working for a while though but now they're working again. The challenge there, so if you do libraries, so it's a good segue, I'm sorry to interrupt your thought, but this is a good one and I love that you said it because there are cases where people don't want you to auto register those permissions because they may not be ready to take it them yet. Jon (10:45.465) Okay. Jon (10:50.241) Mm-hmm. That's OK. Jon (11:01.603) Right. Jon (11:05.947) Yep. Allan Ritchie (11:07.226) I don't know. I've heard a whole whack of reasons and they actually made quite a bit of sense, right? Like don't do the magic for me because... Jon (11:11.321) Yeah. Right, I had that with, when I did the old, old zebra crossing barcode scanner thing for Xamarin.Forms, I had included camera permissions, I think, by default, which seems logical, right? But then somebody came along and was like, well, I'm only using the library to generate barcodes to display, so I don't want this permission. Like, oh yeah, that makes sense, but there's unfortunately no easy way, you know. Allan Ritchie (11:25.61) Yep. Yeah. Allan Ritchie (11:34.825) Yeah. Jon (11:40.813) I could, I don't know if I ever removed it or not, because that's kind of a weird breaking change for people who already depend on it. But anyway, good example of not wanting it for everyone, right? Allan Ritchie (11:46.482) Yeah. And you don't want to deal with that. You're not going to want to deal with that. Like I just, you're going to use it for the scanning mostly. Right. So why are you going to separate it just because of this one? I don't want to call it a random use case, but it's certainly an edge case. Right. Jon (11:56.474) Right. Yeah. Jon (12:04.281) Yeah, and there were tricks to prevent that, right? It hasn't been around that long, but I know I think even in Xamarin Forms, eventually there was support to use, like Android has this concept of manifest merging and there's like weird XML stuff you can do to say, hey, I know that the manifest comes with this, but I actually wanna like remove a node or change the value of something. Allan Ritchie (12:29.058) That's right. Jon (12:30.041) So there's rules you can kind of write to influence your build that way. I know I've seen people try and do stuff similar to that with like injecting version numbers and stuff into their app as they build it. But that's all kind of hard and messy. So that's one reason why I've kind of liked the idea of trying to do it in that more.NET space. But you're right, that doesn't really give you the flexibility necessarily to, especially like an assembly level attribute, you can't. really conditionally include that super easily. Yeah. Allan Ritchie (13:02.27) And then the things tend to change, right? So if you think about like SDK versions, right? So they've started doing that. I want to say around, you know what? I'm not even going to guess because I can't guess, but you started having to put like the minimum level and then it's supposed to cut over to this next level of permissions, right? So those attributes weren't caught up right away. Jon (13:21.455) Yeah. Allan Ritchie (13:25.354) At the end of the day, I finally just decided, you know what, let's just do this in the man, the Android manifest because that's easy. This is the one stop shop of everything we're going to put in. And the challenge became there is that as you, as I started adding more and more of these plugins, which I did, I started going outside of shiny because I use a lot more than shiny, including zebra crossing, by the way. Jon (13:34.894) Right. Allan Ritchie (13:50.898) and I started putting them all into the manifest, but then you get duplicates. So then your template had to get smart and go, well, if it's this, or this include these permissions. Right. So it. Jon (13:54.513) Right. Jon (14:02.553) How do you do that in the, I mean, I know it's all, it's all open source, right? Your template work. So, but I'm curious, like, how do you, does the template engine have enough for you to go and like do some stuff afterwards where you can, I don't know, do you get to run code? Or like, how do you reason about editing that manifest? Allan Ritchie (14:07.38) Yep. Allan Ritchie (14:23.302) So the templates we're talking about today are part of the.NET SDK, like the.NET new. There's other ones, there's like the old school Windows ones that build into Visual Studio. The.NET new ones that I'm working with, they're a little bit better because they still hit VS for Mac. I know we're not supposed to say that because it's old and dying, but... Jon (14:28.067) Mm-hmm. Jon (14:42.369) Mm-hmm. Allan Ritchie (14:42.846) It works there and you can make it work in the command line and you can make it work in VS for win and eventually I'm hoping maybe John will give us a hint if he has for VS code. You may not even know that because that's outside of Maui right but. Jon (14:55.377) I think, yeah, I was really involved with the initial sort of prototype of the Maui support and VS code. And then, as I have trouble finishing projects always, it was nice to be able to hand that off to the team that helped really turn it into productize it and tidy up all the loose ends and really make it what it is. But at the time I know we were, I think the templates were like hard coded in at some point. But I know there was like, Allan Ritchie (15:23.496) Okay. Jon (15:25.317) That was a, hey, like let's do things. Like let's iterate rapidly, right? And so the thought was always, yeah, down the road, we definitely wanna make that a better experience. And I don't know if that's happened or not yet. Allan Ritchie (15:36.982) So I mean, there are, you can use.NET command line with.NET new and build your project and have some validation and stuff. But really it was about like getting in that, all those conditional stuff, right? Which is what you're asking. You can write essentially if statements in comments, right? So if you're in a markup type file, you'll do your comment out XML. What is that? Pack me in. Jon (15:43.175) Mm-hmm. Jon (16:02.083) Mm-hmm. Allan Ritchie (16:05.654) bash dash you know so you'll do stuff like that you'll put like a compiler statement like a hash sign if and do just variables right so every check box you name is essentially a variable right you can do string variables Jon (16:05.717) Yeah. Jon (16:15.564) Okay. Jon (16:20.249) Right. And so you're, you're going to like combine a bunch of those. Cause you were talking about, you know, having like duplicate entries and stuff. So presumably every new thing you add is kind of like, okay, if, if this permission is going to get added, you know, it's kind of like any of these variables that get checked gets it added in. So you don't duplicate. Cool. Allan Ritchie (16:35.638) Yep. Well, and then there's also some dynamic choices, right? So like a maps, I'm not gonna have two map libraries, but I support like there's Google maps, because sometimes I want Google maps, there is an open source library out there and I want it on both platforms or do I want the Maui ones, right? So they, you can do conditional logic, like a single flag and merge them. So I have like a uses map that checks both values and then that becomes a variable throughout the template. Jon (16:41.841) Mm-hmm. Jon (16:47.727) Yeah. Jon (17:00.619) Right. Allan Ritchie (17:04.374) which is fabulous, right? There's other logic they have. So if you wanna take like an App Center key, that's a common one that I take. And if I fill that out, I want it to include the App Center library, and I also want it to search and replace a specific variable. So you say this is the name of the variable as a string, and it'll go through your whole project and search and replace. So the templates are actually extremely powerful like that. It's awesome to be able to just... Jon (17:06.074) Mm-hmm. Jon (17:12.794) Yeah. Allan Ritchie (17:32.822) do this stuff with a minimal amount of work. And at the end of the day, when you're done and you've tested them, you can just wrap it all up in a Nougat package and ship it. I mean, it's crazy. It's extremely helpful. And I don't know, it's the time savings for me has been killer. Cause I tend to do a lot of POCs as well. Jon (17:42.48) Yeah. Jon (17:51.837) So do. So are you kind of going back to the question of like how you manage putting things in the right places, like for Android, for Android manifest, are you actually dynamically sort of adjusting the content of that file that gets created then? And do you do the same like info.plist? Like you're not trying to do any of those things in, are you doing any of them in like build targets or build item groups and stuff? Allan Ritchie (18:23.09) Yes. Kind of the cool way. I mean you guys do I think you include a basic entitlements now right? Problem is this yes Jon (18:31.457) Yeah, yeah, because entitlements are hard because they need to have different things for different scenarios within the same app, right? Allan Ritchie (18:41.214) Right, so think about push. You know, we've talked about that in the past. For debug, you need to point at the development environment for iOS push. For anything release, you're probably pointing at production, but then you've got any slight variables in between, so I don't know. I think you filed the bug with the iOS team. Jon (18:45.149) Mm-hmm. Jon (19:01.345) Yeah, so when we, yeah, when we figured some of that out and then like Catalyst is a whole other thing where if you want to do like inspect the web views for like a Blazor app in Catalyst, you need a certain entitlement. But that doesn't work if you want, if you put it in your iOS app. So we ended up with, I think, you know, four different entitlement files that were going to go in the template and that seemed excessive. And not just the files themselves, as much as the Allan Ritchie (19:14.151) Oh yes. Jon (19:31.301) um, entries in the CS project. So those, all of those files had like conditions on there include in the CS project and like a file, new template. And, and I really, I have a thing. I really want the project file to be small when you start, like if, if it can, if you know, if you're doing something like your templates and your choices cause a number of things to get included in there, that makes sense. Allan Ritchie (19:47.437) Yes. Jon (19:57.413) But I don't want to have like four different property group things with different, you know, or item group things with different item includes with conditions that, you know, condition around like the target platform, which if you look at that condition in a new project, like that's kind of a gnarly strain too, right? That's a whole other topic where we're, I think there's been talk and continues to be talk about getting people to, or getting that, you know, a little bit. Allan Ritchie (20:17.066) Yep. Jon (20:26.969) neater, less verbose. But at the end of the day, yeah, all those files, I'm just like, can we do this in a better way? And so I think out of that, Rolf on the iOS team basically is like, yeah, well, I'll just add some item groups and you can include entitlements right in a certain item group and those will automatically get added to the right file, right? Yeah. Allan Ritchie (20:47.97) Which is awesome and the reason it's awesome is because while you were gonna include four entitlement files. That's great for, well, I don't want to say it's great for out of the box. It's all right. But if you think about like, there's companies I work with that have a lot of build variables. I'm working with one right now that has a lot of build variables, right? So those files become exponential, right? Because you have to code it for each case. So this current company, I would ended up with like 32 of them or something. So that's probably not sustainable. Jon (20:58.843) Yeah. Jon (21:06.65) Yeah. Jon (21:10.651) Yeah. Jon (21:17.325) Yeah, or you could have done like a weird, you know, build step to like it just, it's messy to try and do that, right? Allan Ritchie (21:22.162) Yeah, and it just didn't make sense. But when you had filed this bug to say, Rolf, can you make this easier? He already had a solution and I don't even think it's documented anywhere. And I was like, oh my God, that's the answer to my prayers. That solves all the build issues in one shot. So I started following that path. So when I, not only do I generate the entitlements, but I do it in the CS proj so that people can grow their... Jon (21:32.026) Yeah. Jon (21:37.371) Hehehe Jon (21:50.694) Yeah. Allan Ritchie (21:51.07) You know, those rich build variables, because that's what I end up doing, right? Is all these rich variables. We're entitlements, just your easy entitlements, like a debug and a release version, they just don't cover enough of that, but when you can do them programmatically and generate them with all the if conditions, Oh, it's, it, it scratches an itch. That's for sure. Jon (21:55.42) Yes. Jon (22:10.653) You know, this is another kind of sidebar, um, but I I've been meaning to, and I've never executed on it. One of the, my, the things I'd like to do, maybe I'll, I'll tackle it this year yet is to develop, not develop, create a, uh, you know, a talk for a conference or something or a session. That just goes over like, get, learn a little bit about. MSBuild and CS project files and targets and properties. Because I feel, and this is what I think why I had such a strong reaction opposing adding more stuff to the default template. Because I think historically people look at those files and I think this conversation is actually still applicable to templates because I think people have looked at those project files and just like deer in headlights, right? Like, Oh, I don't know what to do with this. This looks really complicated. And if Allan Ritchie (23:01.814) but they were traditionally huge. Jon (23:04.089) Well, I was going to say, if you go back some years, not that far, obviously, just in the Xamarin timeframe, right? Those project files, they were gnarly and there's like, you know, quids in them that you're like, why is that? What does this mean? Why is it here? Project type, guid. And, you know, like eventually I feel like I started to memorize those quids and know to look and be like, yep, that's a, this type and that's okay. Or that's not, but yeah, people have kind of developed a a fear, I think, of these project files. But now that we have the SDK style project, I think is what they were called originally, they're shorter, they're much simpler to understand. And if you learn just a little bit about some of those basics, like how an item group works and how it's different from a property group and how to include and exclude items, and you can go down the rabbit hole, but I think if you learn just a little bit, Allan Ritchie (23:40.32) Yeah. Jon (24:00.921) you can start to do some really interesting things with your own projects like that. And we get questions like, even in a Maui project, maybe you've got an image that you're using for your app icon as a good example. I know I've, on Android, my app icon, I think I used the fancy foreground and background icons and it figures out how to turn that into the right Android equivalent that supports that concept. But on iOS, they, like, iOS doesn't really have that concept of like a, what do they call those icons on Android? There's a term for it. Allan Ritchie (24:40.886) don't remember. There you go. Yeah, yeah, yeah. Good memory. Jon (24:42.113) Adaptive icons, right? Is that it? Okay, we got there. Okay, whew. So adaptive icons, but there's not really a concept of that on iOS. And I forget the reason, but at some point in my app, I was like, yeah, I don't really want it. Like, Maui tries to kind of do the work for you if you specify both so that you can have those on Android, but then you can just have the one generated for you for iOS because iOS only has like, the one image has the icon. I think I didn't like the layout differences between the two platforms. And so I'm like, well, I wanna do it slightly different on iOS. Well, the easiest way to do that is just to go in your project file and use conditions, right? Like just, if it's Android, I'm gonna include this one. If it's iOS, I'm gonna include this. And, you know, it just works. Yeah, yeah. So I think that, yeah, trying to... Allan Ritchie (25:21.427) It triggered you, didn't it? Allan Ritchie (25:31.786) It triggered you. It triggered you for sure. Jon (25:40.437) One, keep template or project files in templates shorter, smaller, more concise is helpful to the goal of having people understand a little bit better of what's going on in there. But, and then also to your point, if you're generating, if you're creating a template and there are some things that you can do that makes sense to do in the project file like that, like those entitlements and stuff, like that's going to help people learn and get more comfortable with, oh, I checked these things, this is what I... got and now I understand how to go in and maybe add a new one if I need to. Allan Ritchie (26:14.858) I know at one time we were even talking about putting, and I did a PR for this and it's sitting there because it's a big one, right? You remember when we were talking about permissions and we were gonna put them in the CS proj as well. So we'd put in like Bluetooth LE or, yes I did. Actually, no, I did a feature request and I said, go over here, cause I built it. Jon (26:22.637) Still hoping. Jon (26:27.353) Yeah. Oh, did you actually do a PR for that? Yeah, it's been a while. Uh, well, huh. Jon (26:36.299) Okay. Allan Ritchie (26:37.03) And then I know you guys were like, well, this is a big one to take on now. And at which I get it, it wasn't. And you know what, when I think back on it, because of the way the Android system continues to evolve, this is where the templates really take off for me. Um, to kind of wrap up, wrap back into why templates are so good. It was the Android evolution of permissions. I mean, just between 13 and 14 was like a, come on guys, really. Right. And. Jon (26:41.915) Yeah. Jon (26:54.726) Mm-hmm. Jon (27:02.597) Yeah, there was a lot. Allan Ritchie (27:05.766) So you guys would always be rushing to catch up on this. And it just, well, it seemed like a good idea at the time. It becomes, it's good for users. Yes, it's easy. But it would be work to keep it up. to date, like even permissions now. I mean, it's good that you guys have that pluggable permissions that set in essentials. But even that, like people are asking, Hey, can you update this? And you're like, Yeah, we'll get to it. Just take a breath. In the meantime, you can make your own. Yeah, right. Jon (27:23.707) Yeah. Jon (27:29.742) Yeah. Jon (27:35.821) Yeah. In the meantime, you can help yourself. Yeah. And that API, I remember when we designed that, uh, I think it was like Matthew and I that, that were in James, uh, when we all, three of us made the original Xamarin Essentials library. That was very intentional to be like, we know that these change like crazy. How can we make it in a way that people can extend it themselves? And so, yeah, it's like, well, there's a pretty easy workaround. You can just do this. But, and the same, but the same would be true for. the project template stuff, right? Like, you know, maybe the way to do that would have been to have some kind of escape hatch of like, we don't have the cross-platform key for all those permissions, but maybe there's like the Android specific one that you could add with conditions or whatever. But that actually raises a good question. I don't think there's a way with Android to affect those from the MSBuild side of things. Is that true, Dino? Allan Ritchie (28:07.841) Yeah. Jon (28:35.417) Like, can I declare somehow a permission in Android in an item group and have that flow through for me? Okay. Allan Ritchie (28:39.125) Oh. Not that I know of, unless the Android team is hiding something like Rolf and the iOS team was. Jon (28:48.793) Yeah, I don't think there is something. I know like we talked about the C sharp kind of version of it, but that's not quite the same. Allan Ritchie (28:54.366) And it's not the manifest isn't quite as dynamic anyways. Like you don't really need the if conditions, um, like you do with entitlements. Apple's a bit more painful there. And then you have to match your provisioning profile up and you're like, Oh God, somebody shoot me now. Right. Whereas the manifest is just, you need the permission. That's it. If you're going to use GPS, you've got to include the, however many flags it is now. Like it's not optional. And if you don't call them, you don't call them. Jon (28:58.318) Yeah. Jon (29:04.697) Yeah, no, that's true. Jon (29:09.607) Yeah. Jon (29:22.457) Yeah, they need to be there. Allan Ritchie (29:22.814) I mean, you should call them because it's going to go to the app store and it's going to say this app does indeed have these permissions, whether or not it uses them. Figured out actually that going back to the attribute. That was the other one. Right. So if you guys had have included the permission attributes in essentials, for example, and it didn't trim. It would have gone to the store and said, well, this app needs permissions for everything under the sun. Meanwhile, they're using Jon (29:45.82) Yeah. Allan Ritchie (29:48.554) I don't know, maybe just the device display measurements and they're not touching it. So that's another reason why the attributes would have failed, right? They just would have been too much and people have been like, I don't know. And iOS used to flag those down. They're like, why do you have, why do you have this there? You shouldn't have that there because you're not using it. Okay. And they would even fail on that. I think they're a little bit more lenient now. Jon (29:55.879) Yeah. Jon (29:59.653) Yeah, what do I do? Jon (30:07.321) Yeah, exactly. Jon (30:12.141) Yeah, I think so. But yeah, it can still get weird if you're trying to, you know, say that you're going to do things and you're not doing them or vice versa. So, and you definitely have to watch out for that. Allan Ritchie (30:22.966) Well, as with any new app you send to Apple, you gotta sacrifice it like a newborn or a pint of blood to get on there. So it's just kind of part of the process. It's part of the fun being a mobile developer. Jon (30:27.491) Yeah, yeah. Jon (30:34.693) Um, so we, you talked about, we've talked about like permissions and entitlements, uh, and new get packages. Is there other stuff that your templates generate in for you? Did we miss any parts? Allan Ritchie (30:51.53) No, but I guess the only thing is, is that I said I started with Shiny, I did Prism. You know, I love that you guys have Shell, but I'm a Prism fan. I love Prism, it works. So I had to include that. But it quickly grew to be just like community wide, because there's a lot of stuff I use. Like everybody uses SQLite, PCL, Net. I get that backwards. I think everybody. I just get that one reversed. Anyhow. So it's in a template. Jon (31:16.937) Yeah, one of the two. I like that there's still PCL in the name, but you know, I mean I get it. I get it. Frank probably doesn't want to lose the association or like people that's what they look for right so. Allan Ritchie (31:21.526) You're right. Allan Ritchie (31:29.374) Right, it's been around for a long time now, right? And then there's other great packages like Gerald's. I'm not even gonna try and pronounce this now, because they never do it justice. You know it. But there you go. Jon (31:33.276) Yeah. Jon (31:41.937) Gerald V. No, yeah, Gerald has built some cool stuff. So he's gone more the route of the plugin kind of template, right? So like, if you're gonna go build this, we call them plug-in, or people have adopted plugins. I think that was kind of James, you know, spearheaded that, which was an easy way to identify what, oh, did you? Sorry. I didn't know. I gotta learn my history better. I had no idea. Allan Ritchie (31:51.669) Yeah. Allan Ritchie (32:03.886) I was sitting there too, Jesus. Allan Ritchie (32:08.598) him and I had a con- had a- battle going on for who is going to release more at the time. Going back. Jon (32:16.846) All the plugins, but that was successful because I think a lot of people have learned, hey, if I go search for plugin, you know, I kind of know that's probably going to be something Xamarin or now Maui related. So yeah, Gerald has that template out. We'll put links to all the ones we're talking about, of course. And Allan Ritchie (32:24.343) Yeah. Allan Ritchie (32:33.858) But Gerald also has a whole bunch of really well done actual plugins out of that template, right? Jon (32:39.205) Yes, yeah, and that was I think, you know, the learnings going back and probably the same thing I think right as you like hey, I use these things all the time. I'm sick of Starting from scratch and going back and copy and paste in and remembering so let's just build the thing and use it that way I even built a I didn't end up releasing it because I think I started building a pop-up plugin and I so I pulled his template to use it like a pop-up page plugin Allan Ritchie (32:50.754) Yep. Allan Ritchie (33:08.795) Oh, yes. Jon (33:09.201) But then I kind of reduced things enough that I'm like, this isn't really a plugin, this is just using a page and setting a couple things. There's no need for a plugin here. And so I had a blog post on how to do it instead to use just normal Xamarin, not Xamarin, Maui pages in Xamal and making them translucent popups instead. Yeah, yeah, I use it in my app. Allan Ritchie (33:32.606) I do remember that you had a nice little toast that came up from the bottom. That was only a couple months ago. Jon (33:37.645) I had problems with some of the plugins out there on all the platforms working how I wanted them and I'm like, you know what? What if we just do it more simply? Anyway. Allan Ritchie (33:45.639) To put that out there, though, he was going to write it from scratch anyways, because that's what John does. Jon (33:49.385) No, I was using a plugin and it wasn't working and I tried to debug it and I couldn't figure out why it crashed on Catalyst and couldn't if I tried to build a smaller repro and so I that's where we are now. Allan Ritchie (33:52.649) Eh. Allan Ritchie (34:05.067) That's all right. Gotta love John because he goes out and events things that fix it, fix things for us. So that's all right. But he's in denial about it. He's in denial. Jon (34:09.509) Yeah, yeah, and I even wrote the blog post this time. Yeah, so there's Gerald's thing if you're making an actual plugin that you wanna publish to NuGet and share with others and it makes that part easier. What other ones are there out there? Allan Ritchie (34:28.038) There's an individual, what's his name here? I think his name is Vijay. He makes, I think he makes probably one of the Uber ones. I think it's, and correct me, I haven't used it obviously because I have my templates that work for me. But I. Jon (34:40.333) Mm-hmm. Oh yeah, Mr. Hey, look at this guy who builds his own stuff for everything using your own templates. Allan Ritchie (34:48.294) I knew he was going to hit me with that. But it works for me. It has all, I think, and forgive me, I think his name is VJ. I think his is more the pretty template, so it's built right into Visual Studio. I think there is a.NET new, but he does a lot of that stuff, like setting up, you know, the Android stuff. Allan Ritchie (35:10.702) pretty much everything. He targets Windows. I don't target Windows because I don't use that personally, but he does all of it and that's fantastic. So that's out there. It looks like he's been, I'm just looking at the GitHub, which we'll add as a link. It looks like he's really been iterating on this and adding a lot of good stuff like shell pages with razor. Wow. Take a look at the link. He's been busy. That's for sure. Jon (35:14.292) Uh, yeah. Jon (35:31.281) Mm-hmm. Allan Ritchie (35:39.362) This is probably one of the ones that's good. It looks like a lot of item templates, which is fantastic. Jon (35:44.473) Yeah, so do you wanna talk about that briefly? Segway into it. Like there's, we mentioned it kind of, there's different types of templates, right? There's the whole project and then, you know, that's when you're starting from fresh. But the other thing is, is those item templates. So when you go to add, like we talked about, like if I'm gonna add a new XAML page, like I don't remember how to do that. So within the project, when you do like add a new item, there's that whole other category of templates. Allan Ritchie (35:52.492) Right. Allan Ritchie (36:09.518) Great. Jon (36:09.761) And so Maui ships with like the XAML content page, XAML content view, the C sharp version of both of those. I don't know if, I think we have some other stuff too. Each platform has, I think some of their own as well. Like I don't know if Android still has like a, yeah, yeah. Allan Ritchie (36:23.054) like an R ESX file, right? Lots of little things that's out there. So I only have a couple, right? Like if you're doing like a job, so Shiny has jobs, right? I have a little template there that you can say create a job, whoopee. It just basically it's helping you. This is what you need to reference. Here's some namespaces to help get you started. Jon (36:35.594) Okay, yeah, yeah. Oh, that's cool. Allan Ritchie (36:47.21) Here's some basic text because it's also good. You can document right in there for the users because it's just the same old, like here's a text file, replace it. It puts their namespace in. So you're not offending anybody, right? Name spacing is a fun argument, right? So it, it does all that for you and it's great. So this one has a lot of item templates. Now, when we talk about.net new, there's kind of three phases of, of templates, there's solution. So you can generate like a massive solution with like an app and Jon (36:50.777) Yeah. Jon (36:58.297) Yeah, yeah. Yep. Allan Ritchie (37:16.494) kind of a whole bunch of project references if you want. So if you're going into enterprise architecture, it's great. I usually don't go that route personally. I usually do like a blank solution and start adding projects because then it gives you a little bit more fine-grained control of how you wanna do it. And then you'll have templates for your server and templates for your Maui app, et cetera. So that's how I do it. I don't do the solution templates. And then like I said, we just talked about item templates. So they're part of that. Jon (37:17.669) So like multiple, yeah, multiple projects in it. Jon (37:32.678) Yeah. Allan Ritchie (37:46.75) Now the other part to it is, well I said we've got these.NET new templates. There's also ones that you could build like kind of the old school way, build it into Visual Studio. Visual Studio has pretty rich mechanism there, so you could do a lot of dynamics. So there's another one by Matt Lacey called Maui App Accelerator, which I think is extremely popular. It's a lot more user friendly. You could build a lot better interfaces than with.NET new. Jon (38:10.606) Okay, yep. Jon (38:15.289) Yeah, I've never tried to build one of those types. Can you like go to the extent of like, do you throw some WPF, you know, pages or something in to do that? Or win forms, yeah. I mean, if it's VS, it's likely, I would guess, WPF, but. Allan Ritchie (38:23.747) Yet or is it Windows forms. I'm not sure. Allan Ritchie (38:31.47) probably and it builds into VS for when there was a Slightly less documented version for VS for Mac, which I know a lot of people still did I think these ones do it don't quote me on it. I haven't looked But you're able to do much nicer interface and a lot more dynamic, right? So for instance, like my template is it's flipping huge. It needs a scroll bar, right? It's it's that long I think it does now it didn't Jon (38:40.378) Right. Jon (38:48.881) Yeah. Jon (38:55.614) But it does the scroll bar at least for you, right? Like they planned it. Oh yeah. Allan Ritchie (39:00.666) I had to actually contact and say, can you guys add us? And I think it got the attention of some of the guys going, oh, you're using this to that. Yeah, it'd be nice if you could include some validation or maybe some. If this is checked and show this, but they don't have that yet. So anyhow, with the extensions, it's just like writing an app. So the challenge is. Jon (39:02.585) And like, hey, yeah. Jon (39:08.327) Yeah. Jon (39:15.983) Right. Jon (39:21.005) Yeah. But that's a lot of work to do too, right? And then to keep up with it. Allan Ritchie (39:25.918) Right and well VS if yes for when I think it's pretty easy it doesn't look like it's changed at all But you know VS code is coming which I keep hinting John find something for us. Give us a give us a thing, right? Is it coming? Jon (39:39.661) Yeah, the VS code is an interesting one though too, because the sort of the goal or maybe you wanna call it mission statement to an extent of creating the VS code extensions for both.NET, like the plain CS DevKit, but also the Maui DevKit one as well, was really the internal conversations were really around like let's not, like let's do this slowly. and wisely and don't go in assuming that we're trying to copy the VS Windows experience over to VS code because VS code has its own sort of UX guidelines and ways that developers expect to interact with it. A lot of that revolves around command line stuff and like commands in the command palette to execute command line things. So. Allan Ritchie (40:25.355) Yep. Jon (40:35.533) I don't know that we'll see necessary. I mean, I'm not involved in the planning for it, so I can say this with enough ignorance to know that it's either true or not, I have no idea. But I don't think we'll see any movements anytime too soon around trying to recreate a UI around that. Like the flow of VS Code is very much like if, maybe what we would see is, hey, like new project, and that would open up the command, like the top. you know, input kind of thing where sometimes it's a list, right? And you can kind of start going through selections that way. That would be kind of the VS code way to do it, but that becomes rather lengthy if you have all of the options like you do, right? Like imagine that thing popping up like, I don't know, 50 times or something. And you're like, yes, no, yes, no. Allan Ritchie (41:24.338) Yeah, it'd be pretty annoying. And trying to remember all the command line switches for... You wouldn't remember. Jon (41:25.965) Yeah. Well, that was my next question, right? Like the command line stuff, do you, can you only, do they have any interactive mode yet at this point? I can't even remember it. Okay. So yeah, like Allan Ritchie (41:38.374) No, it's just you say the argument you can you can validate it and say look dude you didn't supply this forget it like this is this is a requirement but that's about it like there's not a lot of validation in these we're talking about like.NET new templates is basically drop downs so multi-select check boxes and string replace like that's about as rich as it gets now that's awesome for a template but try doing that all those switches in a I mean my templates don't even Jon (41:45.305) Yeah. Jon (41:54.084) Right. Yeah. Jon (42:02.547) Yeeeah. Jon (42:07.185) Right. Allan Ritchie (42:07.562) Right. I have to scroll down. It's like two pages now. So like I don't know how I do that at command line. I'd almost be having. Jon (42:14.977) Yeah, no, at that point, it's not really useful in a sense, because I guess maybe you have, here's an example command that you could copy and paste with every option, right? And then I can go and just put that in a code editor, replace my values, and then go and paste that in, but yeah, that's hard. Allan Ritchie (42:35.414) It's a lot. Now you're remembering the command line versus remembering the actual manifest and stuff. It's like, it's not doing it justice anymore. Exactly. Jon (42:39.329) Yeah. Yeah, you've kind of traded one problem for another, although maybe it's still a smaller problem to try and figure that out. Allan Ritchie (42:49.226) Now my shameless plug is if there's anybody out there, so they're called the shiny templates, but I'm trying to make them more community. Actually, John's already given me a bit of crap because I don't have his virtual list view, which actually recently solved a good problem for me. And he wants to get it out there. So I have to put it in. It's listed. It's all my to-dos, man. It's all my to-dos. Jon (43:00.401) Oh, yeah. Jon (43:07.837) That's an easy one. It's just a NuGet, right? Oh, here's a question. Do you do anything around, like, so my ListView plugin has a, you have to, like, do the app builder, you know, use Maui virtual ListView call. Do you do that stuff? Nice. Allan Ritchie (43:21.21) Oh yeah, that's all in there. Oh yeah, and the namespaces. I may even put it in the global namespaces if it's one that's kind of more backend based. Yeah, it's all there. You don't have to do anything. You just have to remember it. Then the namespaces are dealt with. The registration and the Maui program CS is done. It's great. I don't have to remember anything anymore. So if you're asking me a question, don't ask me a question, because I don't know anymore. The template does it. Jon (43:28.733) Wow. Yeah. Jon (43:33.19) Well, that's cool. Jon (43:42.63) Yeah. Well, and that's truly the point, right? You like, you... Yeah, you wanna, you wanna, and that's why, I mean, that's why we use these things at the root of it is to have to not remember or to not, not know, but I mean, not know the exact thing, right? Like I, you know the concepts and when you see the code, it's like, yep, okay, but I don't need to memorize it. Like I said, open book tests, right? Allan Ritchie (44:01.708) Right. Allan Ritchie (44:10.602) Yes. Yes, exactly. Jon (44:13.221) Well, are we missing anything on templates? We covered it all. I'm sure there's always more, but you know. Allan Ritchie (44:17.91) I think so. I think the main point is if you even consider building your own templates, because I know there's a lot of people out there, like ASP.NET is even more of a religious ceremony, like some swear by mediator and some swear by fast endpoints and all that stuff. If there's one that works for your organization... Jon (44:29.954) Yeah. Allan Ritchie (44:38.614) I have kind of put it out there, like put it in a NuGet or sorry, put it in a template because you're going to wire up more of these apps, like all the microservices. We won't go into that, but if you have a template instead of trying to guess what versions you're using or what technologies you should be using in your company, you download the template, run it, gives you a nice, pretty UI. You go check, check done, right? It, do it in your orgs for this. Jon (44:42.906) Yeah. Jon (45:04.389) Yeah, exactly. You can standardize, yeah. Well, people standardize, organizations will standardize like coding best practices and stuff like that. So like, this is just kind of another step in that sense too. Allan Ritchie (45:16.15) Right. But the thing is, is that a lot of companies will create their own nougats as well. Right. And because they've made this new get, they often just think everybody knows it. So they don't document it as well as it should be. I mean, nobody does. Nobody does. Let's be fair. I suck at documentation. Nobody swear at me about it, please. But Jon (45:20.914) Yep. Jon (45:28.57) Yeah. Allan Ritchie (45:35.146) You know, if, if you don't have to document all the registration stuff, if it's in a template, that's your onboarding, use the template, check the box. Problem solved. Yeah. Jon (45:44.497) Good to go. Yeah. Makes a lot of sense. All right, well, I think that does it for this one. You know, who knew we could talk that long about templates, but we always seem to manage to find a way to ramble on here and there. Shorter, yeah, we're getting there. Allan Ritchie (45:58.742) We were good today. This was a shorter episode, wasn't it? I don't see that you have 46 minutes at, now we're good? Usually it's an hour. Jon (46:05.733) Well, hopefully if everybody seems to be okay with 46 minutes of templates and you like the show, or maybe you have at least liked previous episodes, you would go consider subscribing, consider leaving us a review. I think Apple Podcasts is the gold standard of getting reviews in, so those are always appreciated. Please drop a line there. And if you have ideas for show topics or you'd like to suggest a plugin package or product, which... you know, we kind of skipped over the subheading of, but I think it was hopefully evident that, you know, our picks this week would be the various different templates that exist out there that people have been working on that we talked about. So if you have a suggestion for one of those, or you would just like to ask a question, drop us a line at our website, gonemobile.io. You can leave a voice message there with SpeakPipe. You can hit us up on all the social medias or email us at show at gonemobile.io. But with that, we'll see you later. Go start adding my virtual list view to your template, please. Allan Ritchie (47:12.566) out for now.