Android studio little help needed please | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Android studio little help needed please

Hey, how would i run a simple code like this in android studio? i have no intention in creating anything just yet as i have alot to understand so i put this code inside the tabs "project.java" String x,y,z,a; x = "I "; y = "love "; z = "java! "; a = x + y + z; System.out.println(a); when i press the play button "run" it opens a new window asking me to "select deployment target" as i have "no usb devices or running emulators detected" any help would be appreciated, thanks

3rd Jul 2017, 11:04 AM
D_Stark
D_Stark - avatar
7 Answers
+ 11
UI is User Interface. XML is used to design UI.
3rd Jul 2017, 1:45 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 8
Only Java code isn't enough to give an output. You have to design UI too.
3rd Jul 2017, 11:06 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
24th Jun 2018, 8:42 AM
Vansh Wadhwa
Vansh Wadhwa - avatar
+ 3
You have to design your layout [UI] in your res folder .. System.out.printIn(a); is not gonna work, you should add a TextView, declare it in the project.java using.. TextView mText = FindViewById(R.id.your_TextView_id); Then u use mText.setText(a); Android studio comes with built in emulators , u can add one through emulator manager in the layout preview page. Good luck !
5th Jan 2018, 7:29 AM
Tamim Production
Tamim Production - avatar
+ 2
If you need an explanation of the UI , UI stands for User Interface, its the body of the application (what the user sees) and java, Kotlin, C++ or C# (for xamarin studio) will play the behavior role of this UI , for example a button..a button should be designed into the XML file of your layout.. U can find it in app-res-layout-activity_main.. When u access this XML file you'll see a container with some shit that u need to Visit Android developer website to understand, adding a button must be inside this container.. You'll find more in the website of how to add a button, so XML is the view ! But when u click on the button, nothing happens! Here comes the java.. You'll declare your button using ...Button mButton = FindViewById(R.id.your_button_id); And then you will set an OnClickListener so you listen to your button clicks inside this listeners you with some code that will be only executed if the button is clicked. Hope that was helpful ..
5th Jan 2018, 7:46 AM
Tamim Production
Tamim Production - avatar
0
what is UI please?
3rd Jul 2017, 11:44 AM
Benzai Sarah
Benzai Sarah - avatar
0
can anyone explain UI please of you cant run java on its own..
3rd Jul 2017, 11:54 AM
D_Stark
D_Stark - avatar