Android :: Threading - Custom Google Maps Tile Overlay

Nov 4, 2010

I've been stuck for ages now trying to implement threading or background image loading for a custom tile overlay class I've been working on. I'm pretty useless when it comes to Java so threading isn't something I've had any experience with. Basically I have extended an ItemizedOverlay and in the draw() method calculate the tiles I need to display over the standard google tiles then fetch those images with a URLConnection and using BitmapFactory decode them and draw them to the canvas at the correct position on the screen so that the images are on top of the google tiles with about 50% opacity (the custom tiles are cellphone network coverage png's which are used for our web app). I initially got this all working with the tiles loading in the correct places but hit issues with memory and "freezing" while panning so implemented some basic caching and memory management to only store the tiles that are displayed on the map in memory and when downloading a tile store it to SD card.

Then I figured the freezing while panning is due to the blocking nature of downloading the images so, have been trying to implement threading. I created a class that extends AsyncTask to download the images in the background and store them to SD, in the onPostExecute method I then try to draw all the tiles. But onPostExecute never seems to fire, now I know that the AsyncTask has to be called in the main ui thread so tried to debug the execution with Thread.currentThread().getId() calls through out the code. The thread Ids through out is 1 and then 10 for the doInBackground method for the AsyncTask. Now I'm not sure if 1 is the main UI thread or not. In the extended MapActivity class I have, the onCreate method's Thread.currentThread().getId() returns 1 but I'm not sure if the MapActivity class is executed in the main ui thread? Here Romain Guy mentions that the onPostExecute method should have @Override but when I do that eclipse flags it as an error

"The method onPostExecute(Boolean...) of type TileCache.ImageLoadTask must override or implement a supertype method"
So I guess something is wrong there but the only fix eclipse offers is to remove the @Override
So I guess with out post all my source code, the question's I have are:
Is the MapActivity onCreate method called in the main ui thread?
What does the @Override error mean? or why does it show that error
Does anyone have an example of a custom tile overlay implementation with background image loading and tile caching?

Android :: Threading - Custom Google Maps Tile Overlay


Android :: Detecting Clicks On A Google Maps Overlay

Jun 15, 2009

I would like to put a bunch of dots on a google map, and have the appropriate listener called when one of them gets clicked.All i seem to be able to find is to get the location at which the click occurred, and then iterate through the dots until I find one that I think matches. Is there no listener for an arbitrary shape, like a drawable? I feel like this might be a Java question more so than android, but hopefully someone can still answer it.

View 3 Replies View Related

Android :: Expanding Overlay Marker On Google Maps?

Jul 20, 2010

I can draw overlay items onto google maps just fine, an image that looks like:
_____
| |
______
/

Where the "/" part is the "pin" that marks the lat/lon on the map and a picture in the middle of it. My question is, is there any way to expand this when the user clicks on it? I'll of course have to change this to some kind of dialog or layout and change it when it gets clicked.

I want to have it smaller like that with just an image when not clicked on, but when it is clicked on it expands over like a second to:

--------------------------------------
| <image> <buttons> |
| <buttons> |
| <some info here> |
| |
--------------------------------------
/

Is this possible?

View 2 Replies View Related

Android :: Not Understanding DrawAt() Method For Com.google .maps.Overlay

Jan 19, 2010

Trying to make an google maps overlay in an android program. Inside of my overlay's draw method, I have two ways of adding a pin. One of them works, and one does not. Unfortunately, the one that does not work is also the only one that has the ability to add a shadow!

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

View 2 Replies View Related

Motorola Droid :: Overlay A Route In Google Maps?

Feb 5, 2010

I am looking for a way to overlay a route in google maps.

What I want is to take this map Greenways Oak Ridge Google map and get it to my google My Maps. Then I can pull it up in Maps and use my location to see where I am in relation to where I need to be in case I want to take a different route to need to shorted the ride due to darkness.

Most rides I do I can find these maps but cant do anything with them.

View 13 Replies View Related

Android :: Show Custom My Google Maps On Device

Jul 22, 2010

I created a custom map in Google Maps "My Maps". Now i want to show that map on an android device, but not just opening it as a web page but showing it using MapView or smth similar. I want to be able to center on a place I have marked on the map etc. My custom map is a map containing the location of all gas stations in a city.

View 1 Replies View Related

