![]() ![]() Let’s go ahead and turn this by coming up here and selecting the run app. Now I’m not gonna do that here but you could certainly do that and again, that’s best practice and so, you get a sense that Android Studio’s really prompting you to code with best practices in mind. Again it’s recommending that you export this as a string resource and you could do that by going through and selecting extract string resource. Note that this has other warnings here and these warnings are saying hey, this should be a string literal, so you should use an Android resources. In the next lesson, we’ll run our code on a physical device. Independently of our use of upper and lower case letters, as we always convert the answer to lower case before checking which color was entered, it works just fine.Īnd, as expected, we got “You like COLORS”. Let’s see if our code is running correctly: ![]() We notice that the phone displayed looks exactly like a Pixel3. Now, we select our new device on the list of “Available Virtual Devices” and click Ok. ![]() For now, we’re just going to go with the default choices: You can give your emulated device a specific name (to differentiate from other emulated devices you may have already tried before) and/or orientation mode. Once it’s done, select it and click Next: Android will then download all the needed files, so make sure you have available space on your computer for that. Now, we have to choose an operating system. Let’s go ahead and select Pixel3 for this lesson: There will be a lot of options (all Google ones), but you can also import hardware profiles for other popular devices. Otherwise, we can run our code on an emulator by creating a virtual device: If you have already set your device up in Android Studio, it’ll be visible under “Connected Devices” and you can proceed normally to run it in your phone. To run our app, you can either press the run button in your top-right menu or click on “Run” in the top-left menu bar and then “ Run app“. In this lesson, we’re going to run our code on the Android Studio emulator.įirst, as an exercise, extract the strings we used in code from our last lesson to the “strings.xml” file as shown below: You can access the full course here: Kotlin for Beginners ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |