Confused by "Intents"

mjtaryan

Active Member
Licensed User
Longtime User
I'm having a really difficult time (maybe, as Hal says, "My mind is going.") getting a handle on the concept, use, form and everything else related to Intents. I've yet to find anywhere (here or on another site) a really good, clear and comprehensive article/tutorial on the subject that starts from the very beginning with examples of when, where and how to use them.

I've never had to use this kind of thing before in any development I've done. My experience has been entirely where the object itself and/or its context provides an implicit "intent" and is never employed in code or the construction of the software and its modules.

HELP!! (And thanks).
 

thedesolatesoul

Expert
Licensed User
Longtime User
An intent is an action to be performed.
It is how different programs can interact with each other.
You may start a new program with an intent or you could just some information through the intent.
Sometimes, you do not have to specify what program will receive the intent and the OS chooses the best way to deal with it.

This is where you would find the most accurate and updated information on intents: Intent | Android Developers

What else do you not understand?
 
Upvote 0

mjtaryan

Active Member
Licensed User
Longtime User
As I said in my original post, "everything." I've never had to deal with type of thing before. Other software I've develped that interacted with external programs or the OS used a mechanism for specifying the program and passing the data (or a reference to it).

I'm looking for a compreensive article or tutorial that starts from the very beginning and works its way into the more complex stuff using concrete examples with code along the way. Some questions I have are:

1. Is it necessary to use intents?
2. Do intents have to be used within or internal to the running app? When and why (including activities other than "Main"?
3. If a given activity does more than one thing (gets data, displays data, requires user input, etc.) how do you determine the intent(s) to be used for a given action?
4. Where will I find a COMPLETE and FULL list of intents, even if broken down into types or categories?

There are many more questions and others that will arise due to the information I get about intents.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
1. Is it necessary to use intents?
No
2. Do intents have to be used within or internal to the running app? When and why (including activities other than "Main"?
You do not need intents to communicate between activities in the app.
3. If a given activity does more than one thing (gets data, displays data, requires user input, etc.) how do you determine the intent(s) to be used for a given action?
You do not need to use intents for these simple actions.
4. Where will I find a COMPLETE and FULL list of intents, even if broken down into types or categories?
The link I posted contains the standard intents supported by android.
There is no FULL list since any app can have an intent/listener and the developer may or may not choose to expose it.

With an intent you can: start an application, place an audio file, dial a number etc BUT you do not HAVE to use intents for these
B4A contains a lot of functions and libraries so you may not even need to use intents.

If you tell us what you want to do then I can tell you if you need to use intents. So far I have never needed to.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
3. If a given activity does more than one thing (gets data, displays data, requires user input, etc.) how do you determine the intent(s) to be used for a given action?
I'm afraid that you are focused on intents for any reason, but for all of above tasks you don't need any intent.
You should have a look at the Beginner's Guide where you have all information to begin, with explained code examples (source code included).
And you should also have a look at the Documentation Wiki.

It would be much more efficient if you explained us what you want to do so we could give you concrete advices.

Best regards.
 
Upvote 0

aloraptor

Member
Licensed User
Longtime User
I believe he is having trouble with the whole concept of intents not a particular task he is trying to do. I understand where he is coming from because the concept is giving giving me trouble too. i've been reading about them everyday from every source i can find, hoping soon or later it will stick in my brain and the little light will come on.
 
Upvote 0

mjtaryan

Active Member
Licensed User
Longtime User

Thanks aloraptor! You seem to be the only one so far who has gotten where I'm coming from. Would you agree that it would help to have a definitive tutorial (or series) such as I described earlier?
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime User
Hm, to me it seems a bit like you should an intent at the system and hopes it does something about it.


ie, "I'm hungry - bring me something to eat"

And if you are lucky, someone will hear that and bring you a plate
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…