Reputation: 949
I'm developing an application that use Google Map API V2.... but i'm with a terrible doubt in my head: What should i use, Fragment or MapView?
In the example app that comes with the Google API it's used MapView, but in the developer's site they use Fragment.
So, what should i use? What the differences between they?
And, in case of MapView, can anyone show me how can i put a Marker in the map?
Thanks a lot...
Obs: I have searched... but not found the answer...
Upvotes: 2
Views: 1407
Reputation: 435
Well, are you planning to make difference between phone UI and tablet UI, if so I would use fragment. I also prefer using fragment since it makes the UI smoother and more functional.
Upvotes: 1
Reputation: 73966
So, what should i use?
only you can answer that
What the differences
MapFragment
is just like any fragment, but shows a map
MapActivity
is a new activity that shows the map
in either case you get the map the same by doing
GoogleMap map = getMap();
Upvotes: 1