 Okay, so I guess I'll begin, introduction to mobile app development with Android, right, so turns out mobile is pretty popular, mobile usage has overtaken desktop usage in quite a few countries now, including India, South Africa and Saudi Arabia, so half of YouTube are now on mobile devices. We're now connected, we're now the most connected anytime, anywhere. So what is Android? So Android is a Linux-based operating system intended for mobile devices. Android operating system versions are named in alphabetical order and after desserts. So we've got cupcake, for some reason it started at C, not really sure what happened to A and B, but cupcake, donut, eclair, fro-yo, gingerbread, honeycomb, ice cream sandwich, jelly bean, Kit-Kat, lollipop and now they've just released Android M, so that was announced in Google I.O. a couple of months ago, so we don't really know what it stands for but it's going to be released in September, rumored. I think it's going to be called macadamia nut cookie or something, but yeah, I guess we'll see. We should have a bat. So Google Play is a marketplace where basically it hosts all the apps everywhere, makes all the apps publicly available, when you develop an app you can upload it to the Google Play Store. So yeah, there are one and a half million apps in the Google Play Store currently, probably increased since then, maybe closer to 2 million now, I don't know. 200,000 of those are paid and there are more Google Play Store apps available than apps on the Apple Play Store. So just some statistics. So in 2008 there were 3,000 apps, jumped to 2,012, half a million, in 2013 there were 850,000 of them, so users were downloading 800 apps per second, 2 billion apps per month, so it's kind of crazy, last year there were 1.2 million. Yeah, so developers in quite a bit of cold hard cash from apps. Yeah, 10 billion of that was earned in last year alone. So these are the top categories for Google Play Store. So the red are all the free apps and the green are paid, so what is that? Most people pay for personalisation apps. So when we get around to Android development, basically there are a few components. There's the IDE, the integrated development environment, Android SDK, Android software development kit, the ADB, Android debug bridge and the Android runtime. So an IDE is an application that provides the facilities to programmers for application development. So basically it's just an environment where you can write code and compile it and basically deploy onto your application. So that is, so we'll be using Android Studio, but you can also use Eclipse. So Eclipse is usually used when you write Java applications. So the Android SDK basically contains the tools to create compiled debug and package Android apps, basically provides all the functionality for you to develop everything, really. And then we come across to the ADB. So basically it provides, the ADB provides like this software bridge for you to deploy applications from your laptop to your phone. So it essentially acts as a bridge. So the Android runtime. Don't worry too much about this. I guess I'm getting into finer details here. But basically the Android runtime uses a head of time compilation. So when you deploy your application on an Android device, the Java code is translated into machine code. What this results in is larger compilation code, but fast execution and improved battery life. Basically it's kind of trying to think of simple ways to put this. Yeah, just don't worry too much about that. We can come back to that. Also don't worry too much about this. So basically Android applications run on Android's own Java virtual machine. So a Java virtual machine basically provides this level of abstraction where you can run applications on any sort of environment. So the good thing about Java is you can run it on any operating system. That's Linux or iOS or Windows. So providing this software abstraction layer kind of provides, allows you to develop Java applications. They run in this environment instead of I guess natively, unlike your local operating system, if that makes sense. So the Dalvik virtual machine is optimized to operate on mobile devices. At the core of Android you will have your native C and C++ libraries. So you can actually develop Android applications in C and C++. So developing Android application. When you're writing Android applications, it's all written in Java, but as I said before you can actually go down to a final level of detail and write it in C and C++. I'm not sure if, yeah. So the GUI, the Graphical User Interface, is all written in XML. Basically when you want to deploy your application you package it into what's called an APK. Basically it's the same as an EXE or Windows. I'm not sure what equivalent is on iOS. So, yeah, you deploy the APK file using the ADB tool. So you have really two options when you're testing out an Android application. You can either deploy it on a physical device or you can, if you don't really have one of these, you can deploy it on a emulator. So like a virtual device, really. Do you guys have any ideas to what any pros and cons would be to deploying an application on a virtual device? Okay. So basically, since everything is all virtual, you can basically specify what Android version your virtual device will be. So you can specify its jelly bean or KitKat or Lillipop or any of that sort. You can specify all of them and you can test your application on every single Android version. So it basically covers all bases and really provides like thorough testing. And also you don't need a physical device to be able to run your applications. So you can do it all from your IDE, your integrated development environment. So Android Studio. The cons. So there are certain things that you can't emulate using your virtual device. You can't emulate the camera. And you can't emulate GPS coordinates unless you've got GPS in your PC for some reason. I don't know if that's possible. Also, they're quite slow. So you've created your application and now you want to publish it to make it publicly available. So there are two ways of doing this. You can either get the APK file and just give it out to people. So email or USB stick or something. So your APK file was generated each time you kind of compile your application down. Alternatively, you can upload it to the Google Play Store. So what's involved in this is you do a one-time registration and it costs like 25 US dollars. You upload your application and then Google scans it to make sure it's not malware. And then basically a couple of minutes later, your application is available on the Google Play Store. So it's super straightforward. So that's just an example of really the first step of uploading your app to the Play Store. Okay. So we can probably get down to coding. I don't know how well I really explain things. But I guess what I've always found is that writing the code and then going back and understanding it kind of it's a good and fast way to learn. So I think maybe just getting straight down to it would be a good idea. A few tips. Something to note rather. So coding is pretty logical, but it also requires quite a lot of creativity. So when you're solving bugs and deciding the best way to do things, you kind of need to be creative in that aspect. And you don't want to learn to code per se. You want to solve a problem. So we should probably get down to solving the tutorial. Yeah, no. So I guess I'll come and sit down with you guys. And then we can kind of go from there. Does everyone have an Android phone? No? Oh, right. Sorry. So we've got two spear. So I've got one here. So I can, oh, sorry. Yeah, pretty. I guess I'll just go through the code. I went through, I went through the code with a few of you guys, but not everyone. So I'll go through it again. So all right, we begin. So these import statements here. It's basically just saying, hey, I want, I want this functionality inside my application. So we've got an activity. We've got our edit text, our buttons and toast, which is toast is displaying text to the screen, just like notification text. So down here you'll see please enter a valid number. So that's all toast. It's a little bit of a strange name. So we've got an edit text here. So the edit, the edit text field is where the user is entering all the numbers to import to be used for conversion. So as it stands, like right here, it's, it's just kind of on its own. It's not really doing anything. So what we want to do is we want to link it to the actual control. So this is where we're linking it to the actual control here. So we're saying get the ID of this control, the edit text. So this ID will be defined in your activity main file. It will be called edit text. And it's just assigning this control to our edit text variable here. So when we click the button for conversion, the calculate button, we specified in the activity main file on the button control, we said on click equals on click. So we're saying we want this on click method to be run whenever the button has been clicked. So right here, we're just getting the ID of the control. And we're saying if this is the button that has been clicked, so we're just, yeah, we're getting the IDs again, just as we did for the edit text and storing them in these variables here. So what this is saying is if the user hasn't entered any text, then display a message, please enter a valid number. So we're getting the length of the field. So if that zero meaning, yeah, if there's nothing entered, and then finish, come out of the switch statement, if that is a case. So do not go in, complete this. So if there's nothing entered, then this isn't run. All right. So for, so now we're moving on to obtaining the text from the edit text. So we're getting the text again. And we're converting that to a string. So since we want to, as it stands, it's currently a string anyway. So I don't think we need that. I think it should work actually. No, okay, we need that. So we're passing the string that's returned from the text into a float. So a float is just a bunch of numbers really. And here we're saying if the Celsius button is checked, so the radio button, call the converter util method, sorry, class, call the convert Fahrenheit to Celsius method of the converter util class, and pass it the value that the user entered. And then it's just setting whatever is returned from that method is displayed onto the text field. And down here, it's just removing the check from the Celsius button and putting it straight away, checking the Fahrenheit button, a radio button. And then down here, we're just doing the exact same thing as we did for Celsius but for Fahrenheit. And instead of converting Fahrenheit to Celsius, we're converting Celsius to Fahrenheit, and using the input text, using the text of the user input. So that was that I'm in presentation mode. I don't know how to get out of here. All of you, here we go. All right, so now if we go into, we'll put our Android manifest. Okay, so I'll convert a util class. Basically, this is just providing the functionality to do the calculations for the Fahrenheit to Celsius conversion and the Celsius to Fahrenheit conversion right here. Oh, right, yeah. Yeah, it's right here. So you're just doing the calculations and then returning that value back to whoever has called this method. Yeah, yes, you can. I think when you're, when you're, you can pass that sort of stuff. Yes, you can do that. So if we just go into activity main, okay. So here, so a linear layout is basically it provides you, I guess, functionality to how your controls will look and are aligned. So we've got a vertical states that our linear layout is vertical, meaning controls are underneath each other. You can have a horizontal orientation, meaning controls are aligned next to each other. So this is just a bunch of alignment. It's all automatic. Usually, when you drag this out, but you can edit it. So you can say you can specify the layout width of like 100 display pixels, if you want to. And then that will obviously change how things look in the design. So that's all cut off. So let's just put that back to match parent. Right, so we then we then added an edit text for a user to enter into all the numbers. So we're specifying the input type to really, yeah, numbers signed and number decimal. So just numbers. The alternative would be, or if I remove this, you would just get a normal keyboard layout of text. So you can also specify that it's a password, a text password. And then that would, if I go back into the normal view, whenever this whenever I use the enters, and so this text field now you'll see it come up as like a bunch of like dots. Just like when you enter in a normal password, I guess. So we added a we added a radio group here. So we're just grouping together a bunch of radio buttons. So we've got two radio buttons here. And we're just grouping them together. One's for Celsius and one's for Fahrenheit. Radio button is either basically if you have four radio buttons, only one can be checked, as opposed to say a bunch of checkboxes where you can check multiple. Yeah. And then down here, we've got a button. So whenever this is clicked, we call the on click method. Yep, because it's worth mentioning. So over here. So this is our menu XML file. So this just basically states what our menu is going to look like on the app. So right now we're telling it to give it this name. Action settings and you will see it's referring to a string resource. So if we go back into our strings under resources, you will see you will see the settings here. So strings is just like a central place where you define all your text. So we've got our Hello World, our settings to Celsius. Yeah, these are what our radio buttons are called. And this is what our button is called. And I guess that's essentially all the files that I guess we're concerned about. Oh, we've got the Android manifest. Yeah. So this is an important one. Okay. So Android manifest is basically a place where we can define all of our permissions, we can define the icon, the theme, all of our activities that we'll be using. So all of our activities need to be explicitly stated inside the manifest file. Here we're saying to refer to the drawable folder and access the logo and put that as our icon. So this is our app name right here. The gist of it really. That makes sense. For the most part. Float. So a float really takes up more space in an integer like if you're using decimal points, then you'd use a float because an integer, it rounds up or rounds down. Since we're, we're concerned about accuracy with conversion, we want like the decimal point. The float displays decimal points up to however you define it, I guess right now it's maybe to four points or something. So the manifest file is basically it defines where all your, it defines all your activities. It defines your icon, your theme. I think I had put up a description down here and manifest. Yeah. So the manifest, yeah, it needs to know all the components that are existing. So you need to explicitly state all the activities inside the manifest file. Yeah, you can define your user permission. So if your app needs to log in, if your app, if your app needs to access internet, if it needs to access like read write access to the file, to file, if it needs to access Bluetooth, all that sort of stuff, you would explicitly state that in the Android manifest file, because you don't really want to give a developer like all the permissions. So basically when you define these permissions inside the Android manifest file, when you go to download an app from the Google Play Store, it'll say, hey, this app wants to access your file, this app wants to access Bluetooth. And then you would say, okay, that's fine. And you would install it. So that all comes from the Android manifest. Yeah. Yeah. So if you want like up to date, currency conversions. So you'd have to have, I mean, I'm sure there's like a web API for this, like web functionality that you can call into, which returns you say the like the currency conversion data that you need to accurately convert currency. So I'm, I would say you'd call into a web API for that, and then be returned like up to date currency information, and then use that to convert your data. Yeah. Otherwise, you would have to explicitly state it into your app, and say maybe each time you open your app, it would prompt you to say update the latest currencies. Yeah. So Android development primarily uses Java. So I think maybe a good like, before maybe getting started with mobile, you can probably learn Java. I think that provides kind of the fundamental aspects of getting things to work. And then on top of Java, you'll have like the Android API. So you'll have like the Android or the Android functionality on top of existing Java functionality. I would not say you can't get straight away stuck into Android. I think that's like, that's awesome. I don't know, like it helps to understand Java concepts. But you can do that when you're getting started in Android. Yeah. So I would recommend just going to the Android developer site. And they have like, yeah, I can see you've got it up. They have a lot of resources there. And they're really good. They have the API list. So all the functionality ever in Android is all stated on the website. And there are just endless tutorials online. Yeah. Yeah, no, it's definitely possible to have one build. But there are so I know that you can do that with say Ruby, you can build an application in Ruby and deploy it down to Java code and Objective C code for iOS. So you only need to maintain one set of code. I think the issue with that is that you kind of have to wait for this, you'd have to wait for this like certain application to support the native features of each phone. And also it's slower. And it's prone to vulnerabilities. Yeah. Right. Is it the Ruby one? Yeah, there's also there's an alternative as well. We develop in C sharp. I can't remember what that's called. But there's another C sharp when we can develop in C sharp and other programming language and then deploy that down to Android phones, iOS phones and even Windows phones. Yeah. Yeah, a different platform. Yeah, you'd need right. Yeah. Yeah. So no. So we can use virtual devices for that we can emulate like different environments. We can explicitly state hey, I want to test. I want to use this specific Android version and then run your app on that and then try others. There's actually an there's an online application. I'm not coming what it's called but you can upload your application to it and it tests every Android version or like whatever you state between say 2.0 to 5.0 version say there's a tool for that. There's an app for that. And I know there's also this feature called monkey in Android, where it like randomly generates user input and like, like a user like randomly pushing buttons and entering random data into things to try and break your code. So you make it more robust. That's called monkey. It's part of Android. But yeah, I think yeah, I have to have to get back to you with the name of the application that we upload your we upload your Android application that tests it all because that's really handy. Yeah. Yeah. So I think this usually whenever you create like a skeleton like a new project like we have there's a sorry. Oh yeah, this one here. Yeah. So it usually comes with like another class for you to test things. I've never done it. But I don't know how popular that is. I guess I think the monkey feature that I was talking about just before I think that would be really useful. But yeah, I think you can automate tests. You just need to I guess look into it. Sorry. Right. Yeah. Okay. So they are just going to design. They say for an image, there's an image of you and you can just drag that across and have an image there. You can either you can start what's called in an intent to do something and intent to allow the user to pick an image from the gallery and then load the image up into the image view. You can also explicitly like have a static image and put that into your drawable resources folder and load that up say on create. So there are there are there are different media that you can use. I think there's a video is a video view as well. Right here that you can use for video. And then there's also called a surface view that you can drag across. So it's useful video as well. Yeah. Yeah. 25 us. I think okay. So I believe I'm not really sure on the commission that say Google Google would get from your app. I don't think so. I know that. So there are two different ways for users to pay for an app. There's you can before a user downloads you can get them to pay for it. So like a couple of dollars for example. But then you can make it freely available but have in-app purchasing. So I think that one's more preferred because users are more likely to kind of spend money. I'm not too sure on the commission. Yeah. So you can so basically an activity represents like a single page. So you can create more activities. Again to get to another activity another another page. You start an intent. You can also have what's called fragments which is like it's not an entire it's not it's not an entirely new screen. It's just like an overlay on top of a screen that you can use for different screens and stuff. So yeah activities and fragments in terms of displaying you UI. Yeah you can use you can use it. Yeah. Yeah totally. Yeah I've got I've got business cards if you're interested. Yeah. Thank you so much guys.