Missing map!

by MartinM » Wed, 21 Apr 2010 18:39:57 GMT


Sponsored Links
 I have a basic working GoogleMap app, which I've copied and made some
changes to. However, hardly any map is drawn, and I can't see why.
Otherwise the app works OK - if I Geo Fix the map moves (I lose the
map I have and just get white with grid, plus a green dot as expected)


Piccy at:    http://www.it-helps.co.uk/nomap.jpg 

I'm sure it's an obvious error, hopefully easy for you guys to spot ;)

--



Missing map!

by Mark Murphy » Wed, 21 Apr 2010 18:53:48 GMT


 


That looks like an Internet connectivity issue. I run into that with the
Google Maps application if I try getting maps over EDGE instead of 3G or
WiFi. The fact that you are getting some tiles, just not all, means it
should not be a programming problem (unless you have some infinite loop
somewhere that is tying up the CPU).

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_Beginning Android 2_ from Apress Now Available!

--


Sponsored Links


Missing map!

by MartinM » Wed, 21 Apr 2010 19:31:31 GMT


 Thanks Mark - a sensible observation, but the original app works fine
still !

I've also had a script running on a remote server for a few hours that
is still OK, plus the internet connection is a very good one.

Maybe there is a problem somewhere on the net which will be OK later.






>



Missing map!

by MartinM » Wed, 21 Apr 2010 22:11:23 GMT


 OK, may be unrelated, but am also having problems with
geoCoder.getFromLocationName which thows 'Unable to parse response
from server'. Seems to be a common problem, but no solution found!
Could the cause of this be the cause of my map problems ?
I do get

04-21 14:00:21.287: ERROR/ActivityThread(5222): Failed to find
provider info for com.google.settings

which I'm not sure is relevant or not.



 protected GeoPoint GetPointFromAddress(String strAddress)
    {
      Geocoder geoCoder = new Geocoder(this, Locale.getDefault());
      try {
        List<Address> addresses = geoCoder.getFromLocationName(
                        strAddress, 5);
        if (addresses.size() > 0) {
            GeoPoint gp = new GeoPoint(
                    (int) (addresses.get(0).getLatitude() * 1E6),
                    (int) (addresses.get(0).getLongitude() * 1E6));
            return gp;
          }
      } catch (IOException e) {
          e.printStackTrace();
        }
      return null;
    }









> >



Missing map!

by MartinM » Wed, 21 Apr 2010 23:01:33 GMT


 Hmmm it appears my old apps don't work today. Initial map is OK, but
any movement results in white space, so no updates.

How can the initial map be OK if the google server isn't accessible?
Does it get cached somewhere (I have restarted the emulator and
Galilleo)








> > >



Missing map!

by Mark Murphy » Wed, 21 Apr 2010 23:06:49 GMT


 


Google Maps is a proprietary component, so we do not know much of the
details of how it works.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android Training in US: 14-18 June 2010:  http://bignerdranch.com 

--



Missing map!

by MartinM » Fri, 23 Apr 2010 18:40:18 GMT


 All working fine today. Must've been a Google problem. Phew :)






>



Other Threads

1. out of memory error & getWallpaper

This has been driving me nuts and I'm hoping someone will be able to
help me understand what is happening (or better yet, how to fix
it! ;-).

I set the background image in one of my apps to the system wallpaper
image using the following code:

   Drawable wp = this.getWallpaper();
   background = (ImageView) findViewById(R.id.background);
   background.setImageDrawable(wp);

This seems to work fine, but periodically, I get the out of memory
error shown below.  Actually, on the emulator, all I have to do is
repeatedly rotate the device and this error will consistently happen
after 10-12 rotations.  On the G1, opening and closing the keyboard
doesn't seem to cause this, but I'll still get the failure every once
in a while.

Is getWallpaper() actually making a copy of the image (I would have
thought I'd just get a refernece to the existing bitmap)?  Do I need
to do anything special to free the image?


08-17 08:32:37.943: ERROR/dalvikvm-heap(1597): 614400-byte external
allocation too large for this process.
08-17 08:32:37.943: ERROR/(1597): VM won't let us allocate 614400
bytes
08-17 08:32:38.054: DEBUG/AndroidRuntime(1597): Shutting down VM
08-17 08:32:38.054: WARN/dalvikvm(1597): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
08-17 08:32:38.054: ERROR/AndroidRuntime(1597): Uncaught handler:
thread main exiting due to uncaught exception
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.graphics.BitmapFactory.nativeDecodeFileDescriptor(Native
Method)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.graphics.BitmapFactory.decodeFileDescriptor(BitmapFactory.java:
424)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.ApplicationContext.getCurrentWallpaperLocked
(ApplicationContext.java:523)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.ApplicationContext.peekWallpaper(ApplicationContext.java:
515)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.ApplicationContext.getWallpaper(ApplicationContext.java:
504)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.content.ContextWrapper.getWallpaper(ContextWrapper.java:201)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at ....onCreate
(MyApp.java:247)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.os.Handler.dispatchMessage(Handler.java:99)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.os.Looper.loop(Looper.java:123)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
android.app.ActivityThread.main(ActivityThread.java:3948)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
java.lang.reflect.Method.invokeNative(Native Method)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
java.lang.reflect.Method.invoke(Method.java:521)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
08-17 08:32:38.313: ERROR/AndroidRuntime(1597):     at
dalvik.system.NativeStart.main(Native Method)

--~--~---------~--~----~------------~-------~--~----~

2. SMS Sent Listener

Is there a workaround to wiring up a listener for SMS messages sent?
The android.provider.Telephony.SMS_RECEIVED works great, but I cannot
find it's partner!

Peace,
Scott

--~--~---------~--~----~------------~-------~--~----~

3. Preferred Activity-Service communication pattern

4. Dialog callback from withing callback?

5. Posts not appearing in group

6. emulator to run iphone apps on android

7. OpenGL and VBO buffers