Support Libraries
The Android Support Libraries provide backward compatibility with older versions of Android. THey sit outside the…
Fragments lifecycle
Activity states Fragment callbacks Activity created onAttach() onCreate() onCreateView() onActivityCreated() onAttach(Context)This happens when the fragment is…
What fragment code looks like
When you create a fragment, Android Studio creates two files for you: Java code for the…
How to add a fragment to a project
To add a fragment to your project… highlight the folder “app/src/main/java Go to “File” in menu…
Fragments explaination
What if you want your app to look and behave differently depending on whether itÄs running…
android:gravity
android:gravity=”value” android:gravity lets you say where you want the view’s contents to appear inside the view…
android:layout_gravity
android:layout_gravity lets you say where you want views to appear in their available space. android:layout_gravity deals…
LinearLayout
How you specify a linear layout You specify a linear layout using <LinearLayout>. You must specify…
The State of an activity
When Android creates and destroys an activity, the activity moves from being launched to running to…
Handlers allow you to schedule code
In non-Android Java, you can perform tasks like using a background thread. In Android, that approach…
AndroidManifest.xml
Every Android app must include a file called AndroidManifest.xml. You can find it in the app/src/main…
Use a custom Class in Android Studio
Add a cutom class to an Android project by going to File menu -> New ->…
findViewById()
We can get references for our two GUI components using a method called findViewById(). This method…
String Resource Files
string.xml is the default resource file used to hold name/value pairs of Strings sot that they…
Static variables
A static variables value is the same for aALL instances of the class…The static duckCount variable…
About inheritance
Simple rules for building a better inheritance design. DO use inheritance when one class is a…
Using IS-A and HAS-A
Remember that when one class inherits from another, we say that the subclass extends the superclass.…
Developing a Class
An example how to design classes… Figure out what the class is supposed to do List…
Extreme Programming
XP emerged in the late 90’s and has been adopted by many Developers. The thrust of…
Parameter and arguments
A method uses parameters. A caller passes arguments. Arguments are the things you pass into the…
Arrays
Arrays are always objects, whether they’re declared to hold primitives…int[] nums;nums = new int[3];nums[0] = 4;nums[1]…
Variables
Variables come in two flawors: Primitives Reference Primitives Primitives hold fundamental values (think: simple bit patterns)…
Activities
Activities are the unique screen pages in Android! An activity is a single focused thing your…