• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/77

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

77 Cards in this Set

  • Front
  • Back

What are the 4 Pillars of OOP?

Inheritance, Encapsulation, Abstraction, and Polymorphism

What is Encapsulation?

Grouping of variables and methods within a class to define how an object will behave when it is created. For example



public class Animal {



int age;


String gender;



// Required Parameters to create Animal


// object


public Animal (int age, String gender) {


this.age = age;


this.gender = gender;


}



// method can be used with created Animal


// object


public void eat() {


System.out.println("Eating...");


}



}



// Main class to create Animal objects


public class Zoo {


public static void main(String[] args) {



// Animal object creation with parameters


Animal cat = new Animal (4, "Kitty");


// Method from Animal class


cat.eat();


}


}

What is Abstraction?

Allows for a class to both declare and define methods to be used as a Parent class when creating children. public class Jaime extends Abstract Undefined methods from the Abstract Class must be defined and implemented in child class. public void eat() {System.out.println("Lactose free foods")}•

What is Polymorphism?

A method used by different classes that has the same name but different definitions. For example move() can be used by a car, human, and animal class but defined for each class differently. A car can drive, a human can walk, and an animal can swim but they all move()

What is Inheritance?

Allows for an class to use methods from another class to create objects with those borrowed methods. For example, Jaime class can borrow move() from Human class and move() can be defined in the Jaime class. Jaime must extend from Human to borrow those methods. •public class Jaime extends Human{}

What is OOP?

Object Oriented Programming. Instead of having all the code in one file, split the code into multiple files to be more organized.

What is an Android Studio Service?

An event that runs in the background not without needing to interact with the user and it works even if the app is destroyed. For example, a music player playing music even when the user leaves the app.

What is the Activity Lifecycle?

onCreate, onStart, onPause, onResume, onStop, onDestroy

What is an Interface?

A class that declares methods to be used and defined by another class. For example, if multiple classes will be using getData() an interface with that method can be created to clean up the code from redundant code.

What is SQLite?

A local Database emedded in the app that a user gets data from.

What is a Cursor?

Used to send data from a database using ContentProvider to give it's data to another app.

What is CRUD?

Create, read, update, and delete in SQLite

What is JSON Parsing?

The collection and reading of data whether it is stored data locally or done so with pulling data from the web.

What is Espresso?

Part of Test Driven development. @Test used to test specific functions like a button to make sure it is working properly within an Activity.

What is the difference between Interface and Abstract Class?

Interface allows you to declare a method whereas abstract classes allow you to declare a method and define a method

What is SDLC?

