Mobile Computing [Assignment :- 05]

Assignment :- 05 (Chapter 10)
  1. What is preference? Explain with example to store, update & delete data using private preference.
  2. Explain shared preferences to transfer data between activities with example.
  3. Write a program to create & write a data file, open that file & display in textview.
  4. Write a code to perform following operations with SQLite Databae.
    1. Create Database
    2. Create Table (with autoincrement, not null, primary key constraints)
    3.  Inserting, Updating, Deleting records.
  5. Explain query() method to retrieve data from database.
  6. Explain rawquery() method & SQLiteQueryBuilder class to retrieve data from SQLite database.
  7. What is persistent database? Write a code to create persistent database.
  8. Explain cursoradapter to  bind data with container controls.

Mobile Computing [Assignment :- 04]

Assignment :- 04 (Chapter 7,8,9)
  1. Define View & ViewGroup. Differentiate View with ViewGroup.
  2. Write a note on Hierarchy Viewer Tool.
  3. What is Layout? Explain following layouts for designing interface with example. (purpose, tag, major attributes, xml file code example, screen design, when it is more suitable?)
    1. LinearLayout
    2. FrameLayout
    3. RelativeLayout
    4. TableLayout.
  4. Explain in brief ArrayAdapter & CursorAdaptter. Differentiate ArrayAdapter vs. CursorAdapter.
  5. Explain following container controls with suitable example.
    1. ListView
    2. GalleryView
    3. GridView
  6. Explain tab control with suitable example.
  7. Explain appropriate methods of paint class to perform following tasks.
    1. To set color (setColor())
    2. Paint antialiasing
    3. Setting style (setStyle())
    4. Applying gradient effect (setShader())
    5. Setting text effects (text size, set typeface)
  8. Explain various methods of the canvas to draw Circle, Rectangle, RoundedRectangle, Oval, Text (Method name, example).
  9. Explain  Linear Gradient, Radial Gradient, Sweep Gradient paint gradients.
  10. How to set “Bitmap” on canvas? Explain following operations on Bitmap picture.
    1. Scaling
    2. Rotate
    3. Scale
  11. Write example to draw following objects using ShapeDrawable.
    1. Rectangle
    2. Rounded Rectangle
    3. Oval & Circle
    4. Arc
    5. Line
    6. Path
  12. How android supports animation? Differentiate frame-by-frame vs. Tweened animation.
  13. Explain frame-by-frame animation with example.
  14. Explain Tweened animation (animation as xml resource & programmatically, sequential tweened animation example) with following transformations.
    1. Transparency
    2. Rotating
    3. Scaling
    4. Movement
  15. What is interpolator? List & explain different interpolator.

SQLite Database Management in Android

Creating Database

SQLiteDatabase db;

db = openOrCreateDatabase(“my_sqlite_database.db”,  SQLiteDatabase.CREATE_IF_NECESSARY,null);

Creating Table

String s = “CREATE TABLE tbl_authors (id INTEGER PRIMARY KEY AUTOINCREMENT,firstnameTEXT,lastname TEXT);”;


Inserting data to the table

Method : 1

db.execSQL( “insert into tbl_authors(firstname, lastname) values (‘Yashvant‘, ‘Kanetkar‘ );” );

Method : 2

ContentValues values = new ContentValues();

values.put(“firstname“, “Yashvant“);

values.put(“lastname“, “Kanetkar“);

db.insert(“tbl_authors”, null, values);

Updating data to the table :

Updating data to the table :

Method : 1

db.execSQL(“update tbl_authors set firstname=’I’ where lastname=’Bayross‘;”);

Method : 2

ContentValues values = new ContentValues();

values.put(“firstname“, “Y”);

db.update(“tbl_authors”, values, “lastname=?”, new String[] {“Kanetkar“});

Deleting data from the table :

Method : 1

db.execSQL(“delete from tbl_authors where firstname=’I'”);

Method : 2

db.delete(“tbl_authors”, “firstname=?”, new String[]{“Y”});

Mobile Computing [Assignment :- 03]

Assignment :- 03

  1. Explain following widgets with example. (Widget Purpose, description about widget, Designing XML (Specify major attribute) & Java way, Provide suitable example to handle at least one event of widget, at least 3 methods of the widget)
    1. TextView
    2. EditText
    3. AutoCompleteTextView
    4. MultiAutoCompleteTextView
    5. TimePicker
    6. DatePicker
    7. Chronometer
    8. Spinner
    9. Button
    10. ToggelButton
    11. ImageButton
    12. CheckBox
    13. RadioGroups, RadioButton
    14. ProgressBar
    15. SeekBar
    16. RatingBar
    17. DigitalClock
    18. AnalogClock
    19. OptionsMenu
    20. ContextMenu
  2. Explain handling following events with example.
    1. Touch mode change
    2. Events on the screen (PreDraw, GlobalLayout, GlobalFocusChange)
    3. Long Click
    4. Focus Change
  3. What are dialogs in android? Explain dialog supported by android with example.                          (Provide example for each dialog i.e. AlertDialog, CharacterPickerDialog, DatePickerDialog,          ProgressDialog, TimePickerDialog)
  4. Explain lifecycle of a Dialog.
  5. Explain creating & applying “Style” & “Theme” to android application with example.