0

I have this application I want to upgrade from Google maps API 1.0 to the 2.0 especially for some performances issues.

Now, the application was designed (not by me) with a single Map defined in the unique main activity and use through the different fragments (included in the fragments as a View).

I am reading about the new api and have doubts:

1) Is it good to have 2 fragments on the same screen, one just for the map and the other one for other UI? This way i can create the effect of expanding/hiding almost completely the map with is such in fashion right now?

2) Have you knowledge about some guidelines to upgrade the API? I run on content about how to create with Api 2.0 but not to upgrade: rules, errors, guidelines?

Thank you a lot.

Edit: As always, I am working on it right now and I will post my solution/choice when I am done.

Poutrathor
  • 1,990
  • 2
  • 20
  • 44

2 Answers2

0

1) Is it good to have 2 fragments on the same screen, one just for the map and the other one for other UI? This way i can create the effect of expanding/hiding almost completely the map with is such in fashion right now?

Yes it is expected within the framework to have multiple fragments on the screen and is a large part of the reason they exist.

2) Have you knowledge about some guidelines to upgrade the API? I run on content about how to create with Api 2.0 but not to upgrade: rules, errors, guidelines?

The Getting Started section should help you somewhat on this transition. If there is something specific you are looking for such as optimizing memory during the placement of markers on the map it would be best to search for that as needed.

Aaron McIver
  • 24,527
  • 5
  • 59
  • 88
  • thank you, I am starting with 2 fragments at the same time one for the map only, one for the other field. will update. – Poutrathor Jun 20 '13 at 07:20
  • Ok, so questions start: how do you manage your mapFragment? in the activity. How do you manage different behavior since I have different maps displays with different objectives? for example one map to work with, one map to display historic locations? – Poutrathor Jun 20 '13 at 07:48
  • @Poutrathor I would suggest a different question to capture the specifics of implementation instead of using this question as a thread, it will make it easier for others down stream to find what they are looking for. – Aaron McIver Jun 20 '13 at 14:29
  • Good point. But I know that is not really what StckO wants to be. They/we prefer concise questions and not general ones. Do you know where I can find people post about generalities around architecture? Number of activities/multi-fragmenting and such? ty. – Poutrathor Jun 20 '13 at 15:05
  • 1
    @Poutrathor http://developer.android.com/support.html has forums, channels, etc.. which should solve what you are after. – Aaron McIver Jun 20 '13 at 15:20
0

1) Is it good to have 2 fragments on the same screen, one just for the map and the other one for other UI?

Depends on what data you want to put on one screen. It is often a good idea to have most of the UI-related logic inside Fragments instead of Activities, because they can be arranged differently on phones and tablets.

This way i can create the effect of expanding/hiding almost completely the map with is such in fashion right now?

Animating might be problematic. See Issue 4659 and Issue 4639.

2) Have you knowledge about some guidelines to upgrade the API? I run on content about how to create with Api 2.0 but not to upgrade: rules, errors, guidelines?

IMHO the best way is to forget (delete) all the code related to v1 and start from scratch, following official documentation.

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94
  • thank you, I will try what you say and go from scratches. Since I will also follow Aaron advice to use 2 fragments, all the map related code is to rework, I suppose. – Poutrathor Jun 20 '13 at 07:24