带有AM命令的Android Osmand API

发布于 2025-01-18 00:43:25 字数 1022 浏览 4 评论 0原文

在我的Android手机上,我想使用 osmand> osmand API 。要发送意图,我想使用ADB Shell或Termux中可用的am命令。

我能够使用am启动osmand start net.osmand.plus/net.osmand.plus.activities.mapactivities.mapactivity

在我的第一个测试中,我只想停止导航(命令:stop_navigation < /代码>)。

首先,我尝试了am启动-a stop_navigation -n net.osmand.plus/net.osmand.plus.activities.mapactivity。结果是开始:intent {act = stop_navigation cmp = net.osmand.plus/.activities.mapactivity}警告:未启动活动,其当前任务已将其带到了Front,这很有意义。

然后我测试了一些广播命令,例如:

  • am广播-a stop_navigation -n net.osmand.plus/net.osmand.plus.plus.activities.mapactivities.mapactivity
  • am backcast osmand.api:// stop_navigation:// stop_navigation

我还用大写字母对其进行了测试。但是没有成功。

是否有人在Android意图和 /或Osmand API方面拥有更多的经验,并且可以帮助我如何创建工作命令?

提前致谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城仅有旧梦在 2025-01-25 00:43:25

我已经找到了解决方案,比预期的要简单。也许我可以帮助某人使用该解决方案:

命令am start osmand.api:// pape_navigation就足够了。

顺便提一句:
termux-open osmand.api:// pape_navigation也有效。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文