GTU MCA SLMC Program 2 Android Intent Example

GTU MCA SLMC Program 2 To understand Activity, Intent  a.  Create sample application with login module.(Check username and password)  b.  On successful login, go to next screen. And on failing login, alert user using Toast.  c.  Also pass username to next screen

 GTU MCA SLMC Program 2

To understand Activity, Intent  a.  Create sample application with login module.(Check username and password)  b.  On successful login, go to next screen. And on failing login, alert user using Toast.  c.  Also pass username to next screen

Hope you have understand helloworld Android Example, If so now its time time learn next one ! Here I have explained the use of multiple Activity in Android. In Android the screen what we can see is called as Activity. Here the program i would like to explain how to create two activity(Screen) and how can move from one activity to another activity on button click.

 

Question related with android intent.

  • How can an application start activity with startActivity() method  with an explicit intent? Explain with line of code.
  • Explain the line of code that create an intent Filter and register it within
    Android Manifest file?
  • How an additional data can be included in Intent?
  • What is Intent?  List  out  the various  uses  of  intent   and also explain  using
    example how to pass additional information with intent
  • What is Intent? How can  Intent  include two extra piece of information  –
    a string value and a Boolean value?
  • What is Intent? How are they used to Broadcast and Receive Events?
  • What is the use of <activity> tag and <intent-filter> tag

 

Step 1 : Create Android Application (Automatically it will add 1 Activity)

Step 2 : Right Click on Project Name goto New -> Other -> Select Activity and Add it to project.

Step 3 : Now prepare design and write down code for both activity and test it on your Android Virtual Device or your connected mobile !

 

Location : res\layout

FileName: activity_main.xml

Location : res\layout

FileName: activity_main2.xml

 

 

Location : src\package\

FileName : MainActivity.java

 

Location : src\package\

FileName : MainActivity2.java

 

Output 1

GTU MCA SLMC Program 2

 

Output 2

GTU MCA SLMC Program 2

Output 3

GTU MCA SLMC Program 2

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative