Android :: Camera Preview Layout UI Elements Overlay?

Dec 27, 2009

How do I write code which layouts UI elements (Buttons, etc) over camera preview on Android ?

Android :: Camera Preview Layout UI Elements Overlay?


Android :: How To Overlay Image Over Camera Preview?

Jan 30, 2009

Does someone know how I can overlay an image over the camera preview?

View 6 Replies View Related

Android :: Overlay Images Onto Camera Preview Surface View

Aug 23, 2010

I have a SurfaceView that is being used to draw custom animations and I would like to overlay them onto a live-feed from the phone's camera. Currently, the SurfaceView that contains the animations has a white- background, but if I were to overlay them onto the phone's camera feed, they would have to be transparent. The camera and animation drawing cannot be done on the same SurfaceView. Is it possible to make a SurfaceView transparent? What is the best course to pursue the use of multiple views? My end goal is to essentially overlay the contents of another SurfaceView onto the Camera SurfaceView.

View 2 Replies View Related

Android :: Surface View Draw Images Overlay On Camera Preview

Aug 23, 2010

I have a SurfaceView that is being used to draw images, and I would like to overlay them onto a live-feed from the phone's camera. Currently, the SurfaceView that contains the images have a white-background, but if I were to overlay them onto the phone's camera feed, they would have to be transparent. The camera and animation drawing cannot be done on the same SurfaceView. What is the best course to pursue the use of multiple views that involve managing the camera and drawing images? Is it possible to make a SurfaceView transparent?

View 4 Replies View Related

Android :: Can't Place Elements / To Do As I Want Using Xml Layout?

Oct 1, 2010

I was wandering if there was a easy way to do the following without android layout
place an image central top
place a button center center
place a button left bottom
place a button right bottom

it doesn't sound that difficult no ?

well I can't figure out a way to place the elements as I want using stupid xml layout.

View 1 Replies View Related

Android :: Example To Layout Elements Programmically?

Mar 9, 2009

From http://d.android.com/guide/topics/ui/declaring-layout.html, it said "Instantiate layout elements at runtime. Your application can create View and ViewGroup objects (and manipulate their properties) programmatically."

Can you please tell me how/where I can find example for that?

For example, how can I convert the following layout into Java code of my MyWidget. So that when I put "<MyWidget...>" in my layout xml file, it will automatically build a Gallery inside the MyWidget? code...

View 3 Replies View Related

Android : Way To Set SlidingDrawer On Top Of Other Elements In Layout?

Jul 8, 2010

Is there any way to set my sliding drawer on top of other elements in my layout? I have an ImageView which is intended for an album art and I would like to have a sliding drawer overlay at the bottom of that ImageView.

View 1 Replies View Related

Android :: No Elements Available In Eclipse When Editing Layout

May 22, 2009

I'm using the new SDK 1.5, and I'm trying to add some elements to a layout in eclipse.When I click the green plus symbol, the dialog pops up, but it doesn't populate with anything to choose from.

View 3 Replies View Related

Android :: Add An Overlay Of Layout In Listactivity?

May 9, 2010

I am tryin to make a layout appear when even I clich on a row of listactivity. The Overlay layout contains certain function which have to be performed based on the row selected in the list. Can anyone pls suggest me how to do it.

View 1 Replies View Related

Android :: Layout - Start An Activity Without Moving Certain UI Elements?

Aug 3, 2010

I'm trying to implement tab buttons bar and a navigation bar in my android application. The problem is, that I would like the navigation elements to persist. When starting a child activity, the nav bar moves.

How can I make these two elements "non-movable"?

View 1 Replies View Related

Android :: Add TextView/Layout To Map's Overlay / OverlayItem?

Apr 12, 2010

When a marker is clicked on google map, a small square area is displayed with hyperlinks. I guess OverlayItem does not render hyperlinks for its snippet. How to achieve this? Ideally I want to assign a layout with all sorts widgets. Presume I can display a small floating activity window when the marker is clicked, but is this the standard way doing this? The drawback of floating activity window is that if want to click another marker, user has to dismiss the current window first.

View 2 Replies View Related

Android :: Overlay ImageButton By TextView On Xml Layout?

May 12, 2010

I'm looking for how to overlay an ImageButton by a TextView in android xml layout. For the moment when I reduce the the TextView margin top, the TextView is going under the ImageButton. I want the contrary.

