-2

I want to implement 3D touches in android,just like the 3d touches in the Iphone 6S and 6S plus.

I looked around in google and couldn't find any consistent material. I could only find an example in Lua language and i am not sure yet if it's exactly what i am looking for.

So i thought may be if there is no libraries out there, then i should implement the algorithm from scratch, or maybe create a library for it.

But i don't know where to start ? do you guys have any clue ?

Anina
  • 453
  • 3
  • 18
  • Do you mean 3d touches like in the new iPhone announced yesterday? Or just detect where the user touched on your virtual mesh? –  Sep 10 '15 at 09:13
  • Exactly that reffered to the first sentence or the 2nd? ;) –  Sep 10 '15 at 09:39
  • I edited the question. I am talking about what Apple announced yesterday – Anina Sep 10 '15 at 09:59

3 Answers3

0

I believe you could implement something similar using MotionEvent, it has a getPressure() method that is supposed to return a value between 0 and 1 representing the amount of pressure on a screen. You could then do something different depending on the amount of pressure detected. Note that some devices do not support this feature, and some (notably the Samsung Galaxy S3) will return inconsistent values.

2Dee
  • 8,609
  • 7
  • 42
  • 53
0

I don't think it is possible on currently available Android devices. 3D touch is hardware technology embedded in displays in iPhones. I don't think you can implement this just writing some code in your Android application.

Pawel Urban
  • 1,316
  • 1
  • 12
  • 28
0

Short answer - no. You need to wait for Google to actually copy the technology if it proves to be useful. But I doubt it'll happen in near future. This is because Android is all about accessibility and these screens will be quite expensive.

Long answer - Android is open source. If you are making something internal then go on, it'll allow you to do that with some modifications. Build a device, put in your modified code, create your own application that takes advantage of the feature and be happy to announce it to the world.