Professional Documents
Culture Documents
Android PDF
Android PDF
3.2
● !!! In order to receive the following points, your app must respect it’s scope.
○ Total: 5.0p + 1.0p (optionals) + 1p (Gift)
Final project ○ Total (without homework 3): 7.5p + 1.0p (optionals) + 1p (Gift)
● Helpers:
○ https://material.io/design/
○ http://jakewharton.github.io/butterknife/
○ http://square.github.io/dagger/
○ https://square.github.io/retrofit/
○ https://github.com/ReactiveX/RxJava
○ https://github.com/ArthurHub/Android-Image-Cropper
○ https://github.com/Yalantis/uCrop
○ https://fontawesome.com/icons?d=gallery
○ https://github.com/google/gson
○ https://square.github.io/picasso/
○ https://github.com/google/volley
○ etc...
Activity
● Almost all activities interact with the user, so the Activity class takes care of
creating a window for you in which you can place your UI with
setContentView(View).
● onCreate()
○ Called when the activity is first created;
○ This is where you should do all of your normal static set up: create views, bind data to lists,
etc.
● onRestart()
○ Called after your activity has been stopped, prior to it being started again.
● onStart()
○ Called when the activity is becoming visible to the user;
● onResume()
○ Called when the activity will start interacting with the user.
○ At this point your activity is at the top of the activity stack, with user input going to it.
Activity Lifecycle
● onPause()
○ Called when the system is about to start resuming a previous activity.
○ This is typically used to commit unsaved changes to persistent data, stop animations and
other things that may be consuming CPU, etc.
● onStop()
○ Called when the activity is no longer visible to the user, because another activity has been
resumed and is covering this one.
● onDestroy()
○ The final call you receive before your activity is destroyed.
○ Called when:
■ the activity is finishing (someone called finish() on it);
■ the system is temporarily destroying this instance of the activity to save space.
Fragments
● onCreateView()
○ The system calls this when it's time for the fragment to
draw its user interface for the first time.
○ To return a layout from onCreateView(), you can inflate
it from a layout resource defined in XML. To help you
do so, onCreateView() provides a LayoutInflater
object.
Homework No. 1
● Create 2 Activity classes. The first one will contain a static fragment and the
second one a container to add fragments.
● We’ll note F1A1 fragment no. 1 from activity no. 1 (this is not an official
notation).
● F1A1 will contain a button which will send the user to the second activity.
● F1A2 will contain a button which will add F2A2
● F2A2 will contain 3 buttons (vertically centered):
○ Button1 - replace F2A2 with F3A2
○ Button2 - remove F1A2
○ Button3 - close the activity
● Pressing back from the second activity will close the app