andbook!.pdf - Learning Android Get an anddev.org - Android-Shirt Back to index
anddev.org Header Logo
FAQ Search Top rated articles Browse Feeds anddev.org - Authors Contact Details Register Log in

The Friend Finder - MapActivity using GPS - FULL SOURCE

Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
       anddev.org - Android Development Community | Android Tutorials | Index -> Map Tutorials
Author Message
Marchu
Junior Developer
Junior Developer


Joined: 27 Sep 2008
Posts: 19
Location: Netherlands

PostPosted: Sun Sep 28, 2008 7:43 pm    Post subject: Source for 1.0 SDK Reply with quote

After some hard strugling with the code, i managed to get it work with the 1.0 SDK.
There are so many changes with the 1.0 SDK, and so less demo's and examples, that the most work was trial and error . (for almost 24 hours)
I just started with figuring out Android, so it was a nice learning curve Smile

There are many changes in the code but not in the main performance, and i have left (offcourse) the comments from plusminus in place.
This to give a idea what the code is doing.

The most changes are syntax changes, eq. zoomTo is now setZoom, menu.Item is now MenuItem, etc. (to give a idea)

Also changes to calculate the pixels on screen, from a Geopoint is totaly changed.
In the old demo they use CalculatePixels, what was a special thing for this. Now this is done by:
Java:

mapView.getProjection().toPixels(point,myScreenCoords);


Youre own location will now also be always in the center if you zoom in and out.

There's are more new things with 1.0, but i think the most is clear after seeing the code.

p.s. Don't forget for the first time, to set youre location thruw geo fix (telnet)
For the new ones on how to do that.
- Open a console
- type: telnet localhost 5554
(this connects to the simulator on port 5554, to simulate things)
- type: geo fix -121.45356 46.51119 4392
(or any other location with a longitude latitude height)

tip to get your own geo location:
http://www.mygeoposition.com/

Thats it, happy programming Razz

Cheers



FriendFinder_v10SDK.rar
 Description:
Remake code for 1.0 SDK

Download
 Filename:  FriendFinder_v10SDK.rar
 Filesize:  65.31 KB
 Downloaded:  480 Time(s)



Last edited by Marchu on Mon Oct 20, 2008 12:10 am; edited 1 time in total
Back to top
View user's profile Send private message
ninor
Moderator
Moderator


Joined: 14 Aug 2008
Posts: 179
Location: Barcelona, Spain

PostPosted: Sun Sep 28, 2008 8:58 pm    Post subject: Reply with quote

Good job, Marchu!
Thank you very much for taking your time updating this example
Back to top
View user's profile Send private message
plusminus
Site Admin
Site Admin


Joined: 14 Nov 2007
Posts: 2624
Location: College Park, MD

PostPosted: Mon Sep 29, 2008 2:00 am    Post subject: Reply with quote

Really nice Marchu. I've put link to your post to the beginning of this topic.

Best Regards,
plusminus

_________________
Download my apps Idea
Please remember, that this board is give & take Smile

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
William Wen
Freshman
Freshman


Joined: 23 Sep 2008
Posts: 9

PostPosted: Sat Oct 11, 2008 5:24 pm    Post subject: Reply with quote

Really appreciate your job, Marchu!
And the following permissions have been removed in SDK1.0:
XML:
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION"
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />

<uses-permission android:name="android.permission.ACCESS_CELL_ID" />

_________________
William Wen
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
eviesun
Once Poster
Once Poster


Joined: 18 Oct 2008
Posts: 1

PostPosted: Sat Oct 18, 2008 5:32 am    Post subject: Re: Source for 1.0 SDK Reply with quote

Hi, Machu,

I downloaded your code. but after i typed the FriendFinder icon on the main screen, it has the following run time exception. Seems it is rooted from the Android SDK.
The emulator says ".friendfinder has stopped unexpectedly...."


I am totally fresh to Android.. Can u help me to figure out what the problem is? thanks a lot.



exception.jpg
 Description:
 Filesize:  32.83 KB
 Viewed:  1554 Time(s)

exception.jpg


Back to top
View user's profile Send private message
Paranoid
Freshman
Freshman


Joined: 19 Oct 2008
Posts: 7

PostPosted: Sun Oct 19, 2008 5:12 pm    Post subject: Reply with quote

I'm getting the same error Sad
Back to top
View user's profile Send private message
Bruce.lntu
Developer
Developer


Joined: 03 Jan 2008
Posts: 36

PostPosted: Wed Oct 22, 2008 9:22 am    Post subject: Reply with quote

Hi Marchu,

I downloaded the codes and it worked, but only worked as below:

My question is: why can not find the menu of adding contacts? or any other fountions?

the whole running showed no error. this really confused me. pls tell us where the problems happend. thank you.

regards
Bruce



3.jpg
 Description:
my location is only displayed in the red ellipse.
 Filesize:  64.3 KB
 Viewed:  1399 Time(s)

3.jpg



2.jpg
 Description:
when the map display, then press the MENU
 Filesize:  22.92 KB
 Viewed:  1399 Time(s)

2.jpg



1.jpg
 Description:
when press the "menu"
 Filesize:  9.93 KB
 Viewed:  1399 Time(s)

1.jpg


Back to top
View user's profile Send private message
Bruce.lntu
Developer
Developer


Joined: 03 Jan 2008
Posts: 36

PostPosted: Thu Oct 23, 2008 9:30 am    Post subject: Reply with quote

after adding contacts following the FriendFinder 1, still can not find the friend's location with only "Me"and round dot. somebody tell us why?
Back to top
View user's profile Send private message
Bruce.lntu
Developer
Developer


Joined: 03 Jan 2008
Posts: 36

