Android : Draw Line On Map View Given Coordinates?

Dec 20, 2009

How to draw line on MapView given coordinates?

AFAIK, on iPhone it is possible.

Android : Draw line on Map View given coordinates?


Android :: Draw A New Line / Get A Carriage Return Drawn In Custom View

Jan 1, 2010

This is really frustrating, I am trying to get a carriage return drawn in my custom view and nothing is working. I have tried 'System.getProperty("line.separator")' but that makes it say null and I have tried '
' and '
' and those just both draw a little square. I am using the canvas.drawText meathod.

View 2 Replies View Related

Android :: Mismatch Of Event Coordinates And View Coordinates

Jun 30, 2010

I've been trying to write a little application that recognizes custom events in Android: you hold your finger over a TextView for a certain length of time, and it changes color.I'm using the MotionEvent coordinates and checking if they are within the bounds of a particular TextView, which is within a table.I am just attaching the onTouch listener to the table within the activity.But I get weird errors: the coordinates seem to be off by one view (i.e. if I touch the view below the view above reacts); or sometimes one will react, and the other will not. Any idea what might be going on?

View 2 Replies View Related

Android :: How To Draw Line

Sep 1, 2010

how to draw a line in android give example

View 1 Replies View Related

Android :: How To Draw Dotted-line

Nov 1, 2010

How to draw dotted-line? I know someone already asked this question, but i cann't find the annals. how to draw it or record the message sen

View 2 Replies View Related

Android :: Draw Line On Map And Not Disappear On Selecting Tab

Jun 8, 2010

I'm having some difficulty with drawing a line on a map. I'm basically drawing it etc. but when I select other tab and then come back to the "map tab" the line disappears. How can I prevent that so the line stays there all the time? Please can someone help me to solve this?

View 1 Replies View Related

Android :: Using Touch Screen To Draw A Straight Line

Apr 13, 2009

Want to draw a line when I touch screen at two points. I can see OnTouch been invoked but after than everything breaks looks, the application crashes

I am using drawLine in Canvas.

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

View 5 Replies View Related

Android :: To Draw A Vertical Line / When A Button Is Pressed?

Sep 28, 2010

I want to draw a straight vertical line on my Android activity, when a button is pressed. Please explain how I can draw the line with a position & length I want.I have a linear layout with vertical orientation. A set of buttons constitute this linear layout. When I press one button, I want a line to appear to the right of these buttons, like dividing the screen halfway - a straight line of width=2dip and height=200dip.

View 1 Replies View Related

Android :: Want To Draw Line Or Path On Google Map In HelloMapView

Feb 1, 2010

I'v been busy for a long long long time finding out how to draw a line between two (gps) points on the map in HelloMapView but with no luck.Could anyone please tell me how to do so.Suppose I use the HelloMapView which extends MapView. Do I need to use overlays? If so do I have to override the onDraw() method of the overlay and draw a line here? I actually tried these things but with no result.

View 5 Replies View Related

Android : Get Absolute Coordinates Of A View?

Feb 8, 2010

I'm trying to get the absolute screen pixel coordinates of the top left corner of a view. However, all methods I can find such as getLeft() and getRight() don't work as they all seem to be relative to the parent of the view, thus giving me 0. What is the proper way to do this?

If it helps, this is for a 'put the picture back in order' game. I want the user to be able to draw a box to select multiple pieces. My assumption is that the easiest way to do that is to getRawX() and getRawY() from the MotionEvent and then compare those values against the top left corner of the layout holding the pieces. Knowing the size of the pieces, I can then determine how many pieces have been selected. I realise I can use getX() and getY() on the MotionEvent, but as that returns a relative position that makes determining which pieces were selected more difficult. (Not impossible, I know, but it seems unnecessarily complicated).

View 4 Replies View Related

Android : Location On Screen Coordinates Of A View?

Mar 22, 2009

I am developing a game in android and i want to capture screen coordinates of a view(ImageView) which is embedded in frame.

Hierarchy is <LinearLayout android android:layout_height="fill_parent" android:layout_width="fill_parent" > <RelativeLayout android:layout_height=fill_parent" android:layout_width="fill_parent" > <FrameLayout android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/frame14"></ FrameLayout> </RelativeLayout> </LinearLayout>

At run time i am attaching two image views for frame layout.I wanted to capture screen coordinates of frame layout.But Couldnt do it.if i say

(FrameLayout) f=(FrameLayout)findViewById(R.id.frame14); int[] loc = new int[2]; f.getLocationOnScreen(loc); System.out.println(loc[0]); System.out.println(loc[1]);

I get Null Pointer Exception for getLocationOnScreen() method.

If I try to get f.getLeft() and f.getRight() they return as 0 coordinates.

Can anyone please tell me how to find location on screen of a view.

View 2 Replies View Related

Android :: Text Alignment Line By Line In Android Text-view Using Gravity

Aug 31, 2010

Can we align our text line by line(I mean whatever the text we have selected that should be aligned instead of the whole text) in android text-view dynamically!

View 1 Replies View Related

Android :: How To Convert Screen Coordinates To 3d Coordinates?

Aug 5, 2010

i'm created an application where it consists of 3d rotating cube I want to move the cube with respect to the drag on the screen.In the on touch Listener I'm able to get the x,y coordinates but i don Know how to make those coordinates to map to 3d space.

View 3 Replies View Related

Android :: Draw View At Runtime?

Mar 29, 2010

I'm just getting started with developing for Android. I'm looking to port one of my iPhone applications, but I'm kind of at a loss for how to draw a view at runtime (a view not declared in the XML). Basically, I want to draw a simple rectangle, but then be able to manipulate its frame after being drawn. Sorry if this is a really, really simple question, but I can't seem to find some equivalent to the iPhone SDK here.

