Map application designing

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Map application designing

Postby sw22 » Wed Sep 29, 2010 2:20 pm

Hi,
I would like to create an application which would start with a start screen with different choices (buttons for instance) and some of them would launch a specific map. The problem is, in all tutorial I have seen so far, there is only one class.
Here is my question: Is this a good idea to put everything in the same class or should I separate the home page to the map pages (if so, how to do so?! cause the only one class would extends from mapActivity which is not clean IMO) ?

Thank you for helping me!

swan
Last edited by sw22 on Sun Oct 03, 2010 1:40 pm, edited 1 time in total.
sw22
Freshman
Freshman
 
Posts: 6
Joined: Wed Sep 29, 2010 2:03 pm

Top

Re: Map application disigning

Postby jonbonazza » Wed Sep 29, 2010 4:53 pm

It depends on how you want the app to look... If you want it on two separate 'screens', then you need to use two different classes... one class will extend Activity and contain the buttons, then when one of the buttons is clicked, it will fire an intent that will launch another class that extends MapActivity.
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Re: Map application disigning

Postby sw22 » Thu Sep 30, 2010 2:59 pm

OK I tried this last week and now again following you advice. Nonetheless, I still cannot see how to code my map class which extends from MapActivity. How do I launch this object ? and what is executed inside (onCreate like in the main ?) ?
Where can I see a tutorials similar to what I wanna do ? I always find simple tutorial with one class.

Thanks you anyway, I understand a bit more than before!

swan
sw22
Freshman
Freshman
 
Posts: 6
Joined: Wed Sep 29, 2010 2:03 pm

Re: Map application disigning

Postby jonbonazza » Thu Sep 30, 2010 4:42 pm

I am not sure I understand you entirely... You should have an XML layout file that contains a <MapView /> tag (Obviously with various parameters, one of which is the map key).

Here, take a look at this:

http://developer.android.com/guide/tuto ... pview.html
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Re: Map application disigning

Postby sw22 » Fri Oct 01, 2010 3:58 pm

ah I solved my problem. When I add an activity I have to write it in the manifest.xml!
sw22
Freshman
Freshman
 
Posts: 6
Joined: Wed Sep 29, 2010 2:03 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 2 guests