使用 Java 从 iPhone 等设备获取位置坐标(不是基于 IP,更像是 GPS 或手机信号)

发布于 2024-11-02 17:25:16 字数 106 浏览 5 评论 0原文

除了 IP 地址之外,如何从移动设备(智能手机、iPhone、BlackBerry ...)获取更准确的位置坐标。例如,通过使用来自智能手机 API 的 GPS 查询。那么如何与 Java 集成呢?

How can one get more accurate location coordinates from mobile device (smarthphone, iPhone, BlackBerry ...) other than from IP address. For example by using GPS query from smartphone API. And how would one go about integrating with Java?

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

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

发布评论

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

评论(1

白鸥掠海 2024-11-09 17:25:16

这取决于你要问什么。

如果您的意思是“如何在智能手机的本机应用程序中使用 Java 检索 GPS 坐标?”,那么每个智能手机平台的答案都会有所不同,并且 iPhone 没有答案,因为 iPhone 不运行 Java。

如果您的意思是“如何在后端使用 Java 在 Web 应用程序中检索 GPS 坐标?”,那么您可以使用 HTML5 中的 Geolocation API,假设浏览器支持它(据我所知,Mobile Safari 和Android 支持这一点,我不知道黑莓,并且假设它不支持)。请参阅此处

This depends on what you're asking.

If you mean "How can one retrieve GPS coordinates using Java in a native application on a smartphone?", then that answer will differ for every smartphone platform, and there is no answer for iPhones because iPhones do not run Java.

If you mean "How can one retrieve GPS coordinates in a web application using Java on the backend?", then you can use the Geolocation API in HTML5, assuming the browser supports it (as far as I know, Mobile Safari and the browser in Android support this. I don't know about Blackberry, and would assume that it does not). See here.

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