PostPosted: Thu Oct 23, 2008 12:26 pm    Post subject: Reply with quote

plusminus wrote:
Hello venkat,

it is displaying the list of your friends but you seem to have forgotten to set the "geo"-URI.

You go to the actual Map using the Menu-Button on the emulator. It starts the Map-Activity that show you (and your contacts/friends if you properly set the geo-URI to their notes, as shown in the first Part of the Tutorial)
This is the code taklen from above, that opens the MapActivity:
Java:
@Override
     public boolean onCreateOptionsMenu(Menu menu) {
          boolean supRetVal = super.onCreateOptionsMenu(menu);
          menu.add(0, 0, getString(R.string.main_menu_open_map));
          return supRetVal;
     }
     @Override
     public boolean onOptionsItemSelected(Menu.Item item) {
          switch (item.getId()) {
               case 0:
                    startSubActivity(new Intent(this, FriendFinderMap.class), 0);
                    return true;
          }
          return false;
     }


You will at least see yourself on the Map Exclamation

Please tell us if that fixed it Question

Regards,
plusminus

Regards,
plusminus


I also got the same problem as the screem shot are below:
please plusminus tell us where is the real problem. thank you ,it really cost me so much time looking for the error.



shot000.jpg
 Description:
set the geo
 Filesize:  19.5 KB
 Viewed:  1354 Time(s)

shot000.jpg



shot002.jpg
 Description:
not set km?
 Filesize:  15.08 KB
 Viewed:  1354 Time(s)

shot002.jpg



shot004.jpg
 Description:
"me" is in the red circle
 Filesize:  24.83 KB
 Viewed:  1354 Time(s)

shot004.jpg


Back to top
View user's profile Send private message
wongstar.iac
Junior Developer
Junior Developer


Joined: 23 Oct 2008
Posts: 10

PostPosted: Tue Oct 28, 2008 4:04 am    Post subject: Re: The Friend Finder - MapActivity using GPS - FULL SOURCE Reply with quote

when I run sample ap about maps there is a error:

Does anyone understand the error "Couldn't get connection factory
client" ? I have the same error in my app.

Thanks for help.
Back to top
View user's profile Send private message
java.padawan
Freshman
Freshman


Joined: 27 Oct 2008
Posts: 4

PostPosted: Tue Oct 28, 2008 11:09 am    Post subject: Re: The Friend Finder - MapActivity using GPS - FULL SOURCE Reply with quote

wongstar.iac wrote:
when I run sample ap about maps there is a error:

Does anyone understand the error "Couldn't get connection factory
client" ? I have the same error in my app.

Thanks for help.


try this.
http://www.androidph.com/2008/10/android-map-viewer.html
Back to top
View user's profile Send private message Visit poster's website
mschot
Freshman
Freshman


Joined: 29 Oct 2008
Posts: 3

PostPosted: Wed Oct 29, 2008 9:56 pm    Post subject: problem with override Reply with quote

Hi Everyone,

Tried compiling the code but eclipse cant compile as there are errors it seems that the methods in the myLocationListener the cant override the LocationListener methods as eclipse giver the following error(s):

-The method onProviderDisabled(String) of type FriendFinder.myLocationListener must override a superclass method
- implements android.location.LocationListener.onProviderDisabled

I'm kind of a newbie at android and would appreciate any help.

thanks in advance.

mschot
Back to top
View user's profile Send private message
mschot
Freshman
Freshman


Joined: 29 Oct 2008
Posts: 3

PostPosted: Sun Nov 02, 2008 6:03 pm    Post subject: Re: The Friend Finder - MapActivity using GPS - FULL SOURCE Reply with quote

managed to compile it now by commenting the overrides...

wongstar.iac wrote:
when I run sample ap about maps there is a error:

Does anyone understand the error "Couldn't get connection factory
client" ? I have the same error in my app.

Thanks for help.


go to line 214 in FriendFinderMap.java and replace "key?" with your api key in:

Java:
this.myMapView = new MapView(this, "key?");
Back to top
View user's profile Send private message
wongstar.iac
Junior Developer
Junior Developer


Joined: 23 Oct 2008
Posts: 10

PostPosted: Mon Nov 03, 2008 10:20 am    Post subject: Reply with quote

Bruce.lntu wrote:
Hi Marchu,

I downloaded the codes and it worked, but only worked as below:

My question is: why can not find the menu of adding contacts? or any other fountions?

the whole running showed no error. this really confused me. pls tell us where the problems happend. thank you.

regards
Bruce

hi, I have the same picture with you ? what's wrong?
I also havn't the menu of adding contacts! help me !
thank you!
Back to top
View user's profile Send private message
wongstar.iac
Junior Developer
Junior Developer


Joined: 23 Oct 2008
Posts: 10

PostPosted: Mon Nov 03, 2008 10:23 am    Post subject: Re: The Friend Finder - MapActivity using GPS - FULL SOURCE Reply with quote

mschot wrote:
managed to compile it now by commenting the overrides...

wongstar.iac wrote:
when I run sample ap about maps there is a error:

Does anyone understand the error "Couldn't get connection factory
client" ? I have the same error in my app.

Thanks for help.


go to line 214 in FriendFinderMap.java and replace "key?" with your api key in:

Java:
this.myMapView = new MapView(this, "key?");

thank you ,the error is my apikey is wrong! thank you now I can run ! but there are also have some question!
first , I havn't a menu contact
Back to top
View user's profile Send private message
Display posts from previous:   
       anddev.org - Android Development Community | Android Tutorials | Index -> Map Tutorials All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 6 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


© 2007, Android Development Community
All rights reserved.
Powered by phpBB.