System development life cycle. Analysis (what we don't want), planning (what we do want), design(how will we get what we want), build, test (did we get what we want), deploy (let's use what we got), and maintenance (let's get close to what we want).

What is MVP?

Model View Presenter. A way to organize code focused on Test Driven Development.

What are Android Architecture Components?

Room, ViewModel, LiveData, RecyclerView. UI lifecycle and data persistence. Make sure things load easier, prevent memory leaks.

What is MVVM?

Model View ViewModel. A way to organize code with a focus on Databases, event based. View updates ViewModel of users actions, ViewModel sends relevant data to the View, DataModel extracts the data from the source to give to the ViewModel.



What is REST?

Representational State Transfer. A way to access web services/data. JSON and XML can be used.

What is SOAP?

Simple Object Access Point. A way to access web services/data. HTTP and XML exclusive.

What is MVC?

Model View Controller. Controller gets the data, sends it to the model, tells the view to get the data from the model.

What is RxJava?

Simplifies thread executions. For example simplifies AsyncTasks.

What is the difference between SOAP and REST?

REST is more flexible allowing the use of HTTP, JSON, XML, and URL. SOAP is exclusive with HTTP and XML.

What is MySQL?

An outside web based server database that a user gets data from using a network connection.

What is the difference between SQLite and MySQL?

SQLite is a database embedded in the app that a user gets data from. MySQL is an web based server database that the user gets data from.

What is a Broadcast?

A system or app event occurs like when a file is downloaded, airplane mode is on or off.

What is a BroadcastReceiver?

Allows you to subscribe to a system or app event to be notified when it happens in the app.

What is a Content Provider?

Allows for one app to gain access to another apps database using Content Resolver (asker) and Cursor (giver).

What is a Content Resolver?

Used to request data from another apps database.

What is an Android App?

Essentially an android app consists of Activities (programs that the user interacts with), services (programs that run in the background or provide some function to other apps), and broadcast receivers (programs that catch information important to your app).

Activity life cycle - Can I save all my database updates in onStop()?

No. onPause. In case of low memory or configuration changes, onStop might not be called.


What is the difference between this and getapplicationcontext?


This is tied to the current activity lifecycle and getapplicationcontext is tied to the whole app lifecycle.


What is the UI response time limit in android?


5 seconds in general and 10 seconds for a BroadcastReceiver.


What is Bundle? How it is different from parcel?

A bundle is used for sending simple intent data to another activity. Parcel is used for more complex methods to send to another activity.


How to write a custom adapter?

Create layout for adapter view, Class with data setters/getters, create those data objects main activity and add data objects to ArrayList, create custom adapter Class to override getview and pass in objects from ArrayList.


How to fix an android application crash? How to analyze a crash using logcat?

Analyze the logcat by looking for the blue links. Above the blue links will be the main crash error. The blue links lead to where the crash occurred. If no blue links, use search for "error" or "fail".


What is a singleton class?

What is a singleton class?Object created only one time and will not be destroyed until the app process is destroyed. Used globally.


How to save UI states in case of configuration changes? (eg: screen orientation changes).

Create String key variables. Override onSaveInstanceState and pass in data to string key variables. Call onSaveInstanceState in onCreate to pass string key variables to views like TextView.


What is a fragment? How it differs from activity?

Fragment is part of an activity with it's own UI and lifecycle. Activity exists independently while Fragment exists within an activity.


How to parse JSON data that is coming from a server?

Create a class with AsyncTask that fetches the data from the URL. Create and iterate JSONArray to create JSONObject that goes through the JSON data.


What is 9 patch image? when to use it?

A resizable PNG image with custom parameters that can be used for displaying text within the image.


How will you write an application which fits both for mobiles and tablets?

Create a separate layout with smallestWidth at 600dp and adjust the layout.


What is the Memory limit of each process in android?

Varies from device but generally 16mb is the given memory for each device.


What kernel is used in android?

Monolithic Kernal. Linux based.


How to fetch a contact person number from contact application using content provider?

Must use a Content Resolver (asker) to connect to the content provider and a Cursor (giver) to send that data.


How to upgrade data base tables in the later versions of an application?

Under onCreate use onUpgrade to the current version number. Make sure in onCreate table is being created.


What is the difference between dynamic receiver and static receiver? when will you use dynamic broadcast receivers?

Static is when app is not running and dynamic is only when app is running. Dynamic can be used when we only want music to play when app is open for example to save battery life.


What is intent, pending intent, and sticky intent?

Intent communicates actions immediately in Android. PendingIntent is an intent that will occur at a later time, alarm clock going off. Sticky Intent will keep getting updates on a service like battery life.


What is the difference between thread and a service?

Service runs on the main UI thread and thread runs on its own separate thread.


How will you create an async task?

Create class that extends AsyncTask and override doInBackground. Then run the desired methods. onPostExecute to update UI.


What is a handler thread? how it is different from normal thread?

Handler communicates with and handles multiple threads to send to the message que to update the UI. Thread by itself executes outside the message que and can't update the UI.


What is looper, handler, and message queue?

Looper cycles through the threads sent from the handler in a message queue that stores the threads to be performed and update the UI.


How to update UI from another thread?

Use AsyncTask onPostExecute. Once thread process is done onPostExecute updates UI.


How to pass data between 2 components of android?

Send the data using a new Intent.putextra and create a bundle to get the data on the other end.


What is a binder service? how it differs from started service?

Binder service establishes a connection between something and is destroyed when calling component is destroyed. Started keeps running. BinderService to track user but stops when app closes. Started service with music player to keep playing music after app closes.


If I write a background functionality in an activity, should I use a thread or service?

A service and extend it with AsyncTask to safely run it in the background.


What is ANR? What is the cause of ANR and how will you rectify this problem?

Application not responding. Usually caused by long running actions main thread. Using AsyncTasks helps to run long tasks in the background safely.


How to do inter-thread communication in android, using handlers?

Use a Handler thread which already creates a message que. Add a handler to communicate with the Looper and the MainThreadUi.


How to create a service with single thread?

Create a service class that extends AsyncTask.


Why android uses DVM, why not JVM?

More efficient with low memory usage and better performance running multiple instances. Auto garbage collector.


How will you display database tables in an activity? will you use gridview or tableview? justify?

I would use a GridView with a RecyclerView. If data gets large, GridView will allow for scrolling and better performance and UI design.


What is the difference between abstract class and an interface?

Abstract class has methods that are both declared and defined. Interface Only declared methods.


Can you give some real time example where you have used an interface and abstract class?

For a Movie App, I used an interface integrated with an AsyncTask abstract class to populate the MainActivity UI with a list of movies from The Movies Database API.


How will achieve multiple inheritance using interfaces?

Create one public Interface with multiple interfaces.


What are all the collection framework classes you have used in your application?

Essentially an android app consists of Activities (programs that the user interacts with), services (programs that run in the background or provide some function to other apps), and broadcast receivers (programs that catch information important to your app).


What is the difference between ArrayList and Vector? which one is better?

Vector is synchronized and ArrayList is not. ArrayList has better performance.


What is the difference between Hashtable and hashmap?

Hashtable is synchronized and hashmap isn't. Hashmap can have null key and any number of null values. ConcurrentHashMap makes it thread safe.


What is the difference between JVM, JRE, and JDK?

Java Virtual Machine emulates the Java code. Java Runtime Environment provides all needed files to run JVM. Java Development Kit is what compiles, documents, and packages Java programs.

How does RxJava work?

Observables (emit data) and Observers (catch the data onNext(), catch errors onError(), catch completion onCompleted())

RxJava: Difference between onJust and onCallable?

onJust interacts with local data like a String List. onCallable interacts with network calls like online movie list. 1) Create new thread subscribeOn(), 2) update data to main thread observeOn(), 3) connect to observable list with subscribe(),

What's the difference between Observable and Single?

Single uses onSingleSubscriber and uses onSuccess() and onError().

Difference between Picasso and Glide?

Glide is more customizable, uses less memory, and allows for GIF support. Picasso loads from url faster, Glide loads faster from cache.

What is Dagger 2?

Dependency Injection; consolidating dependencies in a configuration class.

Difference between OpenAPI and Swagger?

OpenAPI = specification and Swagger = tools for implementing an API with the specification.

How many Intents are there?

3; explicit (intent resolved by specific application) and implicit (intent resolved by multiple applications) and broadcast intent (intent sent out to anyone who cares to listen like another app).

Difference between Implicit and Explicit intent?

Implicit Intent is resolved by multiple applications and Explicit is resolved by a specific app.