You are on page 1of 13

ANDROID COURSE

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)

● Newbie (authentication is OPTIONAL (0.25p)):


○ Provide GIT access;
○ Min. 3 Activities & 4 Fragments; (1p)
○ Local database + show data in RecyclerView (use a CUSTOM adapter) ; (1p)
■ Local database options: Room, SQLite, Realm
○ Data stored in SharedPreferences; (0.5p)
○ Use an API (Firebase, Facebook, Google Maps, etc.) (optional); (0.5p)
○ Server requests (min. 1) + deserialize/parse JSON & load data into RecyclerView or store them into local
DB. (1p)/ (1.5p if you don’t have Homework 3) Helpers:
■ https://uinames.com/api/?amount=10
■ https://randomname.de/?format=json&count=10&phone=a
■ https://loremflickr.com/
○ Min. 1 Background Task (Service, Scheduled Job, Broadcast, Alarm) (1p)/ (2p if you don’t have Homework
3) & perform background operations using AsyncTask (if needs).
○ User friendly app. Landscape Mode is OPTIONAL (0.25p) . Create min. 1 Shape Drawable; (0.5p)
○ NO CRASH! (crash = -2p)
● In order to receive following points, your app must
respect it’s scope.

Final project ○ Total: 10.0p (optionals) + 1p (Gift)

● Android Master (authentication is MANDATORY (1p)):


○ Provide GIT access;
○ Min. 3 Activities & 7 Fragments; (1p)
○ Local database + show data in RecyclerView (use a CUSTOM adapter) ; (1p)
■ Local database options: Room, SQLite, Realm
○ Data stored in SharedPreferences; (1p)
○ Use an API (Firebase, Facebook, Google Maps, etc.); (1p)
○ Server requests (min. 3) + deserialize/parse JSON & load data into RecyclerView or store them into local DB. (1p) Helpers:
■ https://uinames.com/api/?amount=10
■ https://randomname.de/?format=json&count=10&phone=a
■ https://loremflickr.com/
○ Min. 2 Background Tasks (Service, Scheduled Job, Broadcast, Alarm) & perform background operations using AsyncTask. (1p)
○ Show notifications which opens app at certain pages; (1p)
○ Share app content to be accessed through deeplink; (1p)
○ User friendly app. Landscape Mode is MANDATORY. Custom animations for transitions. Create min. 3 Shape Drawables. (1p)
○ NO CRASH! (crash = -2p)
Final project

● 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

● An activity is a single, focused thing that the user can do.

● 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).

● To be of use with Context.startActivity(), all activity classes must have a


corresponding <activity> declaration in their package's
AndroidManifest.xml.
Activity Lifecycle

● Activities in the system are


managed as an activity stack.
When a new activity is started, it is
placed on the top of the stack and
becomes the running activity -- the
previous activity always remains
below it in the stack, and will not
come to the foreground again until
the new activity exits.
Activity Lifecycle

● 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

● A Fragment represents a behavior or a portion of user interface in an


Activity.

● You can combine multiple fragments in a single activity to build a multi-pane


UI and reuse a fragment in multiple activities. You can think of a fragment as
a modular section of an activity

● When you add a fragment as a part of your activity layout, it lives in a


ViewGroup inside the activity's view hierarchy and the fragment defines its
own view layout.
Fragments
Fragments Design Philosophy
Fragment Lifecycle

● 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

You might also like