View 1 Replies View Related

Android :: Make Dynamic Layout Which Contains Mixed Elements - Checkboxes And Buttons?

Mar 2, 2010

I want to make a dynamic layout which contains mixed elements

[text] [checkbox] [button]
[text] [checkbox] [button]
[text] [checkbox] [button]

View 3 Replies View Related

Android :: AR Get Rotation Matrix / Camera Overlay?

Feb 23, 2010

I spend two weeks now trying to get this working with no success. Here is what I want to do: I have several geo points around the user and his phone. I want to display this point overlaying them on the input from the camera (kind of standard AR (Augmented Reality) app). Part of my requirements are that the user can use the phone in either landscape or portrait mode.My plan was like this.
1. Register for Sensor.TYPE_ACCELEROMETER, Sensor.TYPE_MAGNETIC_FIELD 2. Pass the result to Sensor Manager.getRotationMatrix(), getting back the R matrix that should be telling me how to translate points from the Phone coordinate system (defined here: http://developer.android.com/reference/android/hardware/SensorEvent.html) to World coordinate system (x -> East, y -> North, z -> Sky) 3. I want to translate points from World to Phone so I take the inverse of R (I'm using Matrix.invertM()) to get R_In 4. Using the GPS I translate the geo points I want to display on the camera to points in the World coordinate system and then I run them through the R_In matrix to get their coordinates in the Phone system. 5. Draw the points in the screen only if the have (phone coordinates) z < 0 and x and y such that they are visible. This is my grand plan... however I have problems quite early (2). I do get the R matrix back and it looks good when I align the phone to the world coordinate system ( I get the identity matrix ). However when I try to translate an imaginary point from the Phone coordinate system say (0, 1, 0) to the World coordinate system I don't get the numbers I expect.

View 2 Replies View Related

Android :: Overlay Transparent Bitmap On Camera

Aug 10, 2010

I'm passing a bitmap through a bundle to an activity which I called cameraView on which the user has access to the camera of the device. I'd like to overlay that bitmap with transparency using the camera as the background. Is it possible? to put the bitmap in front of the camera? And how can I change the transparency level? Here is my code: This is the camview.xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<SurfaceView android:id="@+id/surface_camera" android:layout_width="fill_parent"
android:layout_height="10dip" android:layout_weight="1"> </SurfaceView> </RelativeLayout>

And this is the java:
public class cameraView extends Activity implements SurfaceHolder.Callback{
SurfaceView mSurfaceView; SurfaceHolder mSurfaceHolder;
Camera mCamera; boolean mPreviewRunning=false; private Context mContext = this;
public void onCreate(Bundle icicle) { super.onCreate(icicle);
setContentView(R.layout.camview); Bundle f = getIntent().getExtras();
picture = f.getParcelable("bitmap"); mSurfaceView = (SurfaceView) findViewById(R.id.surface_camera); mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this); mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
} @Override // Create the Surface and Open the Camera
public void surfaceCreated(SurfaceHolder holder) { mCamera = Camera.open();
} @Override // Reacts for camera changes public void surfaceChanged(SurfaceHolder holder,
int format, int w,int h) { if (mPreviewRunning) { mCamera.stopPreview();
} Camera.Parameters p = mCamera.getParameters(); p.setPreviewSize(w, h);
mCamera.setParameters(p); try { mCamera.setPreviewDisplay(holder);
} catch (IOException e) { e.printStackTrace();
} mCamera.startPreview(); mPreviewRunning = true;
} @Override // When the camera is closed
public void surfaceDestroyed(SurfaceHolder holder) { mCamera.stopPreview();
mPreviewRunning = false; mCamera.release(); }
// When the picure is taken. This method gives the byte[] of the picture
Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {
public void onPictureTaken(byte[] imageData, Camera c) {
} };

View 3 Replies View Related

Android :: Layout Preview Doesn't Work Properly When Using <style>

Oct 29, 2009

When I include <style> elements from /res/values/styles.xml the Layout designer/preview within Eclipse doesn't update with these styles, but shows as it would be without any styles.Can anyone confirm this issue? If so, Is there a way I can fix this myself easily? If not, where's the appropriate place to sumbit a bug report?

View 4 Replies View Related

Android :: Camera Application With Compass Direction Overlay?