Android :: Hosting Custom KML For Using In Google Maps Mobile?

Jul 14, 2010

I am new to Android and so I may be missing some very basic things here. I am trying to host custom KML files on a server behind my firewall and display those KML files on the Android emulator. I started by writing a simple app that uses an Intent to display the overlay and pointing the app at geo:0,0?q=
http://code.google.com/apis/kml/documentation/KML_Samples.kml. This works in the emulator.

Next I downloaded that KML file and posted it on my web server (Apache 2.2 on Fedora). I added an AddType directive for the .kml extension and restarted HTTPD. When I point my simple app's Intent to my internally hosted KML file I get the error "The community map could not be displayed because it contains errors." I added some code to try and download the KML file independently of the KML so I could check the status line and the like:

final HttpClient client = new DefaultHttpClient();
final HttpGet get = new HttpGet("http://mycompany.com/data/KML_Samples.kml");
try { final HttpResponse resp = client.execute(get);
android.util.Log.e("MapOverlays", resp.toString());
} catch (Throwable t) {
android.util.Log.e("MapOverlays", "Exception", t);
}

With a breakpoint on the first Log message line I can inspect the results:
statusline = "HTTP/1.1 200 OK"
Content-Type: application/vnd.google-earth.kml+xml

Here's the Intent I'm using:
final Intent intent = new Intent(
android.content.Intent.ACTION_VIEW,
Uri.parse("geo:0,0?q=http://mycompany.com/data/KML_Samples.kml"));
startActivity(intent);

So the two main questions are
What do I need to do to get KML loaded from a private server?
What tools are available (if any) to determine what is wrong with what I've done (something more informative than "The community map...")?

View 1 Replies View Related

Android :: Start Activity From Overlay In Maps

Jul 22, 2010

I am trying to create a map application and I need to do something similar to what Google Maps does. I want to open show a list of locations and when user taps on them I want to show a dialog.

I was able to do it till here. But now when the user clicks on the dialog that opened I want to show another acttivity with the details of that item that they clicked on.

I tried to start a new intent but it gives me an error.

Here is what I am doing

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

Here is the stack trace E/AndroidRuntime( 4985): java.lang.RuntimeException:

Unable to start activity ComponentInfo{com.achie.test.mapssample/ com.achie.test.mapssample.ItemDetailView}:

CODE:........

Why am I getting this error and how can I resolve this and open a new activity?

Also where can I find the source code for the google maps on android?

View 4 Replies View Related

Android :: Phone Maps Support Ground Overlay?

Jun 8, 2010

I have a weather image I would like to use as an overlay in the google maps android api. I would like to achieve the same result that I get from using GroundOverlay in KML files, such as

<GroundOverlay>
<name>myimage</name>
<Icon>
<href>myimage.png</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>75.6088</north>
<south>5.0121</south>
<east>182.2805</east>
<west>120.6795</west>
</LatLonBox>
/GroundOverlay>

The above will ensure that the 4 corners of my image stay anchored to the 4 lat/long points listed, regardless of scrolling, zooming etc. Is there a way to accomplish this using the google api / maps provided for android?

View 1 Replies View Related

Motorola Droid :: Custom Could Be Causing Google Maps Invalid Signature

Apr 23, 2010

I currently running Smoked Glass V6.0.1. I tried updated my google maps to 4.1.1 and I get a invalid signature. According to google mobile help forums I am receiving this error because my build number doesn't match specific build numbers their application is designed to work with.

Has anyone else experience this problem?

View 8 Replies View Related

Android :: Adding Items To Maps Overlay Does Not Immediately Show On Map

Aug 28, 2010

I can't figure out how to tell my Map to redraw its overlays once I've updated them. Currently the user has to touch the screen before the map is redrawn.

View 2 Replies View Related

Android : Location/maps - Speed - Delete Overlay Without Deleting All The Others

Oct 26, 2010

I'm messing around with maps and gps and i have some questions. Hope any of you point me in the right direction:

- I´m loading about 400 overlays in a mapview, but it takes 2-3 minutes. Is there any way to speed things up?

- On the other hand, I use another overlay to point device gps position, but when location point change i need to delete this overlay to put it again in it's new position. How can i delete this overlay without deleting all the others?

View 15 Replies View Related

Android :: Custom Overlay Item Not Drawing

Aug 10, 2010

I created a custom OverlayItem class so that I could essentially have one kind of OverlayItem whose Drawable marker would set itself depending on the state of some data that I pass into it. I have attempted to accomplish this by, on my first attempt, utilizing the setMarker method within the OverlayItem class. Once that did not work I attempt to override the getMarker method and have it return the appropriate marker to represent the data. Both of these attempts ended with nothing being drawn on the map...however if they are commented out the markers draw just fine (except they of course use the default marker, which isn't what I want). Here is my code for my custom OverlayItem class (the commented out methods I have tried and they have not worked):

private class MyOverlayItem extends OverlayItem {
private Context mContext; private MyData mData;
public MyOverlayItem(GeoPoint point, MyData data, Context context) {
super(point, data.getWhat(), data.getWhere()); this.mContext = context; this.mData = data;
/*if(data.getTemp() > 200) this.setMarker(res.getDrawable(R.drawable.icon_data_hot_l));
else if(data.getTemp() > 100) this.setMarker(res.getDrawable(R.drawable.icon_data_neutral_l));
else this.setMarker(res.getDrawable(R.drawable.icon_data_frozen_l));*/ }
/*@Override public Drawable getMarker(int stateBitset) {
Resources res = this.mContext.getResources(); if(this.mData.getTemp() > 200)
return res.getDrawable(R.drawable.icon_data_hot_l); else if(this.mData.getTemp() > 100)
return res.getDrawable(R.drawable.icon_data_neutral_l);
return res.getDrawable(R.drawable.icon_data_frozen_l);
}*/ }
Is there a way to do what I am attempting to do or do I need to make a unique OverlayItem class corresponding to each state of my data?

View 3 Replies View Related

Android :: Google Maps Custom Route With Turn By Turn Directions?

Sep 18, 2010

Frustrating - but apparently the capability is I can customize a route online with Google Maps, save it to my maps and send it to the phone but it sends the static map.Ridiculously, all this power and I can't take those directions from the PC and turn them into turn by turn directions on the phone.

View 3 Replies View Related

Android :: Zoom In And Out On A Custom Overlay And Enlarge Image?

Nov 17, 2010

Does anybody knows if it is possible to zoom in and out on a custom overlay and enlarge the image? I'd like to do something like that: http://geoserver.nima.puc-rio.br/puc-rio/

If you zoom in, you'll notice that the image gets bigger.

View 3 Replies View Related

Android :: Android Maps Overlay OnTap Click

May 5, 2010

Could anyone help me with my below program. I'm unable to put a transparent label containing the contents from my HelloGoogleMaps.java class (Hola, Mundo!) when i click the markers(the android icon) in the map. I would like to have the ontap event do it for different markers here so that that particular location details is popped up. It needs to be in a canvas display. Upon clicking this new canvas label, it should take me to a seperate activity displaying complete details. I'm using the sample program given in the Google Android Website http://developer.android.com/resources/tutorials/views/hello-mapview and i want to extended it to the next level. Import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import com.google.android.maps.OverlayItem; import android.app.Activity; import android.graphics.drawable.Drawable; import android.os.Bundle;

View 2 Replies View Related

Android :: Map Open Overlay When Pin Is Clicked - Overlay Contains Description / Button

Aug 18, 2010

I like tu use the MapActivity to display some pins. When a pin is pressed i like to open a description. This can I obtain following the tutorial: http://developer.android.com /resources /tutorials/views/hello-mapview. But now I like to put a button on the overlay window. That button should open a detail activity. How can I make this? How is possible to personalize the overlay "info window"?

View 2 Replies View Related

Android :: Google Maps - Settings In Emulator For Displaying Maps

Sep 25, 2010

I use the google code from devloper.android.com I use that application but in the emulator it shows only the crossed lines not the map so is there any settings in emulator for displaying maps

CODE:.....

Android mainfest

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

View 4 Replies View Related

General :: Google Maps 6.9 - Where Are Offline Maps Stored

Jul 12, 2012

what is the path to the offline map files saved by Google Maps 6.9?

View 9 Replies View Related

Android :: Google Latitude Application For Access Through Google Maps?

Mar 5, 2009

Is Google Latitude available in the UK or not, because it doesn't seem to be working for me? I have received the RC9 update for G1 and have Google Maps 3.0. Is there an a Google Latitude application that I should have or do I access everything through Google Maps? When I go the www.google.com/latitude on my G1, it offers me the option of "launching" Latitude but it just takes me to Google Maps. From there, I cannot see the locations of my Google "friends" (who have agreed to show location), neither does my own location show up on the Latitude homepage on the web (I have settings turned to "detect my location automatically").

View 13 Replies View Related

Android :: Media Player Threading

Jul 6, 2010

I have written a Music player app and it works great but when a flip action happens or when I return the the player view I have to stop the player and restart it at the potion that it was at when the action happened. That all works but it means a breif stop and start. How can I run the media player in a different thread and still update my seek-bar?

View 2 Replies View Related

Android :: OpenGL - Threading Texture Loading

Aug 27, 2009

I'm converting an app I've written from Canvas to OpenGL, and not having too hard of a time yet. However, I've run into one snag that I can't seem to get around. My old app was threading image loads, because there are a ton of them, however, it looks like the OpenGL implementation protects itself to a single thread. I have a basic loadBitmap() function as follows:...............

View 4 Replies View Related

Android :: Media Player Threading / Concurrency

Aug 30, 2010

I am using the default Android Media Player in an Activity, trying to play back a couple of video files. However I have a problem with programming what I want. The desired program outcome would be the following:

A video file is played back After that, a dialog is shown, asking the user something A pause of 5 seconds occurs The next video is shown and so forth. How am I to program this? Currently, I use a paradigm like the following:..................

View 1 Replies View Related

Android :: Progress Related Problem Using Threading

Mar 1, 2010

I am using following code to display progress on andorid activity when i call web service method to getposts it show progress. but when call of serivce is complete my application gets crashed.

What mistake am i doing or any other alternative way to achieve this goal?

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

View 2 Replies View Related

Android :: Create An Custom Droid Maps Marker?

Sep 24, 2010

I want to create a mapview marker with 4 elements:
- picture (of user)
- background
- text (username)
- Arrow to show an direction

OverlayItem.setMarker() accept only a drawable.

How can I create an drawable with 4 Items? Or can i add an View as marker to overlayItem?

any ideas?

View 1 Replies View Related

Motorola Droid :: Unable To Find Google Voice Or Google Maps In Market

Oct 19, 2010

I'm running Cyanogenmod 6. I just noticed that I can't find Google voice or Google maps in the market. I do have the apps installed, but can't see them int he market to get updates. I tried out LFY1.7 and Ultimate Droid 1.0.0, and see the same issue.

View 5 Replies View Related

General :: Google Apps Like GMAIL / GOOGLE+ / PLAY / Maps Not Working In Airtel 3G

Apr 16, 2014

I am using Nexus 4 Bought from US thro my friend.Current Android version id 4.4.2..My Service Provider is Airtel. All my google applications like Gmail, Maps, Play,Google Plus are working fine in WIFI.But when i try to refresh or update these application thro Airtel 3g,i am getting No Connection Error.

All my 3rd party apps like Facebook,Whatsapp are working fine in 3G.

View 3 Replies View Related

General :: Google Maps App Doesn't Sync Names With Google Bookmarks

Apr 17, 2013

I'm using the latest version of Google Maps on JB 4.2.2 [Nexus 4]..I noticed that I cannot edit the names of my locations in "My Places" in the phone app. So I used Google Bookmarks (google.com/bookmarks) from my PC to edit/rename My Places. However, the names do not sync or carry through to the Google Maps app on the phone. The names in the app are still the generic names, coordinates or street names.

Is there any way to change the names of My Places and get them to sync with the phone app? Really baffling!

View 2 Replies View Related

Android :: Framework / Application For Displaying Individual Custom Maps

May 21, 2010

I've started to develop in Android 2 weeks ago and until now, I like it! Currently I am working on a project where I have to display an individual map (not a google maps view, I'd like to display the map of a building's interior) with which the user can interact(mark positions, etc.).
Is there a framework or an existing app that I could use? Of course I searched the internet but could not find anything. Perhaps it is in some way possible to use the google maps API?

View 1 Replies View Related

General :: App Or Mod To Google Maps Allow To View Maps (satellite View) Offline

Sep 4, 2012

I'm searching for an app or mod to google maps that allow to view maps (satellite view) offline

View 1 Replies View Related







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