Quick question:
I know a small amount of Java, and I'm working on my first very basic Android application.
I just want it to say "Your device is: Build.MODEL" but I can't figure out how to get that string to display in the XML TextView.
Quick question:
I know a small amount of Java, and I'm working on my first very basic Android application.
I just want it to say "Your device is: Build.MODEL" but I can't figure out how to get that string to display in the XML TextView.
Use Android Studio to generate a "blank activity", you will find it has a single String "Hello World" in it. Take it from there - and get back to SOF with further questions.
You can try to see this question: Are parameters in strings.xml possible?
Try to using String paremeters on XML to do that
in Java
TextView myText = (TextView) findViewByid(R.id.myTextViewName);
myText.setText("your device is:".concat(Build.MODEL));
(in your xml the TextView must be named myTextViewName
That's all