Welcome to the DS community, I hope you get a lot of fun and learning with this great tool.
The first thing is, do you have prior knowledge with Intents in Java Android??
If no, please look in the official android documentation for more precise info.
In DS you send a intent like this.
app.SendIntent(Package, ActivityClass, Action, Category, URI_OR_DATA, Type, Extras, Options Result);
All params are Strings, except Extras that is a JSON object and Result, that is a callback with the signature function(resultCode,result)
If you want to open whatapp app (i.e)
you do this.
app.SendIntent("com.whatsapp","com.whatsapp.Main","android.intent.action.VIEW");
If you want a quick introduction, read ahead.
Activities are the base of the android application system. You can use activities for almost everything.
Applications in android are delivered as packages (apk => Android Application Package). and packages may contain a lot of bits of code, including classes. The Activities are the foundation for the UI part of the apps.
In order to the system to be able to detect, manage and display your activities, you need to define them in the manifest of your app.
But at this moment android os in your device already have a lot of applications installed , including default activities for certain task or Intent,
there are implicit and explicit intents. implicit only need to define action/category where explicit need the package/activity as well.
Intents are specified like this.
- PackageName The name of the app package, If you want to a specific app handle the intent this need to be defined.
- ActtivityClassName. The name of the activity class, if you want to a specific activity handle is called, define it, use it with packagename
- Action. The action defined in the intent filter for the activity. A common one is android.intent.action.VIEW, used to open a activity, but others can be used like android.intent.action.SEND for sms or whatapp or others for things like sharing, taking images, picking contacts.
- Category. Like action, this allow to group a lot of common purpose actions in different groups. like android.intent.category.DEFAULT or LAUNCHER
- Data or URI. The first and main piece of data to send to the intent, this may include the base scheme (defined in the manifest too). an example like "tel:5559990000" or "sms:5559990000" or "http://www.google.com", please not that http its a protocole, but in the word of your device, where different stuff is marked as a resource and have an URI. http, or file, or ftp or mailto represent the way the data should be treated. schemme vs protocol is a long debate in the w3, but at least in your device tiny universe, http is a resource. End of rant.
- Type. the mime type of the data, things like text/plain or more complicated like vnd.android.cursor.item/vnd.google.memory.note. etc.
- Extras. a bundle of additional information send within the intent,