Jul 12, 2010

I'm a bit new to Android but after searching on the Market, the web and this forum, I can't seem to find anything like this but I feel like it has to exist (or hopefully will soon). I'm looking for a camera application that can place the current compass direction on the image (and stamp the saved image with the direction). The tilt of the phone would be cool to have, too, but just the compass would be great. I did find an application that shows the compass direction on over top of a feed from the camera ("Reality + Compass" by Udell Enterprises).

I want something just like this, but with the ability to save the image. In case you're wondering, I'd like to use this for bettering the storm spotting community. A problem when people send in images of clouds/storms/tornadoes/etc is that you never know (1) where the picture was taken and (2) in what direction. Ideally GPS location could be added, too, but for now I just want the compass. (Other image services can handle the location part fine, like Twitter for Android/Twitpic.)

(I'm on the HTC Aria, but I can sideload apps now thanks to the new version of HTC Sync.)

View 5 Replies View Related

Android :: How To Draw Overlay On Surface View Used By Camera?

May 29, 2010

I have a simple program that draws the preview of the Camera into a SurfaceView. What I'm trying to do is using the onPreviewFrame method, which is invoked each time a new frame is drawn into the SurfaceView, in order to execute the invalidate method which is supposed to invoke the onDraw method. In fact, the onDraw method is being invoked, but nothing there is being printed (I guess the camera preview is overwriting the text I'm trying to draw).

This is a simplify version of the SurfaceView subclass I have:

public class Superficie extends SurfaceView implements SurfaceHolder.Callback {
SurfaceHolder mHolder; public Camera camera; Superficie(Context context) { super(context);
mHolder = getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
} public void surfaceCreated(final SurfaceHolder holder) { camera = Camera.open();
try { camera.setPreviewDisplay(holder); camera.setPreviewCallback(new PreviewCallback() {
public void onPreviewFrame(byte[] data, Camera arg1) { invalidar();
} } ); } catch (IOException e) {} } public void invalidar(){ invalidate(); }
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
Camera.Parameters parameters = camera.getParameters(); parameters.setPreviewSize(w, h);
camera.setParameters(parameters); camera.startPreview(); }
@Override public void draw(Canvas canvas) { super.draw(canvas);
// nothing gets drawn :( Paint p = new Paint(Color.RED);
canvas.drawText("PREVIEW", canvas.getWidth() / 2, canvas.getHeight() / 2, p);
} }

View 1 Replies View Related

Android :: How Can I Change Default Size (width + Height) Of XML Layout Preview?

Oct 5, 2010

Every time that I want to do a Layout, I'm getting a black layout preview then I can drop stuff on it, that's ok, but how can I change the size of that blank surface (xml). The question came because I set a folder layout-large and then when I add a new layout.xml to that folder it came with the same size, as a layout-normal.

View 1 Replies View Related

Android :: Camera Preview Not Working On G2

Oct 20, 2010

I'm trying to get the camera preview running on my G2.

This is the code I'm testing with, which was taken from the sample code. It is using supplemental code supplied by Wu-Cheng, but its still throwing an error.

CODE:......................

View 14 Replies View Related

Android :: 2.1 Camera Preview Error

Aug 28, 2010

I have a problem with using the camera of an Android 2.1 phone (HTC Desire), maybe you can help me.
After calling camera.open() DDMS in Eclipse shows the following errors:

CODE:............

Test view in the emulator works fine, but on my phone only a popup is shown where I only can close the application.

View 2 Replies View Related

Android :: Cannot Get Camera Preview Example To Work

Oct 28, 2009

I upgraded to the 2.0 SDK yesterday. Don't know if that has anything to do with it. I can't get the Camera Preview example from the API Demos to work. I get the same error in both my emulator and on my G1:
E/AndroidRuntime( 4758): java.lang.RuntimeException: Fail to connect to camera service.

View 4 Replies View Related

Android :: Possible To Camera Capture Without A Preview?

Jun 30, 2010

Is it possible to capture an image without showing the camera preview?, i have a requirement that i should be able to capture the image from a thread or from a service, without disturbing the foreground application, where i do not want to show the camera preview, but still i want to capture the image in background and store it in the device. So is it possible to do using the Android 2.2 SDK version?

View 3 Replies View Related

Android :: How To Get A Camera Preview In Phone

