Okay, good morning everyone.
Let's go and get started so
chat on the sidebar and full screen mode.
Yeah, she should be, yeah, it's for zoom yeah anyway yeah your zoom can zoom is mostly pretty useful but some, there's a few little witnesses.
Anyway, let's. So the plan for today is to see what, let's just go back to the schedule here Where are we right now so we are right now here at lecturer 11.
So there's today's lecture and then there's Friday's lecture, and then there's the break.
And during the.
And then there's a midterm review after the break and then the midterm exam.
You got you all should have submitted to submit one by now assignment to is technically due on Friday.
But I'll accept it for another week.
So, this, I'm happy to answer questions about assignment to as well in advance and same thing on Friday, but I will also.
We're also going to be moving on to Android today if we have time. Basically if you have enough questions. I will keep talking about iOS. But if I run out of things to talk about with iOS.
We will go on to talk about Android because there's lots to discuss there.
So assignment two is due on the 22nd. Yes, that which is but so the idea is to give you all some time to the check was the, you know, the 22nd.
I think right now.
I can give a couple more days if people want. I just wanted to give you all time to study before we go over it so.
So, let me know if you want more time for assignment because I also wanted to give you some time to actually spend some time studying before you.
But okay, more time would be good. Okay, yeah.
I was expecting a few people. So, I noticed, like, like Monday or something that like 14 of you have turned it in and then last night when I looked it was like 34.
So yeah, a lot of you actually seem to be
so.
Okay so,
so, so okay so let's talk about that that's a good thing to talk about here validation.
Yeah, like so yeah basically the way in order to change the Unix line endings, it all depends on what program, you used to say his lecture, 11.
Let's move that that's a little off there.
So first we'll talk about solutions. then we'll talk to make X Files.
Yeah. Yeah, exactly.
Yeah, by the way, this whole line ending thing would have been a great thing to ask in the discussion forum because then other people could have helped you out.
So, just, just to say, I'm
on Google Docs is not what you want to use.
Google Docs is not what you want to use.
Yes. Yeah, well that's why I gave you the validator so you could figure out whether it was validated beforehand.
Anyway, Let's talk about the solutions.
And then we can talk about how to make text files and stuff.
So,
here he was to hear the solutions I've included the right here.
Here they are. so what I'm actually going to bring them up.
Okay, Well we'll look at these first here.
So first question well actually let's keep the browser up because I'm probably going to want to show you the code here.
we are.
You don't even need. there's a million ways of fixing text files.
So what is the purpose of the spacer calls at the beginning of the end of the analysis results body. They add extra vertical space unbelievable the result, this was kind of a me.
What does the result area say when the app starts it says please select a mode, one a one B, these are like, come on. did you run the program.
D, can you ever make it display the initial message, after you selected something from the analysis menu. Why or why not.
So, you can't, because it's already displayed when the string is set to a value that isn't a key in the analysis dictionary and the menu items are generated from those keys.
So you can't do it. The only reason we get initially is because it's initialized manually. Before that, but there are programs, otherwise only change that using keys from the analysis of dictionary, which are set to menu items so no.
We use let so it doesn't let you change the variable.
A wolf your answer yes let doesn't make it immutable, but that's not so much like something. So, let this, um,
yeah, it's the it's all about the analysis mode and analysis mode is a state variable. So that can be set to any value.
But the question is Where is it assigned
the assignments are check manually Yes, yes, yes they're yours. So will you know we're gonna have to make some judgment calls on these things but
if you It should be clear that you understand these ideas.
Okay, so, you know, of course we can give you partial credit.
So, one thing very important.
With these sort of questions, is that you don't answer purely in a.
How do you say it. A.
Don't purely talk about program mechanisms where mechanisms makes sense. You should talk about them. But what you should also be discussing is.
You should also be discussing what the semantics of the program are.
I didn't mention the whole state part but mentioned how it is constant, you will lose, you're probably not gonna get full marks by saying it's constant because it's not the thing that's the thing that determines what motivates in here is a state variable
and this nk constant.
So, and in fact, the value is set to a different one elsewhere. So, it's all about explain the fact that we set it to something that's not in the menus, and then.
Oh, the title.
Okay.
Anyway, so that the other, so that's that's what you know so that's what to talk about.
So to.
Why doesn't the apt title of you use, you use a binding decorator for title.
Why does it is because it's not referring to a state variable, instead of just assuming a constant strings so you don't need a state variable.
So that's what you know why to it so if you specifically notice that here we have here we don't actually use a binding variable here, we just use our regular property of the structure.
And here it's, it's a string, and this does get bound externally here. Using this when when we caught we call apt title here the value of title is set to text analyzer.
But the big differences with this not being estate and binding is that this is passed by value. So let's This is sent in. It's almost like a function call so this value will be changed.
So,
yeah, and also yeah you don't you aren't changing. Exactly. If it was being changed at runtime, you would need to be a state variable.
And then three how often are the analysis mode functions called at a minimum, how do you know. Well, the also a function called at least every time we type in a letter because we see the count change in real time.
You know, as you type you see the count variable go up.
And so, it has to be being called at least as often as we press every key press
one if you don't then, wouldn't that be never get called so zero as well.
So, repeat that.
I mean if we just initialize program and don't do anything on it.
I talking about question three.
Yeah, yeah.
You think what do you know says how, but this is asking how often the analysis mode functions are called
there.
So someone opens up and he doesn't click anything you just stares at the screen. The they're not cold at all. So, the minimum should be zero is what he's saying.
And also what i what i what i think,
Oh, yeah, that's how I interpreted to.
How is that, so
my example as this everybody's finished, I just started like minimum like possibly but you can do just one like, I don't know, call it once, maybe.
Here's the thing, when the program initiative just checks the variable names. Do you know what mode is set right now so at the beginning, since it's none.
But that's not calling the function, that's just checking the variable names. The reason why I said I.
Okay, I'll have to think about that because it's like that's a very. So, Again, I'm not trying to ask trick questions.
So just just for future thing, I'm trying to get you to tell me how the program works.
That's what I want you to explain, and what the goal I have this question is, I'm trying to think of how I could have worded differently.
If I had said how often are the number of functions called that minimum during normal program operation.
So, I can see that men yeah yeah it's like men sounds like yeah that's.
Yeah, I'll think about that.
Yeah. So, okay, so I'll, I'll, we'll have to think about that but okay but but you see that what this is.
Yeah, but what we'll see is not called four times.
Again, if you don't, if you assume no user input, then it's never called.
It's called at least every time the user does any input to the app. Yeah, it's just a number of times the user inputs yeah exactly so.
So that's why it's, you'd have to say it's proportional to user input to really say what it is because otherwise it's like, yeah.
So, um, but if you say it's proportional to the user input of the user as an input anything then not they're never called.
Sure.
Anyway, so the thing to remember about these assignments, is we try to be generous with partial marks and other things but part of this is also learning how to answer the style of questions because I know these aren't the kind of questions that you've
gotten asked before more, but typically you get asked are much more quantitative questions. And that's not really what I want to assess what I want to assess is Do you understand how this program works because if you don't understand how this program
works. You know, that's a problem. Yeah.
Will you lose their place.
Okay also Stephen so I said men is whenever the value of the text field is changed for example. Okay, yes. Okay, that is, yes Stephen that's a perfect answer that's great.
Yeah, that's clean. Will we lose marks if you write too much. Um,
it's not about too much but if you contradict yourself like you can't just throw out answers and try for every possibilities and we pattern match on oh you said this, so you're right, we're really judging, do you understand what's going on, and if it
sounds like you're just putting random stuff down, and it's not, it's not good that you really know what's going on. We're not going to give you full marks.
So, Yeah.
So if you're if you explain it properly and you're just a bit verbose, sure, but coherence matters.
Okay so, so they're they're good so that's three, four, what happens we add a line analysis load equals count between lines 13 and 14.
So this is saying between 13 and 14.
What happens if we try adding that, well, you get an error because you. And the reason why is because you're trying to change a state variable, while the view is being evaluated and you can't do that.
So that's really the key thing to understand about this view domain specific language is you don't mess with the view, while you're rendering the view, because that makes it non deterministic and it's all complicated so they got all these restrictions
so you can't do it becomes a syntax error, as opposed to a runtime error.
But,
Stephen go ahead and explain. Yeah, sure. So, um, so I did some research on it because apparently when the main content view is made.
It makes it like makes it out of scrap, and then whenever the value is changed any of the state variables, it remix it scraps the old one and mixing new one.
So when you keep changing it it just turns into a recursive function and it just gives in there, and completely ruins the CPU.
Well, well that's why it's compile time here so you can't do that.
Yeah, that. So if you I just chose avoid like crashing though.
Exactly. Now, while it does technically redraw the entire screen like logically.
In practice, there's a whole bunch of optimizations under the hood so only redraws what's necessary. That's how it's fast.
Because, but but the but the mental model you should have is Yeah, every time, anything changes in the screen the entire screen is redone.
So, but yeah good. So, is it true that we say logic and view and swift have to be separated.
You get the, you get partial marks. I mean, this, we're not changing what the you when you're inside of you when you're when you're when you're doing stuff in the body of of you, things that are perfectly reasonable swift will give you compile time errors.
And that's because this ain't just regular swift there's all kinds of restrictions on this right keep talking about domain specific languages, and part of this is, you have to understand what's the logic of this they aren't just putting these restrictions
there to be annoying.
They're putting in there for real functional reasons. And one of the key functional reasons is, you shouldn't be changing of you while you're evaluating because they want it to be misled.
Okay, always.
I can evaluate this I know what it's going to be as opposed to you know yeah becoming a recursive thing it's like, no, the evaluation should be able to go through finish it, I know what it is.
Oh yeah yeah only views can be interview structure, it's like you can't, you can't just be doing. I haven't tried doing assignment.
I think you might be able to do assignment to something that is a distinct variable inside here but again it has to be deterministic again. Yeah, only of us can be in there yeah so it's all these weird restrictions and you kind of have to get that mindset
what it is but just, we'll see how that gets relaxed in Chile and Android how it's completely different model and the benefits and downsides.
Okay, so
we got this five what is the value of the bill modes.
So it's an array of string.
Yeah.
Yes, that's exactly that's the air you got Yes.
So, basically four number four, if you quote the error, you get one point.
And then there's another point for the explanation of why that is.
So, if you quote the air you're at least getting half marks and if you give like an explanation you'll probably get one half 1.2.
So this one. This should be should have been pretty easy it's a one point questions, what's the value there, then five be, if you replace six years, six with the following four loop.
Now, I know these counters are wrong. And so I'm gonna have to figure out how to grade this, because, yeah, I mean yeah this is the one base where I met for this was these lines, and I think I must have got the line numbers from a modified version, as
I try to check that but so yeah so la got that like, people start talking to me about Monday was like
yeah so it's a for each loop. Yeah, that's why I tried it, I thought the wording, why doesn't the for each generate the same error Yeah, this doesn't make much sense if you, if you parse the rest of the question.
But any case
for for each Yeah, Cool.
But so, the error closure containing control flow statement cannot be used with resulting builder few builder. So again this is this game back to the whole domain specific language.
This is perfectly reasonable Swift.
This is initially how like what I'm what our first learnings with you I was going like, I made a for loop to create buttons, why can't I make a for loop to create buttons.
And then I realized, you really can't do any sort of regular looping structures or conditional rules or things I'm you maybe do a bit of inside of these views but otherwise.
Yeah. So instead, you have to use a for each loop which is a special kind of looping construct for creating views inside of you I view.
So, you know, because the body, because the body of the loop is a closure here and that isn't allowed, you know, conceptually there so.
So if you really want to understand how the domain specific language stuff is implemented and how that all works under the hood, look up view builder, which is, which is a kind of result builder and result builders are pretty neat mechanism.
I find this really interesting because traditionally dynamic languages are very good for creating domain specific language of the classic one is Lisp.
That's what it was built for really as for research and artificial intelligence and languages like JavaScript traditionally are very good for doing this on Python.
But, but you can do this stuff in a language like swift when they've added in these funky mechanisms.
Can you say for each has a special view Sure.
So I try to give a full a full explanation here I don't expect you to answer this quite this fully.
But yeah, so we'll look at your answers and try to be fair.
No can the value avail modes change during the execution of the program.
So, Well, can't.
But cars declared flat. So it's no static we bound, and it's based on analysis which is an unbeatable dictionary also declared with the let.
So,
not actually sure.
Yeah, if you say a computer's change it changed because being introduced using lecture.
Now, actually, I'm not strictly sure whether this is.
I'm not sure if this is static or not.
I'm not sure if this is immutable not that the binding of analysis to the dictionary is definitely immutable.
But I think the dictionary may actually be mutable.
I will check that I might have to correct my answer there.
I restarted it sounded right yeah so
it's funny when you go to Caitlyn they make a lot of more distinctions about like, you know, versus immutable.
You'll see. Um.
Okay, so how can you add a menu option other that sets analysis mode to other without change the analysis dictionary.
So I was saying here, create a button.
You know, just, you know here you've got this loop here for creating things just put another button right there in between the two, with the other.
Yeah, you try adding some random key value doing dictionary and got a compiler.
Right. That's why I was thinking it was immutable because yeah you try, you try adding it to an end it just doesn't work.
request ID on us another syntax that worked
it yeah that seems fine.
Okay, so you did.
Okay, so you added a plus other at the end of avail mode, so like to line 56. Well if you added it here,
like that to your you said avail modes plus that gives you a 53.
Oh, yeah.
Yeah, those should all work.
Again, the one thing is to make sure that it actually compiles and again there's all these restrictions, but yeah I think those sound like they should work.
So, this is not the open. So this is not the only way you can do it.
If you got it to compile it I was like yeah so how could you change the question.
Yeah, um, for the snippet that you'd asked us to submit the snippet of pasted the whole thing, right from strapped and then the last bracket. So would that be fine, including the New button for which for for five D, E, for the New button the other one.
Yeah, yeah, yeah for five to question five D.
Yeah, this question right here.
So like, you've just put in the only the button snippet right I pasted the whole thing right from strict mode manual until the last prophet first round.
You gave this whole thing with the change. Yes. So, so, that's fine but you have to explain what you changed. Yeah, I mean, I've added a line explanation for that but it says that's fine.
So, so basically right as little as possible and don't include more code than you need to portray.
Yeah, because otherwise you would just include the whole program.
So, so, so for the for each question talk about it and how it doesn't give an ID is that right. So, the for each, which question are we talking about here.
But still, Stephen which question you're talking about five feet. Okay, so.
so here. Um,
so the ID issue is, is a technical thing.
I didn't know I've kind of glossed over that but the idea of the fourth, so in here, we're talking about here in the forage and has this ID.
So the question here is, in this for each for each is designed to really be you know iterating over objects of some kind, structures classes whatever so you're supposed to evaluate all of these things.
And so, when you do that, you have to decide how do you decide
what's the unique identifier for each of those, you know how because essentially you have to have some sort of, I think it was like some sort of hashing but I say it has to be interoperable, and you have to assign to iterate over these things and so that's
what you do it. Now since this is just an array of strings. We can just, it just needs to be the thing itself.
So it's that's why you set it to, you know, you know, office off so um
yeah basically for a list or a menu needs. Yes, every element in the menu needs an ID is wearing what they are, you have to tell it how to get for it.
This is a array of strings so you might as well just use the string itself so yourself. If it was, it was something else we would give a field, a bit busy a property of destruct.
Here is the ID.
So the backslash here is because this is essentially saying, don't do reference this dot right now because normally it'd be up some objects and saying, you're going to use it somewhere else so it's basically escaping, it's, it's a funny syntax.
It's really a funny syntax but it's saying, Yeah, applied to whatever your object you're going, Okay, if it's food. So, refer to food itself so I don't know what object, you're going to be taking the property of, but here's the property you should be
taking of it, and turns up everything and swift has dot self.
So,
you always have to, you know, have it referred to itself that way.
Does that all make sense on the, on that any questions.
Okay, moving on.
Okay, so we were told five be five D word that CMD so like six.
How could you change the analysis dictionary so it doesn't use any more closures.
So here.
So, basically looking at as you just take, You know, put names to the other ones.
And then just define them. So we've got here check empty account characters you could give them some other names. You just have to make sure that they match up in your dictionary, so
this should have been pretty straightforward.
Again just following the syntax of the other ones.
If you found this hard.
You may not be understanding something about the syntax of closures versus functions. And, you know, you may want to ask, I'm gonna ask now fine or maybe asking office hours or something or have you the docs,
should you use is empty.
That's fine.
Well, Stephen that the reason why this uses this equal sign is because that's exactly the code here. So, so, just use that code.
No. Okay. No, it's fine. It works fine but you know it's
like, yeah, that's fine, but you didn't have to write those from scratch.
Copy Paste gotcha. Yeah, exactly.
How could you add a new analysis. And that's really the reason why it's copy paste is really I want this is an effort in transforming the syntax of closures to standard functions.
That's what this exercise was
showing other essentially equivalent. So, how could you add a new analysis mode pet counts pets counts that count the total number of credits of the pet names, and any of the ones I'm like pets mentioned this one she can't duplicate.
So,
how much our assignments worth assignments are. Let's go back to the, that's a reasonable question at this point.
Go to the course outline.
They are worth 20% so each assignment is worth 5%.
So, mid term is worth 25%.
So, it's one fifth of the midterm.
And notice, tutorials, and class participation over 25%.
Okay, I put the false outside the midterm is a bunch of short answer Yep, it's basically modeled on the, on the assignments.
I put a false outside of the if so that if it wasn't you somehow it will return No.
Oh, okay.
I control what where it Why don't you put a false where.
Oh, are you talking about question.
Six.
Question six Yeah.
There's, there's lots of ways of writing this code, especially writing check out it there's a million ways of writing that code.
My interest wasn't you and bring writing the code, my interest was in you converted get to function syntax,
the midterm is an open book. Yes.
His own book open note, but remember there's also the interviews. So
anyway there's. So, how to do this.
I expect you have to look at this, you know like define this first.
It turns out this was a bit. This is a bit annoying because you had to figure out like how to do the separation.
You know, so how do you how do you go through and do basically string parsing in Swift.
So basically I let you kind of look up I'm kind of curious how you all figured out this answer.
Whether you came up with the same thing on the exam is also open book but again, what my.
The exam is also open book but again, what my its own book open note but there's a lot of questions. So, if you spend much time looking things up, you won't have enough time to answer all the questions.
Okay.
At the exact same okay so um
so yeah so I
think we all did the same, the same kind of search.
I'm trying to think anything else be so yeah so the exam midterm are open book open note, but I would not rely on that much because these.
As you see these questions rely on you understanding things, not looking them up. So like if there's something like on your momentarily confused about something I need to check your notes is like okay that's fine, But you have to have done enough studying
beforehand so you can mostly answer the questions on your own.
The reason why I make your own book open notes because otherwise I'd have to be proc during your unfair advantage so.
So yeah, but I will be the interviews are basically to make sure that you are collaborating so don't collaborate.
Why doesn't swift have a replace first of all it has replace all,
if you subtract it after the for loop.
Does that give you the right answer if you subtract after the for loop.
Unless you have to do it proportional to the number of elements in tats, if you if you just say minus one after the loop that's wrong.
Yeah, you would have to be the number of pets.
I don't think you tested enough cases.
Yeah. If you wait too for lunch. Okay then.
Okay, anyway so those other questions. Okay.
What's the best way to prepare for the exam.
To make sure you understand the assignments and the tutorials.
You know that that's the, I mean there's a lot of concepts that are touched on in the midterm and assignments and literally how I create the midterm. He's like go through the assignments, I take those questions and I rewrite them to ask about the same
concepts, but in a different way.
So you can't just memorize the answers to the assignments and to do the thing but if you go through and understand the concepts behind each of these questions.
I make it pretty clear what those concepts are by answers up that that's the best way study on the midterm definitely does not include Android stuff, because it's on the first two assignments, so.
Okay.
Was there storyboard is there. So, if you look at A. So is there a storyboard stuff it's only storyboard to the point that there is an assignment to.
And I don't think assignment to has anything on storyboard.
So.
so you spring board is not specifically going to be on the midterm because that's not asked about, in the first two assignments. However, I do think it's worth you spending some time looking at tutorial five before the midterm, if anything to understand
swift UI better.
Yeah.
Well, if you hate constraints you're really not going to like Android.
Although I have to say I like how you do things and Android a bit better, but it's, It's not that different.
Yeah.
Anyway, I'm unless there's any more questions. I'm happy to answer things about assignment to.
If you, the XML is cleaner, you'll see, you can make your own judgment, I can show it to you right now, if there's no other questions for.
Let's just stop here, you have more time to ask questions about assignment to and stuff. Let's move on to Android.
So play first quit Xcode quit quit the simulator. Yes, tasks.
make my.
I didn't check off today Yes, I will. It's only 1217 so I want to cover some more stuff.
So let's hear Android Studio.
Now let's make my for this. I am not doing my Android development on this MAC, but this is a good thing so my environments relatively clean here so I can show you stuff.
Okay, this is doing how Hello World program. So what we're going to do is I'm going to start through this.
Okay, let's just get rid of this.
Okay, so now we're here. So this is what you should do for let's get started in doing things in Android here so Android Studio. I have my initial thing here, I'm going to say new project.
So new project don't go to warehouse. Don't go there, go to phone, tablet, and don't like blank basic activity select empty activity.
And then
we're going to where Congress.
So, make your name February 16, uh, here's your package name you can is made a comp Carlton comp 1601 from 16th, you make this whatever you want but this is, I use call to comp 616 on one of my projects.
Yeah.
It's going to have a directory where you're going to save it in, wherever you want to your machine.
You could choose Java Caitlyn Caitlyn, that's what we're using in this class.
And then we get to this minimum SDK thing.
So, iOS, next code does support building for older devices. And there are definitely ways of doing it, but it is front and center. When you do Android because mostly when you're using, when you're developing for iOS, you can mostly target the latest iOS,
because almost all regular use iOS devices can run the current iOS.
Because they support, you know, things. What is it, currently still this supporting the first generation iPhone SE and iPhone six s or something. I mean, it's insane how far back.
Apple does this.
That's not the case. In, you know this is not the case when you're an Android land, and Android land you'll notice on Android 5.0 is what I've specified.
Android five point O is what I've specified. If I do that, I'm a 98% of the devices. So that's what we're going to use, but look at all these other versions, and in fact, like the current version right now is S.
And if you choose s, you're looking at less than 1% of devices.
If you go back one version, you're only talking about a quarter of devices.
So, And the reason for this is so, so.
So, you know.
So in effect what you're using these.
So when people talk about Android being open source.
Technically, underneath Android is open source, but it has over the years become increasingly proprietary and the reason is because increasingly proprietary frankly is because inversion skew.
So you have all these different versions of Android, and Google implements this uniform API on top and then unless you want to go insane you target that rather than the underlying versions.
Oh yeah maintenance like this. This is why Android, frankly, I find so frustrating because there is no reason Android couldn't be like Windows and have things actually updated on a regular basis, except Google.
Yeah, that's a complex question, but it kind of sucks and Google's been trying to fix it for years and this is kind of their half assed solution for it, but yeah.
So, when you build it, don't do this.
Specify Android five.
So say
was Android 5.0 Android Lollipop.
Let's see the Wikipedia so it came, notice this is a version of Android that came out in 2014.
This is.
Yeah.
Sucks.
But yeah, this is, this is how you get compatibility so you can run all the devices.
So, but do this, don't select the Android legacy support device drivers because that way you can only use the latest Play services.
And you do this, and they say finish.
Now once you do this, you think everything is set up, and everything is ready to go. It's not. It really really isn't.
Look here, you see this stuff down to your update indices and stuff. If you first do this, it will take even longer. If your computer is old, he will taking longer.
This stuff is just, you just have to sit here and, like, the interface is up you can try interacting with it but you do you're going to mess stuff up.
Just wait. And the way and so like season. You know if you hear my fans going on in this old machine it's just sitting there run in the fastest machine you can but this is just showing you what's going on here so it's busy running figure project you see
this, like, stuff's all going here you notice this loading part here, you won't even see a proper hierarchy.
I honestly jet this as an IDP. There's a lot of things to like about so if you don't know, Android Studio is built on the jet brains ID.
Um, and so it's it's a nice, it really is a very nice adult environment many ways, certainly for doing things with Java and Caitlyn things but it is.
It's a beast.
Intelligent yeah we are Jeffrey's intelligent yeah no so it's.
Now, one thing to pay attention is your hierarchy in the left should look like this. If it doesn't look like this, in particular if it looks much deeper. Something messed up.
You know, pay attention is if it doesn't look like this, you're in trouble. And typically what that means is Ty still indexing or something so just let settle down until it pops up so you can see this, you basically should see this main app and radio
scripts and then you see under here you under Java here and then there's this Android test and test and these are probably get that. But here's the main activity which is right here.
So the main files you want if you care about is there's this main activity here, that's this and then there's activity main, which is under Resources, so you can drop away out but this is all here is activity made so this is the XML.
And if you want to, if you right click on this.
Also if you go over here you see, there's the design mode you can click on code view. And you can see here is the XML.
A lot cleaner I will say then apples. apples clearly storyboards not really meant to be edited by hand. This XML clearly is.
And I appreciate that because, because I get out and I find just always how to do things this way when something doesn't work, right, like I need to get to the code.
So this is here and then here's your main activity here.
So, nap so what basically what I want to do now is I'm just going to show you, gang the app running. We'll talk in detail about it later.
You don't have. So if you don't see the drop down. Wait, it's probably still indexing look in the bottom right, see what's going on. If it's still you know it might be running or something, and you can share your screen later to see what's going on but
what does indexing mean means that it's going through and looking at all the means literally like building up an index of a book mean it's going through and saying, oh, where does this word.
Where is this word present in all the pages and where's this word present in all the pages so you later in the index you go like, oh that word is on page 55 and 72, doing exactly the same kind of thing.
This is a technique using databases having an index, but this is it's indexing all the source files, so that it knows how all the files connect to each other, so that when you say, oh, like, I click over here and it goes like oh this is referring to some
XML. And it's like, go to related files. How does it know that because it index the whole thing.
And so these are both reference here if you click on that, like, Oh, I can see that refers to this and will show you how it connects them. So it's very useful.
But it's inherently expensive.
So, let me show you how you get the program running for know got the code here. So, so let's go to.
So I did not specifically give you a project to download because iOS projects are a pain to share, Android projects or, even worse cradle and all things it's just it's all crazy fragile.
So first thing you want to do is keep was created main activity.
So you click on here, copy, go here. Now one thing important here is when you're copying and pasting don't delete the first line.
This because that first line matters. So we're in spirit, because that basically is based on whatever package you made, so keep whatever you had before based on how you created the rest of it copy and paste you've got this.
And then we go over to the XML, we view the code.
And we go over here let's go back here and then let's go to activity main.
Now, in Firefox, you're going to see this can save you page.
You page source.
Copy.
Here, this one you can just say,
wake up this whole file.
This way, if I did this all right.
Go over here.
And let's try saving this.
And let's try and the other thing you have to do here is go to the device manager.
So, so if you go here to the device manager, I have a device I've got a for a running API 31, I suggest running 3031 doesn't really matter for what we're doing.
But you'll need to create a device here I created one.
And here I'm going to need that so.
So now I'm running, it will start showing the emulator in a second.
And now we wait, and know this will take a while. Oh no, it didn't take that long list from the device to come up.
And so, so we can do this. Hi, this, that, it pops up here nice and large, a new version so you see these sort of messages a lot, new version is released.
The Caitlyn plugins able install. I'm not going to do that right now but yeah you should go ahead and install these things.
So now here it's busy running great will build running.
So now it just
seems to all be running.
You see here this is x here you can, you know, so I can cancel it but it's still running.
I do appreciate the simulator running in the, in the IE and showing it there, that the seven, it automatically opens when I hit the play thing it does but you have to have created, it will automatically open but you have to have created a device.
If you haven't created a device like you didn't do it to device or if you have an Android device around you can plug it into your computer and it will be so you could select there and deploy to it directly.
We're going to wait here for a bit for this to run.
Anyway, I'm going to stop the video here it should show.