Android :: Draw Text With Border On MapView?
Nov 12, 2009
I'm trying to draw some text onto an MapView on Android. The drawing of the text goes fine, but it's very hard to read the text because it's white with no black border (like the rest of the text that appears naturally on MapViews to denote cities, states, and countries). I can't seem to figure how to draw the text with a black border. This is the sort of code I'm using right now (this is just example code, found in one of my overlays):
@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
Paint textPaint = new Paint();
textPaint.setARGB(255, 255, 255, 255);
textPaint.setTextAlign(Paint.Align.CENTER);
textPaint.setTextSize(16);
textPaint.setTypeface(Typeface.DEFAULT_BOLD);
canvas.drawText("Some Text", 100, 100, textPaint);
super.draw(canvas, mapView, shadow);}
View 3 Replies
Dec 17, 2009
I have followed the example in for the gradient dividers: http://www.connorgarvey.com/blog/?p=34. I have tried to draw a horizontal line at the BOTTOM of my linear layout. Here is my linear layout file:
<LinearLayout android:id="@+id/test" android:layout_width="fill_parent"
android:layout_height="wrap_content>
<ImageView android:id="@+id/icon1"
android:layout_width="32dip"
android:layout_height="32dip"
And I did add <View
android:background="@drawable/black_white_gradient"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_above="@id/test"
But i don't see any line at the top of the LinearLayout. And when I go to Hierarchy View and see he View (for the hort separator), the getWidth() is 0 while getHeight() is 1. Can you please tell me what am I missing?
View 2 Replies
View Related
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
Sep 20, 2010
is it possible to draw a 9-patch that tile its border instead of stretching it?
View 2 Replies
View Related
Oct 20, 2009
I have been able to draw a map using 'MapActivity' class. Am unable to render 3D graphics on the Map. Is there any way to draw something on the foreground with the Map as the background?
View 2 Replies
View Related
Feb 14, 2010
i have a problem with my mapView. my app reads "some" gps points out of a file and i want to draw a route (drawing lines between the gps point). If my file contains many gps points, my app works really slow. i think its working slow, because i draw all overlays. now i want to check, whether a point is visible in my mapView or not. so i have to get the mapCenter and Lat/lon span (getLatitudeSpan,..) !? how and where must i save my points and how can i check all my points (after my mapCenter has changed for example). Shall I save my points in a list (in my Overlay class??) and iterate through every list item and check, wheter its visible or not?
View 4 Replies
View Related
Aug 27, 2010
I am developing an application for the Parisian Metro. One of the functions is a map where you can click the metro stations and see what are the metro lines, and when are the next 4 trains on this station.
I have hence created a MapActivity and an ItemizedOverlay classes.
On my device it is working perfectly, but I am getting some logs from the users with a crash, and I really don't understand what's wrong.
My map activity adds ONE ItemizedOverlay that displays a blue dot for the current user location. This overlay also listens to onTap, which depending on the coordinates of the tap, will try to find metro stations (for which I know the lat/lon coordinates). This is working perfectly.
The stack trace of the crash is:
CODE:.....................
Sometimes it comes from different lines but it always finishes crashing at OverlayBunde.java:42
As is does not mention my code, I don't know what's wrong.
You can get the source code of the MapActivity and the the ItemizedOverlay: http://code.google.com/p/metroparis/source/browse/trunk/src/org/bicou/metro/
The activity class is ACarteStations and the overlay class is StationMetroMapOverlay.
View 1 Replies
View Related
Oct 1, 2010
Trying to solve my current problem of drawing an image on an Android MapView and then animate it to represent a moving object, I decided to try to just draw a raw ImageView at a GeoPoint on the map and then try and animate it from there.
This is the code I put in my map activity (extends MapActivity)'s onCreate method:
CODE:..............
Again, I'm just trying to draw the static icon and animate it from there. I can already do this with an ItemizedOverlay, but as far as I can tell, I can't animate the elements of an AnimatedOverlay the way that I can animate a view. Thus, using ImageView.
But the icon doesn't show up.
View 1 Replies
View Related
Aug 26, 2010
My Android application has a MapView. I want to divide that MapView into a grid according to latitude and longitude, and shade the different cells of that grid different colors based upon a certain criteria. What's the simplest way to do this?
I could create semi-transparent, solid-color PNG Drawable rectangular images and put them in an ItemizedOverlay centered on the central points of the cells, but then the rectangles would grow and shrink as the user zoomed in and out on the map. I could extend MapView and override the zoom functions so that the rectangles got re-sized when the user zoomed, but that seems really complicated for something that should be simple! Please tell me a better way to do it?
View 1 Replies
View Related
Aug 1, 2010
I wonder, how can I draw a nice flight route between 2 points on a google map's MapView? look at this: http://maps.forum.nu/gm_flight_path.html
View 6 Replies
View Related
Aug 2, 2010
I am writing a application that needs to draw a "route" comprised of lots of GPS points (long+lat). The points are close together and don't follow roads, simply drawing a line between each point is ideal.
The current implementation I have is very slow as I am looping over all the GPS coordinates and creating a new Point and overlayitem in an itemized overlay. This takes around 20 seconds for it to load all of these points and draw them to the mapview. Is there a way in which I can construct a series of lines or point from the GPS coordinates and draw them onto the mapview?
Example of current implementation:
CODE:...................
View 2 Replies
View Related
Nov 23, 2009
In my application I would like to mark different spots on a map. What I'm now wondering is if there's a way to use a simple 9-patch image and add the spot's name as text to it or would I need to draw everything myself (including the text) in the draw() method of ItemizedOverlay?
View 1 Replies
View Related
Jun 14, 2009
Can i draw text on a bitmap? I cannot find any API support this.
View 4 Replies
View Related
Apr 12, 2010
how to draw text on GLSurfaceView in Android?
View 5 Replies
View Related
Aug 4, 2009
I have just started looking at developing for Google Android and want to draw a rectangle with some text in it that I then want to position where i want on screen. I have got as far as drawing a rectangle on screen using a ShapeDrawable and RectShape I now want to put some text in the rectangle. How can I best do this? Should I be looking at somehow adding a textView to the RectShape? Or am i going down the the wrong avenue completely?
View 3 Replies
View Related
Oct 28, 2010
i'm trying to develop a simple pie chart class for android. For now, it can take a map of labels and values and draw the pie chart. I'm yet to add the legends for the pie, which is where i need to place the texts near small rectangles on the screen corner. Any help appreciated, since i'm new to Android dev.
View 1 Replies
View Related
Aug 27, 2009
I'm currently developing a small OpenGL game for the Android platform and I wonder if there's an easy way to render text on top of the rendered frame (like a HUD with the players score etc). The text would need to use a custom font also. I've seen an example using a View as an overlay, but I don't know if I want to do that since I might want to port the game to other platforms later.
View 4 Replies
View Related
Nov 6, 2009
I want to write a graphics app using SurfaceView.
Basically my requirement is to draw some text frequently according to some time.
Is it possible to do this? can any one please provide me some source code which draws the text using SurfaceView.
View 2 Replies
View Related
Apr 11, 2009
Is there any convenient method to draw a string (custom true type font) as big is possible inside a supplied rectangle or to calculate the font size of a paint object based on a string and some rectangle dimensions.
View 3 Replies
View Related
Feb 4, 2010
I have figured out the static layout this far, but I have no idea how to make it display my text anywhere else but in the top left corner. StaticLayout layout = new StaticLayout(text, getTextPaint(), 140, android.text.Layout.Alignment.ALIGN_CENTER,(float)1.0, (float)0.0, true); layout.draw(canvas);
View 2 Replies
View Related
Jul 24, 2010
i have an activity and in the activity i have some buttons and textviews, and i would like to draw a rectangle with text inside. i saw some examples online but the all say to create my on view , override onDraw and the set this view as my layout, but i have my layout already.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView baramzona = (TextView) findViewById(R.id.TextView01);
baramzona.setText(R.string.baram_zona_textview);
final Button pocniparking = (Button) findViewById(R.id.ButtonStart);
final TextView momentalnazona = (TextView) findViewById(R.id.TextView02);
//momentalnazona.setText("Моментално се наоѓате во зоната");
pocniparking.setText(R.string.btn_Start_Parking);
pocniparking.setEnabled(false);
}
}
View 1 Replies
View Related
Sep 26, 2010
I've figured out how to draw Arabic characters properly (connected and right to left) using string literals like this:
textView.setTypeFace(Typeface.createFromAssets(getAssets(),"DejaVuSans.ttf"));
textView.setText("uFEB3uFE92uFE98uFE94");
But for some reason I cannot get the arabic to format properly if I read anything from a file using InputStreams like this:.....................
View 1 Replies
View Related
Jul 16, 2010
I had found a lot of stackoverflow post about save an Activity and the reload it.
My question: How can I have an Activity with an MapView and after reload the same mapview?
What is the best way to switch between activity and views?
View 2 Replies
View Related
Sep 13, 2009
I'm trying to draw Arabic text onto a Bitmap for display:
CODE:...........
However, the bitmap that is generated looks like this:
When it should look like............
I believe the issue is because, unlike a TextView, the Bitmap class is not BiDi aware, so it draws the letters from left to write.
Try as I might, I can't figure out how to draw the text in the correct order.
View 2 Replies
View Related
Dec 29, 2009
I would like to further annotate the custom markers I have placed on a MapView (using ItemizedOverlay) by displaying a simple text label that appears for a particular item when the onTap event is fired.
This is a trivial exercise in the Google Maps JavaScript API and in MapKit on iPhone, but it is not obvious to me what the best or easiest way to do this is on Android.
View 1 Replies
View Related
Jan 8, 2013
I am wondering if there is a way to draw an image, or edit simple lines in a text box. The entire screen is a textView/ect and i would like to be able to write a sentence then draw an image and write again. By draw i think i would use the Canvas, so basically is there a way to include a canvas in a text view?
Evernote does do this, but to edit an image/draw you need to open another app "Skitch", my goal is to try and do this without any extra apps.
For example:
Hello
(canvas/editable graphical items)
World
View 3 Replies
View Related
Sep 5, 2010
In my android application I use this method in "draw" Overlay class for draw route on map. Can someone tell me if this method is good (in terms of performance) for route draw on map or I must to put code in Thread ??
I'm new to android.
public synchronized void draw(Canvas canvas, MapView mapView, boolean shadow) {
if (pointsAndTimes.isEmpty()) {
return;
}
Projection projection = mapView.getProjection();
Paint paint = new Paint();
paint.setARGB(250, 255, 0, 0);.............
View 1 Replies
View Related
Oct 31, 2010
Is there a way to draw on or modify the key guard wallpaper programmatically?It looks simple enough for the home wallpaper, you can use WallpaperManager. But how about for the lock screen wallpaper?
View 1 Replies
View Related
Oct 19, 2009
I would like to have a shape that has border only on 3 sides: top, left and right, i.e. I want bottom to be open. How can I achieve that defining shape in XML? Currently I have a normal 4 side border using the following shape XML definition:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" >
<solid android:color="#FFE8F0F8" />
<stroke android:width="1dp" android:color="#808480" />
<padding android:left="1dp" android:top="1dp" android:right="1dp" android:bottom="1dp" /> </shape>
View 5 Replies
View Related
Oct 16, 2009
I want to create our own BorderLayout like this <BorderLayout> <left> </left><right>/right> <top> </top><bottom> </bottom> </BorderLayout> i know there is no layout in android like this , so I want to create like this. I have seen a borderLayout http://www.anddev. org/viewtopic.php?p=5087 here .but if we want to create a BorderLayout inside the Border Layout,with this example comlexity is more.(inner BorderLayout).so if u have any solutions tell me.
View 2 Replies
View Related