Posts

Showing posts from August, 2017

Creating An Android App Source Code Final Of One Project Just Java App

Image
XML FORMAT <? xml version= "2.0" encoding= "utf-8" ?> < LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" android :layout_width= "match_parent" android :layout_height= "match_parent" android :orientation= "vertical" tools :context= ".MainActivity" > < TextView android :layout_width= "wrap_content" android :layout_height= "wrap_content" android :layout_margin= "16dp" android :text= "quantity" android :textAllCaps= "true" /> < LinearLayout android :layout_width= "match_parent" android :layout_height= "wrap_content" android :orientation= "horizontal" > < Button android :id= "@+id/button4" an...

Combining Strings Together Subtitles

When dealing with strings in Java, an important concept to understand is string concatenation. Now that's a really big word, but it just means we're joining character strings together end to end. If this is a string and this is a string, you can combine them by concatenating them to make an even longer string. To concatenate these strings together, we use the plus operator. This is the same addition symbol that we know from math. Just like you can add numbers together, you can concatenate strings together. Let's look at an example. Say I have three different strings, one string literal says I need, another string literal says 2 cups of coffee, and another string literal says on Monday. I can use the plus symbol to concatenate all these strings together. That forms a ginormous string that says I...

Nested View Group

Image
When discussing how to position views in the last quiz, you may have mentioned using a relative layout. I know we did. But I want to introduce you to another way that you can build the layout for our app that would be more ideal, using nested viewgroups. Nested viewgroups means putting viewgroups inside other viewgroups. That way you can build more interesting and complex layouts like these. Let's see how you would build up one of these layouts. Say, for example, you have a vertical linear layout with three views, an image view and two text views. What if you wanted to overlay some text on top of this image? Well, with a linear layout, you can't overlap views. But with a relative layout, you can, so we can replace this child with a relative layout instead. Then, we can put the image view inside this relativ...