Android Application Development Training

Passing data between activities in Android

Objective :

  • Passing data between activities in Android
  • Passing multiple data between activities in Android
  • Passing array between activities in Android
  • Passing ArrayList between activities in Android
  • Passing ArrayList to another activity in Android
  • Sending data via Intent in Android
  • Sending multiple data via Intent in Android
  • Sending array between activities in Android
  • Sending ArrayList between activities in Android
  • Sending ArrayList to another activity in Android
  • Sending data via Intent and Bundle in Android
  • Sending multiple data via Intent and Bundle in Android
  • Passing array between activities in Android using Intent and Bundle
  • How to pass array to another activity in Android?
  • How to pass array between activities in Android?
  • How to pass data to another activity in Android?
  • How to pass data to activity in Android?
  • How to pass data to between activities in Android?
  • How to pass ArrayList to another activity in Android?
  • How to pass ArrayList between activities in Android?

 

Code for passing data between activities in Android :

ActivityOne.java

[sourcecode lang=”java”]

String value = "Hello!";
Intent in = new Intent(this,ActivityTwo.class);
in.putExtra("Key", value);
startActivity(in);

[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]

Bundle bundle = getIntent().getExtras();
String valueReceived = bundle .getString("Key");

[/sourcecode]

 

Code for passing multiple data or values between activities in Android :

Method 1 : Using Intent to pass data and Bundle to extract data between activities in Android

ActivityOne.java

[sourcecode lang=”java”]

String value1 = "Hello!";
String value2 = "Hi!";
Intent in = new Intent(this,ActivityTwo.class);
in.putExtra("Key1", value1);
in.putExtra("Key2", value2);
startActivity(in);
[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]
Bundle bundle = getIntent().getExtras();
String valueReceived1 = bundle .getString("Key1");
String valueReceived2 = bundle .getString("Key2");
[/sourcecode]

 

Method 2 : Using Bundle to pass and to extract data between activities in Android

ActivityOne.java

[sourcecode lang=”java”]

String value1 = "Hello!";
String value2 = "Hi!";
Intent in = new Intent(this,ActivityTwo.class);
Bundle bundle = new Bundle();
bundle.putString("Key1", value1);
bundle.putString("Key2", value2);
in.putExtras(bundle);
startActivity(in);
[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]
Bundle bundle = getIntent().getExtras();
String valueReceived1 = bundle .getString("Key1");
String valueReceived2 = bundle .getString("Key2");
[/sourcecode]

 

Code for passing array between activities in Android :

ActivityOne.java

[sourcecode lang=”java”]
String[] array = new String[]{"Item1", "Item2", "item3", "Item4", "item5"};
Intent in = new Intent(this,ActivityTwo.class);
Bundle bundle = new Bundle();
bundle.putStringArray("MyArray", array);
in.putExtras(bundle);
startActivity(in);
[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]
Bundle bundle = getIntent().getExtras();
String arrayReceived[] = bundle.getStringArray("MyArray");
[/sourcecode]

 

Code for passing ArrayList between activities in Android :

ActivityOne.java

[sourcecode lang=”java”]
ArrayList<String> array = new ArrayList<String>();
array.add("Hello");
array.add("Hi");
array.add("Bye");
Intent intent = new Intent(this, ActivityTwo.class);
intent.putExtra("array_list", array);
startActivity(intent);
[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]
Bundle bundle = getIntent().getExtras();
ArrayList<String> array = (ArrayList<String>) bundle.getStringArrayList("array_list");
[/sourcecode]


Have fun with Intent.

Android Workshop at DACER (SVSS)

