| Author |
Message |
navajo Freshman

Joined: 21 Dec 2007 Posts: 4 Location: Germany
|
Posted: Tue Jan 08, 2008 9:15 pm Post subject: |
|
|
When starting your application the map is always centered to Tulsa (USA). Where are the coordinates of this location defined? I mean: in which file in the android system can I find these coordinates? _________________ In a world without walls and fances... who needs Windows and Gates? |
|
| Back to top |
|
 |
plusminus Site Admin


Joined: 14 Nov 2007 Posts: 2624 Location: College Park, MD
|
Posted: Tue Jan 08, 2008 9:50 pm Post subject: |
|
|
Hello navajo,
you are talking of the "Me"-Location
But you can create your own Mock Location Provider (as real GPS-devices are not supported in the emulator).
Regards,
plusminus _________________
Download my apps  Please remember, that this board is give & take 
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
navajo Freshman

Joined: 21 Dec 2007 Posts: 4 Location: Germany
|
Posted: Tue Jan 08, 2008 10:11 pm Post subject: |
|
|
Thanks for your quick reply!
No, I'm not talking about ME-Location. I am talking about the coordinates when the map is first centered, and on my map this is Tulsa (USA). U use zoom level 3 in your code, and if I zoom in, then I get to Tulsa and not next to "Bayshore Fwy". I'm wondering where these default coordinates come from.
Defining my own mock-gps-provider is known to me...
Hope my question is more precise now  _________________ In a world without walls and fances... who needs Windows and Gates? |
|
| Back to top |
|
 |
plusminus Site Admin


Joined: 14 Nov 2007 Posts: 2624 Location: College Park, MD
|
Posted: Tue Jan 08, 2008 11:47 pm Post subject: |
|
|
Hello navajo,
hehe, didn't even recognize this, but when you open the System-Map-Activity the map is centered there to. (Thought that it the initial sdk-release it was pointing to the middle of the world map (atlantic ocean).
So perhaps on of the Android-Map-Activity-Coders lost a bet or sth. .
Regards,
plusminus _________________
Download my apps  Please remember, that this board is give & take 
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
glider Freshman

Joined: 03 Jan 2008 Posts: 4
|
Posted: Wed Jan 09, 2008 10:24 am Post subject: |
|
|
Thanks - the below worked!
sth. like this should work:
| Java: | // Animate to the center
myMapView.getController().animateTo(new Point(lat.intValue(),lng.intValue())); |
Another question - is it possible to preload/cache the maps ?
(assuming you have/can simulate the gps track ?)
I.e if you expect no network coverage but you still like a moving map. |
|
| Back to top |
|
 |
plusminus Site Admin


Joined: 14 Nov 2007 Posts: 2624 Location: College Park, MD
|
Posted: Wed Jan 09, 2008 5:34 pm Post subject: |
|
|
Hello glider,
haven't seen such a functionality yet, would probably be done centrally by the underlying System-Map-"""Provider""".
Caching data for specified customizable locations would be an idea, as it would just take a few megabytes for a medium town (but just on one Zoom-Level !)
Regards,
plusminus _________________
Download my apps  Please remember, that this board is give & take 
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
KC Freshman

Joined: 07 Jan 2008 Posts: 2 Location: Netherlands
|
Posted: Thu Jan 10, 2008 10:02 am Post subject: |
|
|
Hello,
(my first post)
I used the next code to always center the "ME" location on the screen (in UpdateView):
| Java: | Point point = new Point(lat.intValue(), lng.intValue());
myMapController.centerMapTo(point, false);
this.myMapView.invalidate(); |
regards, KC |
|
| Back to top |
|
 |
glider Freshman

Joined: 03 Jan 2008 Posts: 4
|
Posted: Thu Jan 10, 2008 12:22 pm Post subject: |
|
|
Maybe if android use a http proxy ? Would that work in this case ?
Thanks for all your help!!!
| plusminus wrote: | Hello glider,
haven't seen such a functionality yet, would probably be done centrally by the underlying System-Map-"""Provider""".
Caching data for specified customizable locations would be an idea, as it would just take a few megabytes for a medium town (but just on one Zoom-Level !)
Regards,
plusminus |
|
|
| Back to top |
|
 |
