• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

How can i implemented UI of my program?

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I want to write a program that, the program should detect balance a surface(like balance a table). I mean, sensor's device shows x=0,y=0 and z=9.81 in axis. But the question is, How can i implemented UI of this program? Have you any ideas?
I think that i draw a circle on screen and draw coordinate system (XY system) in center of circle and if my device stands not balance, x and y of coordinate system move to another position, i mean of another position is x and y coordinate system move with x and y of accelerometer sensor's data, but i don't know how can i implemented Z axis? If i hold a phone up status (x=0,y=9.81,z=0 of sensor) how can i show z axis? How can i show to user that the phone is in up status?

I don't know that i could give my purpose to you or not could!!
Thanks for help and sorry for my poor english.

Cheers
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm interesting. Since I'm not into android dev yet and don't know if it's possible to implement, I probably try to do the following:

Forget about whether the phone is up or tilted or flat. Given you have 3 axis, as long as 2 of these are the same, the third one will be your so-called z axis.

Eg phone is flat: x=0, y=0, z=9
phone is vertical standing up: z=0, y=0, x=9
phone is horizontal standing up: z=0, x=0, y=9
phone is tilted say 45 degree vertical standing up: x=5, y=5, z=9
phone is tilted say 45 degree horizontal standing up: x=5, y=5, z=9

For the exact position on the 3 axis check out SensorManager.getOrientation().
 
fahimeh hashemian
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

K. Tsang wrote:Hmm interesting. Since I'm not into android dev yet and don't know if it's possible to implement, I probably try to do the following:

Forget about whether the phone is up or tilted or flat. Given you have 3 axis, as long as 2 of these are the same, the third one will be your so-called z axis.

Eg phone is flat: x=0, y=0, z=9
phone is vertical standing up: z=0, y=0, x=9
phone is horizontal standing up: z=0, x=0, y=9
phone is tilted say 45 degree vertical standing up: x=5, y=5, z=9
phone is tilted say 45 degree horizontal standing up: x=5, y=5, z=9

For the exact position on the 3 axis check out SensorManager.getOrientation().



For the exact position on the 3 axis check out SensorManager.getOrientation().

Thanks for reply but i can't understand what you say:( How can i implemented 3 axis? I can implemented 2 axises (x and y that are perpendicular) but i can't implemented z axis. I think if i want to implement 3 axises, i should use 3D show and i don't know this:(

Can you draw your idea (in 45 degree status) in Paint or Photoshope?

Thanks. Cheers
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I mentioned before, I don't know if my suggestion can be done.

What my intention was if the phone is tilted, is it possible to make the phone's tilted position as the perpendicular base (the entire x-y coordinate tilted). That way the perpendicular axis will be your third axis.

Using the x-y-z concept. If the entire coordinate plane is tilted 2 of these axis should be the same .... then movement perpendicular will be 3rd.

You should confirm whether 2 of 3 axis are the same when phone is tilted using that getOrientation() method.
 
It was the best of times. It was the worst of times. It was a tiny ad.
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic