Visit my website at https://www.thenewboston.com/ for all of my videos and tutorials!
Have questions or looking for source code? Check out the forum at https://www.thenewboston.com/forum/category.php?id=10
My Profile – https://www.thenewboston.com/profile.php?user=2
Facebook – http://www.facebook.com/pages/TheNewBoston/464114846956315
Google+ – https://plus.google.com/+BuckyRoberts/posts
Twitter – http://twitter.com/#!/bucky_roberts
Donate – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5K9RJVCAKWZKS
I don't get it what does this do :
RelativeLayout.LayoutParams usernameDetails = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT
);
why do wee have two wrap_content ? why two of them and what does each one do ?
this is my skype for anyone who is also following the cource we could discuss and ask questions : fairdair
hey the setId(1); doesnt work it gives an error it wont work in an emulator please respond quick
its really hard to find the source code in your website. your search bar doesnt work.
For the object ID's, e.g. redButton.setId(2);, are those Id's public? Can I call and use them as parameters in other classes/methods?
Why do we have to learn about setting buttons,layouts,etc when have android studio providing us so many tools??is it important to learn for interviews or something?
Why you don't just use XML ???
Why is there a red line under the setId() method calls? It still works though, but the error is really annoying me.. It says "Expected resource of type id"
Hey Bucky, just got a question.
What if I need to set the width or height in terms of "dp" of "pixels" using LayoutParams??
how does the usernameDetails container know to wrap the contents of the EditText widget and not the redButton? same thing goes for the buttonDetails. how did it know to wrap the button- because it was the only thing in the relativeLayout? but then when u have multiple widgets shouldn't u be specifying something like: RelativeLayout.LayoutParams usernameDetails.username = new…. because without the .username then how does it know usernameDetails is for the username widget
edit: so i guess it works because when you add the final 2 statements to add the button and text field to the view, you add the button along with the buttonDetails and the edittext with the usernameDetails. that makes more sense now. It's not necessarily that it knows usernameDetails is for the username text field, it's more ur adding username with some rules u named (for convenience) usernameDetails.
I dont get why we have to put the usernameDetails above the redButton and not the redButtonDetails.
I dont know anything about java.
I have knowledge of basic concept of c++ and c.
should I continue with this tutorials or just come back after learning Java
someone please explain too me what the diference & benefit between create the GUI manually and create it by drag & drop.. i did create java app with gui, all i do just drag & drop the components… im litte bit confuse
Typos: Gotta Catch 'em All.
Can anybody plz clear to me that where exactly are we coding the app ??
In MainActivity.java or activity_main.xml…
when me make changes to any one of them,the corresponsing change doesn't occur in the other file but when we run the emulator,changes from both of them are shown !!
I'm really confused about which file exactly to use to code !!
thanks for this tutorial,,,,,,,,,,,,,,
Thank you man!!!
why when i try to set ID show me erro !! http://cdn.top4top.net/i_08da244db51.png
How Can i get rid of underscore on my EditText object?
how to i label section on line, such as when you labled username imput//
omg dude's and and lads
i looked at the comment to see why my input is so high above and i cant figure it out
//user input
EditText userName = new EditText(this);
RelativeLayout.LayoutParams userNameDetails = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT
);
userNameDetails.addRule(RelativeLayout.ABOVE, redButton.getId());
userNameDetails.addRule(RelativeLayout.CENTER_HORIZONTAL);
userNameDetails.setMargins(0,0,0,50);
//add widget to layout(button is now child of layout)
buckyLayout.addView(redButton,buttonDetails);
buckyLayout.addView(userName,userNameDetails);
O_o
Why we have asign ID to button. Why can't use its name instead? in this case 'redButton'
When setting margins, int values in this case refer to pixels? What is I would like to make it relative to user's device monitor configuration?