1-MAD Lab Manual.pdf - CS6611 IT6611 MOBILE APPLICATION DEVELOPMENT LABORATORY Ex.No 1 Date Develop an application that uses GUI Components Fonts and

1-MAD Lab Manual.pdf - CS6611 IT6611 MOBILE APPLICATION...

This preview shows page 1 - 3 out of 53 pages.

CS6611 / IT6611 MOBILE APPLICATION DEVELOPMENT LABORATORY 1 Ex.No: 1 Date : Develop an application that uses GUI Components, Fonts and Colors AIM: To develop an application that uses GUI Components, Fonts and Colors. PROCEDURE: 1. Open Eclipse IDE. 2. Create the project Ex_No_1. 3. Go to package explorer in the left hand side. Select the project Ex_No_1. 4. Go to res folder and select layout. Double click the activity_main.xml file. 5. Now you can see the Graphical layout window. 6. Drag and drop the following components: a. One TextView with text MAD Lab b. Three Buttons with labeled as Change Font Size, Change Font Color and Change Font Style 7. Again go to package explorer in the left hand side. Select the project Ex_No_1. 8. Go to src folder. Double click the MainActivity.java file. 9. In java file write the activities done by the application such as, actions of buttons. 10. Finally run the android application. PROGRAMS: activity_main.xml: < RelativeLayout xmlns:android = "" xmlns:tools = "" android:layout_width = "match_parent" android:layout_height = "match_parent" android:paddingBottom = "@dimen/activity_vertical_margin" android:paddingLeft = "@dimen/activity_horizontal_margin" android:paddingRight = "@dimen/activity_horizontal_margin" android:paddingTop = "@dimen/activity_vertical_margin" tools:context = "com.example.ex_no_1.MainActivity" > < TextView android:id = "@+id/textView1" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_alignParentTop = "true" android:layout_centerHorizontal = "true" android:layout_marginTop = "53dp" android:text = "MAD Lab" android:textAppearance = "?android:attr/textAppearanceLarge" tools:ignore = "HardcodedText" /> < Button android:id = "@+id/button1" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_alignParentLeft = "true"
Image of page 1
CS6611 / IT6611 MOBILE APPLICATION DEVELOPMENT LABORATORY 2 android:layout_alignParentRight = "true" android:layout_below = "@+id/textView1" android:layout_marginTop = "64dp" android:text = "Change Font Size" tools:ignore = "HardcodedText" /> < Button android:id = "@+id/button2" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_alignParentLeft = "true" android:layout_alignParentRight = "true" android:layout_below = "@+id/button1" android:text = "Change Font Color" tools:ignore = "HardcodedText" /> < Button android:id = "@+id/button3" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_alignParentLeft = "true" android:layout_alignParentRight = "true" android:layout_below = "@+id/button2" android:text = "Change Font Style" tools:ignore = "HardcodedText" /> </ RelativeLayout > MainActivity.java: package com.example.ex_no_1; import android.support.v7.app.ActionBarActivity; import android.graphics.Color; import android.graphics.Typeface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; public class MainActivity extends ActionBarActivity { float font = 20; int count = 1; Button b1 , b2 , b3 ; @Override protected void
Image of page 2
Image of page 3

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture