Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.What are the three principal data storage options in Android? Provide brief de

ID: 3808137 • Letter: 1

Question

1.What are the three principal data storage options in Android? Provide brief description for each option.

2.

In the simple list:

A.why it is necessary to use android:id attribute as @id/android:list rather than using @+id/

B.How this changes the way to grab the ListView widget in the relevant java class instead of using findViewById method?

Add a ListView with an android:id of @android:id/list to your layout, where you want the list to appear.

Or, delete your onCreateView() implementation, so you get the inherited ListView that you get from ListFragment.

Or, change your fragment to inherit from Fragment, not ListFragment and manage a ListView by yourself.

Or, change your fragment to inherit from Fragment and do not attempt to show a list in it.

3.Clarify the benefits of using DialogFragment subclass as an alternative of using dialog helper methods in the Activity class.

4.Clarify the differences between the types of location sensors built-in to the mobile device. And how the Location information is accessed within an app?

5.

Illustrate the concept of how sensors and managers used to access sensor data to create a compass that calculate the device heading.

package com.example.daycalculator;

import java.util.ArrayList;

import java.util.List;

import android.app.Activity;

import android.os.Bundle;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.ArrayAdapter;

import android.widget.Button;

import android.widget.Spinner;

import android.widget.Toast;

import android.widget.EditText;

public class MainActivity extends Activity {

private Spinner spinner1, spinner2;

private EditText EditText;

private Button btnSubmit;

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

addItemsOnSpinner2();

addListenerOnButton();

addListenerOnSpinnerItemSelection();

}

// add items into spinner dynamically

public void addItemsOnSpinner2() {

spinner2 = (Spinner) findViewById(R.id.day);

List<String> list = new ArrayList<String>();

list.add("1"); list.add("2");list.add("3");list.add("4");list.add("5");list.add("6");list.add("7");

list.add("8");list.add("9");list.add("10");list.add("11");list.add("12");list.add("13");list.add("14");

list.add("15");list.add("16");list.add("17");list.add("18");list.add("19"); list.add("20");list.add("21");

list.add("22");list.add("23");list.add("24");list.add("25");list.add("26");list.add("27");

list.add("28");list.add("29");list.add("30");list.add("31");

ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,

android.R.layout.simple_spinner_item, list);

dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

spinner2.setAdapter(dataAdapter);

}

public void addListenerOnSpinnerItemSelection() {

spinner1 = (Spinner) findViewById(R.id.month);

spinner1.setOnItemSelectedListener(new CustomOnItemSelectedListener());

}

// get the selected dropdown list value

public void addListenerOnButton() {

spinner1 = (Spinner) findViewById(R.id.month);

spinner2 = (Spinner) findViewById(R.id.day);

setEditText((EditText) findViewById(R.id.year));

btnSubmit = (Button) findViewById(R.id.btnSubmit);

btnSubmit.setOnClickListener(new OnClickListener() {

@Override

public void onClick(View v) {

Toast.makeText(MainActivity.this,

"OnClickListener : " +

" Spinner 1 : "+ String.valueOf(spinner1.getSelectedItem()) +

" Spinner 2 : "+ String.valueOf(spinner2.getSelectedItem()),

Toast.LENGTH_SHORT).show();

}

});

}

public EditText getEditText() {

return EditText;

}

public void setEditText(EditText editText) {

EditText = editText;

}

}

PLease write by computer and answer all question.. THANKS

Explanation / Answer

The principle data storage options are::

1. Shared Preferences --- It allows you to save data in the form of key-value pairs of primitive data types. The data will remain saved even if the application is killed. It is mainly used for saving Settings related data as it seems very convenient for this purpose.

2. SQLite Databases --- It enables you to make structured database in the form of table. It is private to an application. One can make as many databases for an application as required.SQLite is a relational database management system contained in a C programming library.

3. Internal or External Memory --- It allows you to store private data on the device memory also and store public data on the shared external storage. In case of internal memory, the files saved are private to your application and cannot be accessed by other applications whereas files stored in external memory can be accessed and modified externally.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote