However, just one more detail to be introduced as promised and that is -
There are 2 types of intents that Android understands.
1. Explicit Intent
2. Implicit Intent
In an Explicit intent, you actually specify the activity that is required to respond to the intent. In other words, you explicitly designate the target component. This is typically used for application internal messages.
In an Implicit intent (the main power of the android design), you just declare an intent and leave it to the platform to find an activity that can respond to the intent. Here, you do not declare the target component and hence is typically used for activating components of other applications seamlessly
Note: Here for simplicity sake I tell an activity responds to an intent, it could as well be other types of components.
1. InvokingActivity
2. InvokedActivity
The InvokingActivity has a button "Invoke Next Activity" which when clicked explicitly calls the "InvokedActivity" class.
The relevant part of the code is here:
Button invokingButton = (Button)findViewById(R.id.invokebutton);
invokingButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent explicitIntent = new Intent(InvokingActivity.this,InvokedActivity.class);
startActivity(explicitIntent);
}
});
As explained in part 1 of the series, this is very much like an API call with compile time binding.
NOTE: The layout for InvokingActivity is defined in main.xml and for InvokedActivity in InvokedActivity.xml. The downloadable example can be opened in Eclipse Ganymede as an android project and can be executed.In the next part of the series, we will see how to work with implicit intents which also needs us to understand intent-filters.
HI Sai Geetha,
ReplyDeleteDoing Great Job...
learning new things all the people to.
sharing what we have learned do only some people like u......
Very glad to have found your blog! I am pretty new to any kind of programming, and I was wondering if you would have any tips on using Eclipse for android development. For example what packages work best. Thanks again my friend!
ReplyDeletehello..
ReplyDeletedo you know how to use alert dialog that when the user click ok button and then it will redirect the user to go another page?
I have a doubt not regarding android , but regarding java?
ReplyDeletewat is the purpose of using JavaVirtualMachine(JVM) ?
how it serves the purpose of platform independency in java?
how it differs from other platform dependent languages like c/c++?
Can u give elaborate and simple explanation for this doubt?
-thanks in advance
Hi,
DeleteJava is a platform independent language developed mainly for Web browser developemnt.
JVM is an interpreter. Unlike C/C++ Java is platoform independent.
Which means, It must generate a binary that is understood by all the platforms. But, it is not possible. Here JVM comes into play. JVM, comes with Java run time environment, interprets the Bytecode developed while compiling Java Source Code.
Hence, If you have any Java Byte code, it runs on all the platofrms that have JVM unlike C/C++ where a .exe generated on Windows platform cannot run on Linux platform.
I guess you understood it..
That's why JNI library is there to convert native code. Learn about JNI, you will understand better, how to use native code in java.
Deletehi sai,
ReplyDeleteanother doubt in corejava?
wat is the purpose of using hashtable?
why should vector() has its initial capacity set as 10?
can u give me solution for these doubts?
--thanks in advance
Hai Sai Geetha,
ReplyDeleteHey i'm amazed by looking this blog,you are sharing worth one to all of us, thanks a lot.
And one request i'm in need of some more code on services,please will u provide.?
Hi Sai,
ReplyDeleteIt is really a great work and the way in which u r sharing the knowledge is stupendous.Please can you help me out from ApplicationA how to call an activity which resides in ApplicatioB
using explicit intents.
I tried harde but I was not able to do so,as I am very new to android and mobile apps as well.
Regards,
Sridhar
Hi Sai,
ReplyDeleteIt is really a great work and the way in which u r sharing the knowledge is stupendous.Please can you help me out from ApplicationA how to call an activity which resides in ApplicatioB
using explicit intents.
I tried harde but I was not able to do so,as I am very new to android and mobile apps as well.
Regards,
Sridhar
Hi Sai Geetha,
ReplyDeleteThanks for your valuable information on android. I have one doubt below i am posting my question, if possible can you give me the solution, you can mail the solution to "bsabareesh@gmail.com".
My activity have two radio button in the middle of the screen, on the top of the two radio buttons, i need to scroll the different advertisements continuously from the right of the screen to the left. In what way i have to do, I kept the radio buttons, scrolling advertisements is left. Please help me to achieve this activity.
Thanks in advance.
Thank you so much! I'd been trying to figure out how to do this for a while.
ReplyDeleteHi Geetha, you are doing Very Great Job, AM suman Narayana Working for LG on Messaging domain, I would like to give you one Input we can extend this blog to the domain specific, from messaging domain I can contribute, and also we can explore much on framework level, please kindly reply your interest to suman.rohith@gmail.com
ReplyDeleteHi ,
ReplyDeleteAm new to this Android SDK platform,so could you people help me out to solve my issue.
so lets discuss brief about my issue, am developing small application in which am using sppiner to list all country states and zip codes so my question is when i select one country state in a list it should automatically populate and display its corresponding zip code.
Awaiting for response
Thanks in advance,
Madhu
Hi Geetha,
ReplyDeleteI have some queries regarding android SDK.
here are my problem statememts,
1.How to place border around some fields in UI.
2.How to call another activity from current activity e.g. making a phone call from current activity.
3.How to use Pagination.
and its very usefull if you provide any mail id so that i can mail you my queries directly becz i need to solve ASAP and till have lot many questions to get it solved
thnaks in advance,
Madhu
Hi Sridhar,
ReplyDeleteYou can communicate between two applications through intents only of the called application declares in its manifest file that it can handle a call to a specific intent. Most often, this is done through implicit intents. You can however call it explicitly too. But the pre-requisite for that is called application should declare its intent or ability to respond to a call in its manifest file.
Noble job!! Is it possible for u to mail the sample code as ppl cant open filesharinf sites in most of the workplaces :(
ReplyDeleteankur296@gmail.com
hi ,
ReplyDeleteon downloading sample codes, it leads to a mirror site. can you create another blog/page only for sample code which can be linked to this tutorial page. Because in workplace, we can't refer any mirror site for reference.
Hi Sai,
ReplyDeleteI building an application which step by step working is given below
1.My Activity is start in which I create a server UDP Socket Which wait fot data from client side.
2. Then i press to Home Button click browser Icon and start You Tube Video.
3. My Background Activity finds data send by client and generate a dialog window Activity with "yes" and "No" Button
4. After clicking on any Button the dialog window is disappear
I have done the all above task.But my problem is
1. when Dialog window appear the You Tube Video is Stop and never resume even after the Dialog window Activity and UDP Server Activity is pause.
2. Can I start my first Activity(UDP SERVER SOCKET) as a service?
Hello, I am familiar with other languages but new to Java. I don't understand what invoked the InvokingActivity at the start of the run.
ReplyDeleteThanx
Hi this is sathish, i am very new to android development, I read your blog and examples.I appreciated it. I need some help.I have same scenario like below for a media player application, can you please refer this link,
ReplyDeletehttp://efreedom.com/Question/1-3556196/Android-Can-Send-Activity-Background-Call
Can you give a solution ,
thanks in advance
sathish.avunoori@gmail.com
Hi Sai,
ReplyDeleteCould you pls suggest a method to store items in a list permanently using shared preferences and Map?
Thanks in advance,
Anju
m_anju@rocketmail.com
Thank you for your effort! Your explanations are a very helpful starting point if one doesn't know a thing about androiding yet and aspires to get a basic understanding.
ReplyDeleteChandu..
ReplyDeleteHi Sai,
How to get geopoint of my location,pls help me regards.
Hi Sai Madam
ReplyDeleteAm fersher,jst now i got job in UK based company as a tester now am in Bluetooth and Wifi domain.
I was started writing Android application,this blog helpd me to learn lot of things on android.
Thank you vry much ,hopn U will solve my doubts on application .
Hi Sailatha,
ReplyDeletesuperb tutorials easy to understand.
thanks for a lot
Hello Madam
ReplyDeleteI am Sai.I have a small query here,I recently started android programming and I am finding it very interesting.I have decided to create an application on my own which is called ElectricityBilling Application.
I created 3 activities...
1.ElecBillActivity(Screenshot: http://tinyurl.com/3mhw3h4 )
2.AddBillActivity(Screenshot: http://tinyurl.com/3scl7xr )
3.ResultActivity(Screenshot: http://tinyurl.com/3hrglex )
As you can see in the above screenshots...I successfully enterd into the 2nd activity by using the intents..but as soon as I click the Submit button in the 2nd activity,I am getting an exception.I tried many ways,but i am unable to understand the problem.I am also providing the link for my code (http://www.4shared.com/file/w9sPrKc8/ElectricityBilling.html)
I am really interested to complete this as soon as possible,I request some very much appreciated assistence from you!
Thanks!
Hi..
ReplyDeleteThanks for helping us..Really ROX.bukmarkd. :)
Hi,
ReplyDeleteThanks for this good android tutorial.
Extreme Java
Nice blog. I will keep visiting this blog very often.
ReplyDeleteThanks , for much information,Keep sharing such a wonderful information..!
Great job lady.
ReplyDeleteNice blog
Hello and thank you for this superb blog, this awesome tutorial! I am very fortunate to have found it.
ReplyDeleteHI,
ReplyDeleteSai Geetha
Myself Praveen. This is superb tutorial for beginners.. If u give some more examples of different programs it will be helpful.
This is a request for help.
ReplyDeleteI am just starting to develop apps for the Android platform and I am struggling with a major hurdle at this time. For my current app, I need to have a video in it. My app contains strings and still images. Now, after the text and images, I want to have a video (e.g.,one of my videos in YOUTUBE) that will play when the running app gets past this chunk of text and images.
How can this task be accomplished successfully?
I emphasize "successfully" because I tried everything I could find via Google but nothing works so far.
Please reply with step-by-step instructions, if possible.
Thank you.
hi i am naresh.i am working as a android developer in small organisation.i am fresh Btech graduate.wili i get better oppertunities as a android developer after getting experience.will i get a job in MNC's.
ReplyDeleteHi, I am Tarun , from Bangladesh. I am working as a junior android developer a firm. I attached your given code, but code showing error in my pc.
ReplyDeleteHai sai how to use intent for multiple activity?can u explain?
ReplyDeleteThis is one of the useful post.Your blog is presenting very good and new Information.Your blog is presenting variety and good Information.I like this post.Good.Android app developers
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThank you very much for this great tutorial
ReplyDeletehi sai..
ReplyDeletethanks for ur information...
Hi Sai,
ReplyDeleteReally very good article, I am new to android, according to you how do you see job chances in android here in india.
plagiarism? http://alotaboutandroid.blogspot.com/2012/03/android-tutorial-for-beginners-part-3.html
ReplyDeleteYes,
ReplyDeleteThanks for bringing this to my notice. It looks like the alotaboutandroid is copying my posts exactly and putting it into his blog. A shame indeed.
When we want to share our knowledge freely, people want to misuse it!!
Hi Geetha, you are doing Very Great Job, Thanks , for much information,Keep sharing such a wonderful information..!
ReplyDeleteUnfortunately, they are not the only ones:
ReplyDeletee.g. http://androidmaterial.blogspot.com/2011/07/explicit-intent-for-android.html
And much more:
http://copyscape.com/?q=http%3A%2F%2Fsaigeethamn.blogspot.com%2F2009%2F08%2Fandroid-developer-tutorial-for.html
You should email them warning for infringing your copyrights. However, possibly you should put a copyright first :-) It is not so hard in fact, you can just put a link to Creative Commons or so (allowing to copy whatever they want, but giving you the credit for your original creation), and it would be clear they are doing something they shouldn't.
My 2 cents.
Hello madam this is chandra sekhar.
ReplyDeletecan you please help me by providing the example of intents without entering the details dont allowing it togo to next activity.
Please help me madam
This is very helpful! Thank you very much for sharing your knowledge.
ReplyDeleteHi Geeta, Your tutorials appear to be very helpful but I tried running them with Android 4.0. I am new to Android development and just learning. I took the Implicit Intent and rewrote it instead of directly running your tutorial to get hands on and I think I have everything pulled from your source but when I start my android in debug mode, I do not get the button or anything like that. I get an android screen which does not show any buttons. What could I be doing wrong.
ReplyDeleteThanks
I have very careful pulled all your code together and it all compiles.
Thanks
Dhiren
hi sai
ReplyDeletethis is Navan...my problem is when i am ready to execute the program always it displays error as R.layout.next is not resloved......plz send me the answer i am new to the android
How can mobile app developers help your business? There are 'n' of Android development company are there in that Rize is a most rated company.
ReplyDeletehi Sai
ReplyDeletethis is manasa...pls tell me in how many types to create tha database in android..everytime am using db.exex.SQL()..and in ur blog u just give syntaxes only..why should u go for the programs....
Hi Sai,
ReplyDeleteAll the very best wishes ,I will love to read an article on "RIL".
Can u post it on our blog .
Thanks &Regards
Nihar
hi
ReplyDeleteU are doing very good job.
hi,
ReplyDeletecould you please list the same examples for MAC OS X also ?
Sai,
ReplyDeleteyour post are very organized way and easy understandable. Doing a good job.
Thanks a lot for your time and sharing. Keep posting ...
For the beginners this is really nice post.because this provides basic concept of android development.both the part are good for viewers.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeletehai madam this vinoth kumar(Moorthy student) from chennai what is strict intent
ReplyDelete
ReplyDeleteGeetha,
Your blog is very useful for me, as your tutorial sessions are indeed of great benefit.