[gigya src=”http://player.videofy.me/player.swf?videoId=971007″ width=”480″ height=”360″ quality=”high” wmode=”transparent” allowFullScreen=”true”]

Conducted 2 days Android Workshop at Dr. Ambedkar College of Engineering & Research from 2 Mar 2013 to 3 March 2013, daily 9 am to 5 pm. The workshop was organized in association with the ADCC Academy, Nagpur under the Entrepreneurial Development Program (EDP).

Android Workshop at RGCER (NYSS)

[gigya src=”http://player.videofy.me/player.swf?videoId=970900″ width=”480″ height=”360″ quality=”high” wmode=”transparent” allowFullScreen=”true”]

Conducted 3 days Android Workshop at Rajiv Gandhi College of Engineering & Research (formerly known as NYSS College), Nagpur from 25 Feb 2013 to 27 Feb 2013. The workshop was organized in association with the ADCC Academy, Nagpur under the Entrepreneurial Development Program (EDP).

The students who participated in this workshop had a great fun & learned a lot as per their feedback after the workshop, now the college have organized the Android Application Development Contest on 6th March 2013 and I am going to be the Judge for the event, lets see how students can develop Android Applications and what innovations they can come up with?

FLAMES

FLAMES

FLAMES

I have developed the well known game FLAMES (Friend – Love – Affection – Marriage – Enemy – Sibling) on Android & J2ME Platforms, have a look at the Android version of the FLAMES, very soon it will be available with Google Play to download for free of cost.

FLAMES allows you to check out the relationship between two people just by entering their names & single click on “?” button.

Download FLAMES from Google Play for free now.

If you like FLAMES, like Facebook Page of FLAMES.

Checkout Video to know how FLAMES works :

[gigya src=”http://player.videofy.me/player.swf?videoId=702646″ width=”480″ height=”360″ quality=”high” wmode=”transparent” allowFullScreen=”true”]

Download & have great fun while checking relations on the go.

Seminar on Android

[gigya src=”http://player.videofy.me/player.swf?videoId=617129″ width=”480″ height=”270″ quality=”high” wmode=”transparent” allowFullScreen=”true” ]

Delivered Seminar on Android at Lt. Vasantdada Polytechnic, Nagpur between 11 AM to 1 PM on 8th Sept. 2012. It was a great experience to deliver seminar in my own college.

Seminar on Android & Cloud Computing

[gigya src=”http://player.videofy.me/player.swf?videoId=614491″ width=”480″ height=”270″ quality=”high” wmode=”transparent” allowFullScreen=”true” ]

Seminar conducted on Android & Cloud Computing at Dharampeth Polutechnic, Nagpur on 1st Sept. 2012 between 11.00 am to 1.00 pm. Great Session!

Android Application Development Training

Sharda Infotech, one of the leading IT firm who is into Corporate Training since 2006 now offers Android Application Development Training, also offering jobs after completing the training depending on the performance of the candidate since Sharda Infotech is also in development from the same time & now has started Android Application Development too.

For more details mail us at training@shardainfotech.com or call us on 091 – 9766210353.

If you are interested in starting your own business or franchise, write to us at franchise@shardainfotech.com or call us on 091 – 9766210353.

Seminar on Android & Mobile Application Development

[gigya src=”http://player.videofy.me/player.swf?videoId=552930″ width=”480″ height=”270″ quality=”high” wmode=”transparent” allowFullScreen=”true”]

Delivered Seminar on Android & Mobile Application Development on 22nd June 2012, Time 6 PM to 8 PM at Seed Infotech, Nandanvan, Nagpur. The Seminar was organised via Seed Infotech & received a great response from the students. It was a great experience working with Seed Infotech. And I was mesmerized by the excitement & enthusiasm shown by the students.

Want to Learn Android?

Learn Android in Nagpur

Great news for Nagpur people, now you don’t need to go anywhere else & can learn, explore Android.

Sharda Infotech, one of the leading IT firm who is into Corporate Training since 2006 now offers Android Application Development Training, also offering jobs after completing the training depending on the performance of the candidate since Sharda Infotech is also in development from the same time & now has started Android Application Development too.

For more details mail us at training@shardainfotech.com or call us on 091 – 9766210353

If you are interested in starting your own business or franchise, write to us at franchise@shardainfotech.com or call us on 091 – 9766210353