Tutorial :MapView doesn't take up full screen



Question:

I hate to bother you all again, as this is probably me, a newbie, making some big blunder, but I'm baffled as to why my mapview only takes up a fraction of the screen. I've been following tutorials. My layout:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">

<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="MY_API_KEY"
/>

<RelativeLayout>

The specified screen resolution is, as in the droid, 854x480. It shows up in the emulator in horizontal mode (wide, not very tall). The map starts about a third of the way from the left and ends about a third of the way from the right. It starts at the top and ends about a third of the way from the bottom of the screen. I have no clue why that would happen, as I specified "fill_parent".

Thoughts?


Solution:1

Fixed it. I know what broke it, although I don't know why it broke it. I had manually spelled out the Droid's resolution instead of selecting a preset, but had left unchanged the DPI from the initial 160. For some reason, this caused all apps deployed from eclipse to show up as too small, yet all apps that came with the emulated droid were a perfectly normal size. Go figure. :P

Either way, the fix was to rebuild the droid using a resolution preset.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »