Building a gauge setup

Problems with Canvas, OpenGL, etc...

Building a gauge setup

Postby AedonEtLIRA » Thu Jul 29, 2010 12:00 am

I was recently assigned to do an Android project for work that involves building mutable gauges. So, I thought it would be easy enough to just make an arc (90d to 360d) and have the values of the gauge fill in the arc. I can't get the arc to display on the screen. When opened it just displays the hello world string. Anyone get a few lines I can look at to see what I'm doing wrong? Also, if you now of a good shapes tutorial, I would greatly appreciate the forward.
~Thanks
Walk with purpose, and build something.
User avatar
AedonEtLIRA
Senior Developer
Senior Developer
 
Posts: 146
Joined: Wed Jul 28, 2010 11:52 pm

Top

Re: Building a gauge setup

Postby jonbonazza » Thu Jul 29, 2010 2:05 am

You need to make a layout file (xml file) containing the "look" of app (or more then one file for each activity if you have more then one). Then you have to use setContentView(R.layout.whateverYourFileIsCalled); to set it to the screen.

I highly recommend looking through a few online tutorials and/or picking up a book (or two) on android app development. Although it utilizes the java programming language, there are many differences from making a java app or applet for the computer.
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Re: Building a gauge setup

Postby AedonEtLIRA » Thu Jul 29, 2010 2:35 pm

I had a layout for the the arc, however I did put it in the main.xml sheet. Is it absolutely required that i place it in its own file or can I place it in main? And do I need to reference the arc by class name or just a generic arc tag? The tutorials I have and books I'm reading through aren't entirely clear on this.
Walk with purpose, and build something.
User avatar
AedonEtLIRA
Senior Developer
Senior Developer
 
Posts: 146
Joined: Wed Jul 28, 2010 11:52 pm

Re: Building a gauge setup

Postby jonbonazza » Thu Jul 29, 2010 2:38 pm

You need to place it in main and overwrite what is already there.
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 5 guests