View 1 Replies View Related

Android :: How To Draw Button On Top Of View?

Jan 8, 2010

I am creating a android app using LunarLander as a example.Now I need to create a few buttons which are drawn over the view.I do not want them as a seperate layout above or below the view but in the custom view.Is this possible or am I going to have to programmatically show the button images then detect the touch. The buttons I create using new never show on the app. I assume this is because I have overwritten the onDraw and the buttons are never drawn even though I call.

View 3 Replies View Related

Android :: Draw A View On Top Of Image?

Aug 9, 2010

How do I draw a view on top of image. There is a predefined android xml file and when I run the application I would like to bring up a dot or a square on the top of image. Here the image already shows up from pulling information from andrid res folder , how to draw an dot over it.

View 2 Replies View Related

Android :: How To Draw A Button In A View

Jun 21, 2010

I have a class which extends a View and I'm drawing few images in the canvas. and i want to draw two buttons as well. could someone tell me how to do this? code...

View 3 Replies View Related

Android :: Draw A Particular Part Of A View?

Mar 4, 2010

Let consider this is my tile view (which is a bitmap):

0 0 0 0 0 0 0 0 0

First, I have change the view to

1 0 0 0 0 0 0 0 0

Second, I would like to change the middle one, and I expect the result is 1 0 0 0 1 0 0 0 0

However, the view give the result: 0 0 0 0 1 0 0 0 0

Is there any method that I can draw the particular part but now the whole view? code...

View 3 Replies View Related

Android :: Draw A Border Like Each Row In List View?

Dec 2, 2009

Between each row in list view, android draw a horizontal line (fades away at both ends). If I have a LinearLayout view, how can i add a border like that?

View 4 Replies View Related

Android :: Cannot Create New Map View To Draw To Off Screen Bitmap

Oct 29, 2010

I'm trying to create a MapView in a service (live wallpaper), but have it hidden so that I can render it to a Bitmap, and then map it to a texture to render in opengl. I have a Canvas and a Bitmap, and I intended to call myMap.draw(myCanvas) in order to get it into the correct bitmap so that I could then bind it as a texture.

When I Initialize I do the following:
myMap = new MapView(ctx, APPSTATICS.MAP_API_KEY);
I get an error:
java.lang.RuntimeException: stub at com.google.android.maps.MapView.<init> (Unknown Source)
Why I can't create a new mapview which I can use to draw to a offscreen bitmap?

View 7 Replies View Related

Android :: How To Draw An Dynamic View On Top Of Mainscreen In Phone?

Aug 9, 2010

How can I draw an dynamic view on top of mainscreen in android.

View 1 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 :: Draw A View On A Canvas By Giving X , Y Postion?

Sep 29, 2010

How can i draw a view on a canvas by giving the x,y position in the canvas.

For example,
I have custom view myView, which was created by inflating one of my layout.xml file.
Now i want to draw this myView on the canvas at position (x, y).

How can i do that? code...

View 1 Replies View Related

Android :: Not Able To Draw A Transparent Image On Surface View / Fix It?

Jul 6, 2010

My objective is to run a glowing animation on an image.I am changing the image alpha to produce this effect.

I have used basic AlphaAnimation provided in android framework but found that its slowing down other animations. So i extended a class from SurfaceView and created a thread to update it. ( Again here, i am manipulating alpha of the image ).

Everything seems fine, except that i am not able to draw a transparent image onto SurfaceView.Its showing black color on the transparent areas of the bitmap.code...

View 1 Replies View Related

Android :: Simplest Way To Draw Pixels Lines / Circles On A View?

Aug 14, 2010

What is the simplest way to draw pixels, lines and circles on a View?I want to move a cross cursor around, so nothing particularly intensive.I thought I could extend SurfaceView and add it to an XML and it would just work, but it just appears black, however, when I look at the layout view of localmap.xml in eclipse, the graphics appear as expected. Any ideas? My onDraw is never called on the emulator, and even calling invalidate on the class makes no difference. I shall keep trying but can anyone see anything I've missed? or is there a better way entirely? Code...

View 1 Replies View Related

Android :: Gallery / Adapter View Child Draw Able State

Oct 4, 2010

I am using a Gallery view where the view corresponding to each item is non-trivial and consists of text as well as multiple buttons. When I click to drag the gallery view (somewhere not on one of the buttons) the button's drawable state changes to pressed and appears as if all of the buttons are currently being pressed. Additionally, the same behavior happens for the selected state (e.g. all of the text of the child TextViews changes color). I am trying to prevent this behavior and have found the android:duplicateParentState xml attribute as well as the setDuplicateParentStateEnabled property. This seems like it should accomplish what I am trying to do, but it seems to have no effect.

View 1 Replies View Related

Android :: Draw Custom View On Specific Position Of Screen?

Apr 5, 2010

I have a custom component which consists of 2 text view and 4 toggle buttons. I want to draw this view at some specific position on the screen. How is that possible?

View 1 Replies View Related

Android :: How To Create New Line In Same Text View?

Sep 29, 2010

i think you may get the idea of wat i'm trying to do if you look at the code:here the complication is that i cannot create another textview for another line.
s8="hello";
t12=(TextView) findViewById(R.id.solid);
t12.setText("check"+"/n"+s8);

View 1 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 : Weird Black Line On Top Of List View / Ran Into This Before?

May 6, 2010

I am creating a layout with a ListView and at the very top of the list there is this weird black line that I can't seem to figure out how to get rid of! It's part of the ListView because it moves up and down as I size the ListView. Has anyone ran into this before?

I couldn't get DDMS to take a screen capture for some reason so I took a picture of the screen with my G1, so please forgive the quality! As you can see the line is there at the top of the fade out in the list.

View 2 Replies View Related







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