- What is preference? Explain with example to store, update & delete data using private preference.
- Explain shared preferences to transfer data between activities with example.
- Write a program to create & write a data file, open that file & display in textview.
- Write a code to perform following operations with SQLite Databae.
- Create Database
- Create Table (with autoincrement, not null, primary key constraints)
- Inserting, Updating, Deleting records.
- Explain query() method to retrieve data from database.
- Explain rawquery() method & SQLiteQueryBuilder class to retrieve data from SQLite database.
- What is persistent database? Write a code to create persistent database.
- Explain cursoradapter to bind data with container controls.
Monthly Archives: October 2011
Mobile Computing [Assignment :- 04]
- Define View & ViewGroup. Differentiate View with ViewGroup.
- Write a note on Hierarchy Viewer Tool.
- 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?)
- LinearLayout
- FrameLayout
- RelativeLayout
- TableLayout.
- Explain in brief ArrayAdapter & CursorAdaptter. Differentiate ArrayAdapter vs. CursorAdapter.
- Explain following container controls with suitable example.
- ListView
- GalleryView
- GridView
- Explain tab control with suitable example.
- Explain appropriate methods of paint class to perform following tasks.
- To set color (setColor())
- Paint antialiasing
- Setting style (setStyle())
- Applying gradient effect (setShader())
- Setting text effects (text size, set typeface)
- Explain various methods of the canvas to draw Circle, Rectangle, RoundedRectangle, Oval, Text (Method name, example).
- Explain Linear Gradient, Radial Gradient, Sweep Gradient paint gradients.
- How to set “Bitmap” on canvas? Explain following operations on Bitmap picture.
- Scaling
- Rotate
- Scale
- Write example to draw following objects using ShapeDrawable.
- Rectangle
- Rounded Rectangle
- Oval & Circle
- Arc
- Line
- Path
- How android supports animation? Differentiate frame-by-frame vs. Tweened animation.
- Explain frame-by-frame animation with example.
- Explain Tweened animation (animation as xml resource & programmatically, sequential tweened animation example) with following transformations.
- Transparency
- Rotating
- Scaling
- Movement
- 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);”;
db.execSQL(s);
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
- 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)
- TextView
- EditText
- AutoCompleteTextView
- MultiAutoCompleteTextView
- TimePicker
- DatePicker
- Chronometer
- Spinner
- Button
- ToggelButton
- ImageButton
- CheckBox
- RadioGroups, RadioButton
- ProgressBar
- SeekBar
- RatingBar
- DigitalClock
- AnalogClock
- OptionsMenu
- ContextMenu
- Explain handling following events with example.
- Touch mode change
- Events on the screen (PreDraw, GlobalLayout, GlobalFocusChange)
- Long Click
- Focus Change
- What are dialogs in android? Explain dialog supported by android with example. (Provide example for each dialog i.e. AlertDialog, CharacterPickerDialog, DatePickerDialog, ProgressDialog, TimePickerDialog)
- Explain lifecycle of a Dialog.
- Explain creating & applying “Style” & “Theme” to android application with example.