+ 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
7 Réponses
+ 11
UI is User Interface. XML is used to design UI.
+ 8
Only Java code isn't enough to give an output. You have to design UI too.
+ 5
Please help me too guys D_Stark Sir Krishna Teja Yeluripati Tamim Production Benzai Sarah -->
https://www.sololearn.com/discuss/1364112/?ref=app
+ 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 !
+ 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 ..
0
what is UI please?
0
can anyone explain UI please of you cant run java on its own..