plusminus Site Admin


Joined: 14 Nov 2007 Posts: 2624 Location: College Park, MD
|
Posted: Thu Jan 10, 2008 12:39 pm Post subject: |
|
|
| glider wrote: | | Maybe if android use a http proxy ? Would that work in this case ? |
You would also have to connect to that Proxy and download cached data from it so, there will be no real advantage from such a possibility.
Regards,
plusminus _________________
Download my apps  Please remember, that this board is give & take 
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
glider Freshman

Joined: 03 Jan 2008 Posts: 4
|
Posted: Thu Jan 10, 2008 12:54 pm Post subject: |
|
|
Well, you could always run a proxy ON the handheld itself to cache the data ?
(are there any lightweight java proxies around ?)
| plusminus wrote: | | glider wrote: | | Maybe if android use a http proxy ? Would that work in this case ? |
You would also have to connect to that Proxy and download cached data from it so, there will be no real advantage from such a possibility.
Regards,
plusminus |
|
|
| Back to top |
|
 |
crayder Freshman

Joined: 04 Feb 2008 Posts: 9
|
Posted: Mon Feb 04, 2008 1:02 am Post subject: activity vs subactivity |
|
|
| Hi! I have a question according the activity running. If I am not mistaking all the activities can be run as subactivities and simply activities. I can't understand in what cases we need to use these two different methods... Could you please point me some materials where this topic is described? |
|
| Back to top |
|
 |
plusminus Site Admin


Joined: 14 Nov 2007 Posts: 2624 Location: College Park, MD
|
Posted: Mon Feb 04, 2008 1:54 am Post subject: |
|
|
Hello crayder,
you can put a RequestCode to a startSubActivity(...); which you cannot put to startActivity(...);. SubActivities are very useful if you want to return values from them (i.e. an InputBox). To do that you'll overwrite onActivityResult(...) where is a parameter "requestCode" which is used to determine which SubActivity actually is returning.(The requestCode is the same as you called startSubActivity(...); with).
Regards,
plusminus _________________
Download my apps  Please remember, that this board is give & take 
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
crayder Freshman

Joined: 04 Feb 2008 Posts: 9
|
Posted: Mon Feb 04, 2008 11:06 pm Post subject: |
|
|
Hm.. Now am understanding... May be if we present application (activities) like a tree then it'll be logically to start activities that are the leaves as subactivities.. May be ))) Nevertheless thank you for the help  |
|
| Back to top |
|
 |
plusminus Site Admin


Joined: 14 Nov 2007 Posts: 2624 Location: College Park, MD
|
Posted: Mon Feb 04, 2008 11:36 pm Post subject: |
|
|
Hello crayder,
yes a tree is what it allover looks like, (ok we could link branches of the tree). But we only can go linear, because only one Activity is on the top every time (Remember Activity-Stack )
So we have something like a chain of dialogs, with some A/B-Decisions (tree style) the what results in a path within the tree.
This works really fine, I'm currently doing it with my [http://www.anddev.org/viewtopic.php?t=740]AndNav[/url]-Application. Everything starts at the tree-root, the menu. To proceed to the Country,(ZipCode or CityName) ,Streetname-Activities, I call a chain of SubActivities after every part of the chain. Doing that it is very easy to go just one step back or, to go back to the Menu-Activity, by chaining the Activities like this:
ActivityC.finish() ActivityB.onActivityResult() ActivityB.finish() ActivityA.onActivityResult() ActivityA.finish() MenuActivity
I hope I didn't confuse you
Regards,
plusminus _________________
Download my apps  Please remember, that this board is give & take 
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
crayder Freshman

Joined: 04 Feb 2008 Posts: 9
|
Posted: Tue Feb 05, 2008 10:22 pm Post subject: |
|
|
Wau )))
May be you are cheating? I think you are not a student - you are a teacher! ))))))
Thank you for very good explanation! |
|
| Back to top |
|
 |
|