Jun 25, 2009

Anybody know about the camera Api in android.when i used this Api it displayed a black and white grids and a squre moving above it.Anyone know how to get a real time camera preview please help me with some code.

View 2 Replies View Related

Android :: Camera Capture Without Preview In 2.2

Aug 30, 2010

I have a requirement to Capture the image without showing the Preview.. And i want to do it in the Background as a Service. Is it possible to do that?

View 2 Replies View Related

Android :: How To Put Graphics On Top Of My Camera Preview

Sep 10, 2010

I see a couple of threads on this topic, but none of them seem to answer the question, so, I'm giving it another go...

Very simple idea... I want to some portion of the screen to preview (and shoot) the camera and the other portions of the screen to add my own graphical elements (buttons, colorful frame around the camera preview, etc).

The example that comes with Android fills the screen. The obvious solution (that doesn't seem to be working) is to use my own SurfaceView (rather than the one they do in the example) and have it sitting in my XML. The code (beneath) doesn't crash and reports that it's firing up the camera... it just never renders on the screen.

I have no idea what I'm doing incorrectly. My guess is that it has something to do with the display thread never having the urge to redraw anything after it renders the initial screen, but I even tried adding a button and initiating the camera to render on the surface view upon button click, but that has not provoked it any further.
(most of this code is pulled directly out of the Android sample code, so, I'm sure it's correct. I'm just doing something wrong in how I pull my View in after the fact, I think).

CODE:........................

View 1 Replies View Related

Android :: Camera Preview Is Working Properly

Feb 24, 2010

In my Application the camera preview is working properly in both in portrait and in landscape mode. No crashes are occurring, but the users are complaining that the crashes are occurring when they are using the same.

View 1 Replies View Related

Android :: UI Window In Camera Preview Application

Nov 27, 2009

Let's say in my example I am working with SurfaceView for my CameraSurfaceView. I have a few questions, hope you can help me.

1. When this SurfaceView gets created (I assume via final CameraSurfaceView cameraView = new CameraSurfaceView (getApplicationContext()), this will result in a call createSurface() in SurfaceFlinger with format, width and height. Am I correct?
Is this SurfaceView also my UI window if I want to draw anything? I thought if I call setType(PUSH_BUFFER) on this surface, I won't be able to do any drawing on this surface.

2. How does the application pass these information like format, width and height to SurfaceFlinger for the allocation? Is it by using .setFormat, .setFixedSize?

3. How do they methods .setFormat, .setFixedSize related to the surfaceHolder.surfaceChanged() callback?

View 2 Replies View Related

Android :: Camera Application Preview Crashes

Nov 24, 2010

So I started with this little write-up. I wanted to try to make an application that will take pictures while running in the background. To start though I wanted an application that once opened would simply take a picture every X seconds. After recreating the classes and methods show in the walk through below I ran into a few problems.
http://itp.nyu.edu/~sve204/mobilemedia_spring10/androidCamera101.pdf

For starters its seems that the onCreate function sets up all the objects for the application, but if you try to take a picture through any other method than onClick (IE directly calling it) the application actually hasn't setup the canvas or the preview yet.

My first question:
Is there any conditional method that you can setup that will wait till all the "onCreate" objects are created and their associated methods are called and finished? How do I wait for the application to finish putting together my surface and starting the cameras preview before automatically starting to take pictures?

My second question:
I am required to have a preview available to take pictures. Is there anyway to push this application to the back (IE running in the background) while still taking pictures? Is drawing to a canvas a requirement? (From what I can tell AFAIK, you are required to have a surfaceholder to start preview, when you put up another screen or application that pauses the current application and closes the surface/canvas you were presenting that preview on). If my understanding is correct on all of this the best I will be able to do is make a 1x1 pixel canvas that will still take up the screen due to the application being in the foreground.

My Third question:
Is there any way around this? Can you still utilize the camera in some fashion without requiring the preview be drawn?

View 1 Replies View Related

Android :: Camera Preview Zoom Not Working

Sep 7, 2010

I've a problem with Camera Preview Zoom. The methods present in Android 2.2, setZoom() is not working to zoom the preview. Is there any another way to do the Zoom in android? I am using the code present in the Android API Demos. Is their any body who has worked on implementing ZoomIn & ZoomOut and got succeed??

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved