1

I have built an android application which has a single mapview.

I have a bug where the map view occasionally has missing tiles. The map view is not completely blank some tiles appear but not all of them. All the answers here relate to API Keys or issues with having multiple mapviews in one app. This is not the problem.

It occurs intermittently, approximately one in every five times I start the application after clearing all data out of the app. So its typical seen on new installations.

It only occurs on Android 2.2 devices (Samsung Galaxy S definately)

Note the logs show:

07-21 17:11:52.274: INFO/MapActivity(25951): Handling network change notification:CONNECTED
07-21 17:26:25.629: ERROR/MapActivity(26064): Couldn't get connection factory client

When the tiles fail to load zooming in and out or restarting does not refresh the tiles. Only solution is to go to Settings->Manage Applications->[select app]->Clear data then restart the app.

Anyone seen this before and know of the cause or workaround?

Cheers.

railwayparade
  • 5,154
  • 1
  • 39
  • 49
  • That's an odd one, the only time I have seen an API key be the problem it shows no tiles, not partial tiles. The change notification means you are changing network access points I think, like going from CDMA/GMRS to WIFI or WIFI to WIFI networks. Ill be interested if you solve this one – Idistic Jul 21 '11 at 08:25
  • Actually I'm sorry to mention that I do not have an answer, but I do have the same problem.. On a samsung galaxy S as well with android 2.2. However it would seem strange that it is device specific. This is most likely a bug in mapview. – Ophidian Jul 27 '11 at 16:18
  • I am the owner of samsung galaxy 551 and I face problem with the phones resolution. If the api is not an issue then maybe the area where you are using the app is not catching proper GPS network. I am saying this because i faced similar problem and ended up creating three new api keys and in the end getting out of my building solved my issue – Rashmi.B Jul 30 '11 at 09:01

3 Answers3

2

I can guess that you can see partial tiles so may be your internet connection problem. Check your Internet connection weather it displays 3G icon in emulator if you are trying to run your app in emulator else check in device.

I had found same problem as you because when I had connection some part of map displayed and after some time i had opened it again and at that time i had not internet so I had found partial tiles on map which was loaded at the first time.I had connect to internet and try again then my issue is solved map displays fine.

Dharmendra
  • 33,296
  • 22
  • 86
  • 129
2

Suggestion

public class yourCustomMapView extends MapView{
    public abstract void invalidateDrawable (Drawable who){
        super.invalidateDrawable(who);
        //try to catch the error here:
        //My Guess is the following:
        if(who.getTransparentRegion!=null){
            //DO SOMETHING
            //You would delete the cache and reload
            //Try Reloading the image only
        }
    }
}

Deleting the cache programmatically

This is the easier part. You will have manually to delete all the databases and files associated with your application. Do not forget to close databases and streams to files before deleting. This is if it turns out that you have to clear the cache.

Sherif elKhatib
  • 45,786
  • 16
  • 89
  • 106
0

It can happen if the network connection is not proper. I mean if there is any problem from network provider side. It happend for me too. Just run the app after some time. I hope it may solve problem.

java dev
  • 1,044
  • 1
  • 11
  • 17