Microsoft Teams - How to launch MS Teams from Android Intent - android

I'm looking to launch an intent to open the Microsoft Teams main activity from my app. I would assume it would be something like com.microsoft.teams.MainActivity but this does not seem to launch. Trying to open via URI of msteams://teams.microsoft.com takes me to the browser instead of the app.
Is this functionality possible?
Edit: Using adb gave me the following, however this also does not seem to work.
C:\Users\Redacted>adb shell dumpsys window | find "mCurrentFocus"
mCurrentFocus=Window{91c21a9 u0 com.microsoft.teams/com.microsoft.skype.teams.views.activities.MainActivity}

As Posted by #Nicolas - Use com.microsoft.skype.teams.views.activities.MainActivity.

I was able to launch the MS Teams application using command:
adb shell am start com.microsoft.teams/com.microsoft.skype.teams.Launcher
So I think that you can use activity com.microsoft.skype.teams.Launcher.

Related

android osmand api with am commands

on my android phone I want to control osmand using the osmand api. To send the intents I want to use the am command available in adb shell or termux.
I am able to start osmand with am start net.osmand.plus/net.osmand.plus.activities.MapActivity
In my first test I just want to stop the navigation (command: STOP_NAVIGATION).
First I tried am start -a stop_navigation -n net.osmand.plus/net.osmand.plus.activities.MapActivity. The result was Starting: Intent { act=stop_navigation cmp=net.osmand.plus/.activities.MapActivity } Warning: Activity not started, its current task has been brought to the front, which makes sense.
Then I tested some broadcast commands, e.g.:
am broadcast -a stop_navigation -n net.osmand.plus/net.osmand.plus.activities.MapActivity
am broadcast osmand.api://stop_navigation
I also tested it with capital letters. But no command was successful.
Is there someone which has more experiences with android intents and / or osmand api and can help me how to create a working command?
Thanks in advance!
I already found the solution, it was simpler than expected. Maybe I can help someone with the solution:
The command am start osmand.api://pause_navigation is enough.
BTW:
termux-open osmand.api://pause_navigation does also work.

Google Assistant App Actions codelab example not working (Fit Actions) on AndroidTV

I'm trying out this example:
https://codelabs.developers.google.com/codelabs/appactions/#0
I've built the app & installed it on my AndroidTV device, and able to launch it via:
am start -a android.intent.action.VIEW -d "https://fit-actions.firebaseapp.com/start"
but, when I try to run the App Actions Test Tool and try out the suggested actions.intent.START_EXERCISE intent (which is supposedly integrated with the Google Assistant), I just see an error that says, "You don't have an app that can do this". The entire command looks like this:
am start -a android.intent.action.VIEW -d "https://assistant.google.com/services/invoke/uid/00001f0ad064c9a0?intent=actions.intent.START_EXERCISE\&param.exercise=%7B%0A++++%22%40type%22%3A+%22Exercise%22%2C%0A++++%22name%22%3A+%22Running%22%2C%0A++++%22%40context%22%3A+%22http%3A%2F%2Fschema.googleapis.com%22%0A%7D"
Also, I tried directly speaking the request, "Hey Google, start running in Fit Actions", but I get the same error. Any ideas what could be missing?
I just realized that AppActions is not supported on AndroidTV, I tried this example on a Samsung tablet and the test tool launches it just fine. That said, it's still not working when tried with a voice command

I can't get the activity name using adb shell

I know that many people already sent questions similar to this. However, this is a little different.
I have to try to get the current activity from an android app, but it is not possible. Normally, I interact with the app and execute this: adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'. However, it always shows MainActivity. I checked the activity list on APK Info and this list is so little
So, there is some way to start a specific screen of apps similar to this?

How to launch an Android SubSettings Fragment?

For example, how do I launch User Settings? It's not implemented as its own Activity, so I'm not sure how to start it.
Below are some other similar questions but these are either more general or more specific. My question is about starting an arbitrary SubSettings fragment.
How do I call a specific PreferenceFragment from a PreferenceActivity?
Show only wireless system settings on Android 3
You can launch most Android Settings sub-screens by starting the SubSettings Activity and including the :android:show_fragment extra with the appropriate fully-qualified class name of an existing Android PreferenceFragment subclass.
For example, to start UserSettings:
adb shell am start -n com.android.settings/com.android.settings.SubSettings -e :android:show_fragment com.android.settings.users.UserSettings
To start DeviceInfoSettings:
adb shell am start -n com.android.settings/com.android.settings.SubSettings -e :android:show_fragment com.android.settings.DeviceInfoSettings
These examples use 'adb shell am start', but in principle you could invoke these in Java code (EDIT: Unfortunately you need to be signed with the system key, otherwise you get a SecurityException). Notice that the key for this extra has a colon at the front of it. To find other Settings, checkout the Android source and look for subclasses of PreferenceFragment in the packages/apps/Settings.
The situation was different in Froyo and before. In those days Activities were used to implement Settings sub-screens, so one could launch directly into a sub-screen (for example SoundAndDisplaySettings) by the usual method of calling startActivity() with a ComponentName or action String. This mechanism still works for some Settings sub-screens. For example, to bring up a wifi picker, you can use
adb shell am start -a android.net.wifi.PICK_WIFI_NETWORK
for MM :
am start -n com.android.settings/com.android.settings.SubSettings -e :settings:show_fragment com.android.settings.applications.RunningServices

How to get extras of currently running activity through ADB

I have a question about using ADB.
I know that this command:
adb shell dumpsys activity
can show me all the activities that are currently running on the device.
But I notice that sometimes, the intents appear like this:
Intent { ...some_intent/activity_name.... (has extras) }
I know that extras mean that the activity has been started with some sort of parameters passed to it (I may be wrong here, please correct me if I am).
So my question is, how can I get the extras of the intent/activity through ADB ?
The reason I need this is because I'm trying to launch an apk (that is installed on the phone) through ADB command, something like:
adb shell "su -c 'am start -n com.package.name/.ActivityName'"
That works and bring up the application. The application has a start screen (say we call it HomeActivity) and you have to click a button and make some selections (say SelectionActivity) and it will go to another screen (say ActionActivity). I want to be able to launch the apk and make it go straight to ActionActivity.
The application will crash if I try to launch the ActionActivity with am start command, I'm assuming this is because it requires parameters from the SelectionActivity screen.
This is why I'm trying to see what are the "extras" or parameters that the ActionActivity screen actually gets, so that I can do something like:
adb shell "su -c 'am start -n com.package.name/.ActionActivity -e param1 val1 -e param2 val2'"
Hope my question is clear.
Please correct me if I'm making a mistake somewhere.
Thanks in advance!
If I am understanding correctly, your target is to start the 'action' activity with correct intent but you don't know what kind of parameter information should be included, right?
The dumpsys command won't dump everything you want, so to simply achieve your target, you have 2 options (you should find one device which you can burn your own firmware into it):
Modify the dump method in AMS to print out more information
Modify the ActivityThread class source code to print out the detailed intent information

Categories

Resources