我想创建某种图形箭头,或者可能在罗盘上绘制箭头来向用户展示风中的方向。考虑到人员手机的方向,这显然会改变。

我的申请可以告诉我风向来自哪个方向(以学位)来自。 我的问题是,实现这样的东西的最佳方式是什么?

感谢

有帮助吗?

解决方案

In your Exclipse create a new Android project and select "Create project from existing sample". Choose target android version and then ApiDemos. There you will find a Compass application and many other examples which can help you draw your screen.

I guess the best would be if your wind arrow would be in 3D or simulated 3D, so that it does not matter how the user is holding his device, for he would always look at the wind arrow from an elevated virtual vintage point.

In the same ApiDemos there is also "Sensors" demo which draws the physical orientation of the device.

其他提示

  • Draw a compass, draw the wind arrow accordingly.
  • If the device knows its orientation, rotate the whole thing so that N on the compass points to actual North.

Then ask users whether they are happy with this setup, if not, why, improve, etc. But start with something dead simple, like the above.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top