Question about Button and SurfaceView

by Karthik Ravi Shankar » Fri, 23 Apr 2010 16:23:56 GMT


Sponsored Links
 Hi,

I am trying to use SurfaceView for an app. But I need to add buttons the
canvas as well. Not able to gather much from Android.developer site. Can
anybody post if they have done it or have some ideas ?

Thanks,
Karthik R
Graduate Student
Computer Science Department
UCLA

--



Question about Button and SurfaceView

by Mark Murphy » Fri, 23 Apr 2010 19:33:21 GMT


 


Step #1: Define a RelativeLayout.

Step #2: Put the SurfaceView as a child of the RelativeLayout.

Step #3: Put the Button as a *later* child of the RelativeLayout.

This will cause the Button to appear to "float" on the SurfaceView. See
this project for an example:

 http://github.com/commonsguy/vidtry 

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android App Developer Books:  http://commonsware.com/books 

--


Sponsored Links


Other Threads

1. Building multiple app versions for the Market

We're thinking about building light and paid versions of our app for
the Market. But I am not clear what we need to do, or how to do it.

(1) Do we definitely need the two versions to have different package
names for the two builds ?

It seems logical to do it that way, but I have not found a clear
answer from Google to that question. Though I have found several
people asking the same question.

(2) Is there any support in Eclipse for building two similar apps with
different package names from the same java and xml files ?

In most of the IDEs I've used, it is a doddle to define multiple build
targets for one project, but none of those mechanisms seem to be
present here. And, the package name is embedded in every java file, as
well as in many places in the manifest, leaving me without a tidy way
to build to alternate package names.

Is there a tidy way to build multiple version ? Or are we really going
to end up copying the whole codebase and search-and-replacing the
package name ?

Thanks,

Richard


--~--~---------~--~----~------------~-------~--~----~

2. WiFi on Android Dev Phone 1

Hi,

Just got the "unlocked and jailbroken" ADP1 but apparently it requires
a valid SIM card, which I have, and GPRS data services to connect to
Google to unlock.  I don't intend to subscribe to GPRS so I want to
configure it to connect to WiFi to try to unlock it so I can turn on
the debug switch to load applications on it.  Anybody find a
workaround.

Brett

--~--~---------~--~----~------------~-------~--~----~

3. Notepad provider context - Notepad application?

4. What's holding up UK paid app's

5. How to access the form data in all my Activity

6. How to check which button is clicked

7. ListView issue- getchildat()