Question

Considering I have a Computer screen (with a fullscreen window showing Water) and a Smartphone. On the Smartphone are some Fishes in a virtual Water. Now, if I tilt the phone, the water should flow out and the Fishes should "fall" down into the screen.

This is not impossible to implement, the Problem is getting the Position of the Smartphone, so the Fishes will "fall" to the correct Position.

The written as a picture

(Sorry for my awful drawing Skills)

How can I exactly determine the Position of the Smartphone?

Was it helpful?

Solution

Interesting question.

You can use some NFC tags here, NFC tags are pretty cheap and work beautifully with Android.

Program three (or more) tags and stick them on top of your monitor, one in the center and 2 in the two corners You can easily program the tags (e.g. NFCTaskLauncher app on Android Play store) to trigger your app when the phone is close to a tag. You can program the tag to identify which tag was close to your phone, your phone app can then interact with the app running on your desktop. The rest is your implementation detail.

If you do not want to use NFC (or also want to use iOS) then there are some other tricks you can employ, like start a "mode" in your phone app where the fish is "ready" to be transferred, then as your phone accelerates it signals a move (using acceleratometer APIs) then like a magician suddenly stop your hand when it touches the top of the screen, trigger the "transfer" of the fish to the desktop app (screen). The exact location may be tough but you can be creative and always go in a funnel like fashion to the desktop screen and use your accelerometer to find which side you are trying to enter the desktop screen.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top