The Friend Finder - MapActivity using GPS - FULL SOURCE

Tutorials that use the MapActivity. Many using GPS functionality.

Postby avolovoy » Thu Dec 18, 2008 6:25 am

yorgosg wrote:Hi

I have downloaded version 1.0 of the friendfinder. I had some trouble with the location getting null value at first, but then I replaced the code, with the code kSara suggested (only this worked, I tried everything else and nothing happenned):

//boolean gpsEnabled = myLocationManager.isProviderEnabled("gps");
//this.myLocation.setProvider("gps");

this.myLocation = new Location("gps");
this.myLocation.setLongitude( 46.51119 );
this.myLocation.setLatitude(-121.45356);

now the contacts I have, along with the distances appear normally.
However, when I press the menu button and then the "open visual friendtracker". the following error occurs:

Any ideas?? any help will be appreciated!

MapAPI key seems to me.
Alexey Volovoy
Bytesharp.NET
User avatar
avolovoy
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Nov 03, 2008 10:32 pm
Location: kansas

Top

Postby sitara » Thu Dec 18, 2008 9:16 am

Hi, do you also know what does the error below mean?
i am getting this error as well..
thanks..

[2008-12-18 15:21:51 - DeviceMonitor]Error reading jdwp list: EOF
[2008-12-18 15:21:51 - DeviceMonitor]Connection Failure when starting to monitor device 'emulator-5554' : device (emulator-5554) request rejected: device not found


Sitara
sitara
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Nov 27, 2008 8:27 am

Postby yorgosg » Thu Dec 18, 2008 10:59 am

avolovoy wrote:
yorgosg wrote:Hi

I have downloaded version 1.0 of the friendfinder. I had some trouble with the location getting null value at first, but then I replaced the code, with the code kSara suggested (only this worked, I tried everything else and nothing happenned):

//boolean gpsEnabled = myLocationManager.isProviderEnabled("gps");
//this.myLocation.setProvider("gps");

this.myLocation = new Location("gps");
this.myLocation.setLongitude( 46.51119 );
this.myLocation.setLatitude(-121.45356);

now the contacts I have, along with the distances appear normally.
However, when I press the menu button and then the "open visual friendtracker". the following error occurs:

Any ideas?? any help will be appreciated!

MapAPI key seems to me.


Thank you very much for replying. However, I found on other threads that this http://www.anddev.org/viewtopic.php?p=12271 is what is shown on screen, when it is the MapApi key issue. On my screen, on the other hand, an error occurs. I will try your suggestion anyway, i just wanted to let you know, thanks again
yorgosg
Developer
Developer
 
Posts: 35
Joined: Wed Jan 30, 2008 9:53 am

Postby yorgosg » Fri Dec 19, 2008 2:35 am

yorgosg wrote:
avolovoy wrote:
yorgosg wrote:Hi

I have downloaded version 1.0 of the friendfinder. I had some trouble with the location getting null value at first, but then I replaced the code, with the code kSara suggested (only this worked, I tried everything else and nothing happenned):

//boolean gpsEnabled = myLocationManager.isProviderEnabled("gps");
//this.myLocation.setProvider("gps");

this.myLocation = new Location("gps");
this.myLocation.setLongitude( 46.51119 );
this.myLocation.setLatitude(-121.45356);

now the contacts I have, along with the distances appear normally.
However, when I press the menu button and then the "open visual friendtracker". the following error occurs:

Any ideas?? any help will be appreciated!

MapAPI key seems to me.


Thank you very much for replying. However, I found on other threads that this http://www.anddev.org/viewtopic.php?p=12271 is what is shown on screen, when it is the MapApi key issue. On my screen, on the other hand, an error occurs. I will try your suggestion anyway, i just wanted to let you know, thanks again


Yes, it wasn't the MapAPI key..I did what plusminus says on another thread about the MapAPI key and I got registered for usage with google maps. However, I still get this error, when I press the "open visual friendtracker" on the menu. Did anyone else come across this??

I tried to debug and go line by line, and after I click on this, after finishing the onOptionsItemSelected() method, Please let me know if you have any ideas!!

cheers!!
yorgosg
Developer
Developer
 
Posts: 35
Joined: Wed Jan 30, 2008 9:53 am

Postby avolovoy » Fri Dec 19, 2008 5:23 am

did you get your MapAPI for real keystore or for debug ?
Alexey Volovoy
Bytesharp.NET
User avatar
avolovoy
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Nov 03, 2008 10:32 pm
Location: kansas

Postby yorgosg » Fri Dec 19, 2008 9:13 am

thanks for your reply..

well, i did the following:

C:>D:\Programme\dev\Java\jdk1.6.0_07\bin\keytool -list -alias androiddebugkey -keystore C:\Users\plusminus\AppData\Local\Android\debug.keystore -storepass android -keypass android
androiddebugkey, 13.10.2008, PrivateKeyEntry,
Zertifikatsfingerabdruck (MD5): E1:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:BC

i guess that's for debug..
yorgosg
Developer
Developer
 
Posts: 35
Joined: Wed Jan 30, 2008 9:53 am

Top

Postby sitara » Fri Dec 19, 2008 10:01 am

HI i have got the google map appearing finally..
how do i enter contacts into the emulator?
sitara
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Nov 27, 2008 8:27 am

Postby yorgosg » Fri Dec 19, 2008 10:45 am

sitara wrote:HI i have got the google map appearing finally..
how do i enter contacts into the emulator?


Hi, from the main menu, you need to click on Contacts and then click on menu to add contact.
yorgosg
Developer
Developer
 
Posts: 35
Joined: Wed Jan 30, 2008 9:53 am

Postby avolovoy » Fri Dec 19, 2008 2:57 pm

yorgosg wrote:thanks for your reply..

well, i did the following:

C:>D:\Programme\dev\Java\jdk1.6.0_07\bin\keytool -list -alias androiddebugkey -keystore C:\Users\plusminus\AppData\Local\Android\debug.keystore -storepass android -keypass android
androiddebugkey, 13.10.2008, PrivateKeyEntry,
Zertifikatsfingerabdruck (MD5): E1:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:BC

i guess that's for debug..

i wish i can replicate the problem. I've seen something like you're seeing when I loaded mapview app in emulator and forgot to swap my map api strings.
Yes, this MD5 is for debug and it should work, assuming that after of what you've posted, you went to google and got the key for that.
May be you can search for answers in the console log . Give us your errors....
Alexey Volovoy
Bytesharp.NET
User avatar
avolovoy
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Nov 03, 2008 10:32 pm
Location: kansas

Postby avolovoy » Sat Dec 20, 2008 8:43 pm

yorgosg wrote:thanks for your reply..

well, i did the following:

C:>D:\Programme\dev\Java\jdk1.6.0_07\bin\keytool -list -alias androiddebugkey -keystore C:\Users\plusminus\AppData\Local\Android\debug.keystore -storepass android -keypass android
androiddebugkey, 13.10.2008, PrivateKeyEntry,
Zertifikatsfingerabdruck (MD5): E1:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:BC

i guess that's for debug..

Hey, couple of things to check-

1) Is your GPS enabled ? Settings / Security & Location
2) List your permissions from the manifest .
Alexey Volovoy
Bytesharp.NET
User avatar
avolovoy
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Nov 03, 2008 10:32 pm
Location: kansas

Postby yorgosg » Sun Dec 21, 2008 12:43 pm

avolovoy wrote:
yorgosg wrote:thanks for your reply..

well, i did the following:

C:>D:\Programme\dev\Java\jdk1.6.0_07\bin\keytool -list -alias androiddebugkey -keystore C:\Users\plusminus\AppData\Local\Android\debug.keystore -storepass android -keypass android
androiddebugkey, 13.10.2008, PrivateKeyEntry,
Zertifikatsfingerabdruck (MD5): E1:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:BC

i guess that's for debug..

Hey, couple of things to check-

1) Is your GPS enabled ? Settings / Security & Location
2) List your permissions from the manifest .


Thank you very much avolovoy, I have resolved the error. It was actually stupid, I noticed that in the FriendFinderMap class it is setting the mylocation variable again, and for some strange reason the way it sets it, doesn't work; the mylocation variable remains null. That was the error..

Instead of

this.myLocation = myLocationManager.getLastKnownLocation("gps");

for me only the following works:

this.myLocation = new Location("gps");
this.myLocation.setLongitude( 46.51119 );
this.myLocation.setLatitude(-121.45356);

Thanks again!
yorgosg
Developer
Developer
 
Posts: 35
Joined: Wed Jan 30, 2008 9:53 am

Postby sitara » Mon Dec 22, 2008 7:48 am

Hi..can i also ask one more question?

i have got the google map up on my emulator..
how can i show my location in the map?


also what does the below means..? how do i set the km?
plzz help.. :(




Sitara
Attachments
notsetKM.JPG
notsetKM.JPG (28.62 KiB) Viewed 5661 times
sitara
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Nov 27, 2008 8:27 am

Postby Simple » Fri Jan 29, 2010 2:31 pm

Hi guyz why is the Poeple.NOTES deprecated in present API. No WAY to access notes now.
the
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. ContactsContract.CommonDataKinds.Note.NOTE
Parsed in 0.029 seconds, using GeSHi 1.0.8.4

gives nothing but -1 error in line
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  int notesColumn = c.getColumnIndex(ContactsContract.CommonDataKinds.Note.NOTE);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Simple
Freshman
Freshman
 
Posts: 4
Joined: Fri Jan 15, 2010 12:01 pm

maps

Postby SamAndroid » Fri Apr 16, 2010 12:26 pm

Hey plus minus!
I am working on google maps. May application works fine on emulator but when i load it on real device, map doesnt show up. All i can see is grey tiles. On forums, i read that the maps api key i generated from debug store wont work on real device. They say that replace debug.keystore file with your own key store file but i dint read anywhere how to generate my own keystore file. Please help me out.
Sam
SamAndroid
Junior Developer
Junior Developer
 
Posts: 11
Joined: Fri Apr 02, 2010 7:48 am
Location: Pakistan

Postby MorbidDestiny » Fri Apr 16, 2010 1:03 pm

Hi.

I've done the tutorial, but there's a problem. I don't know why, but the screen appears black instead of showing the map.

If I click on menu button, I can see the tab.

No error, not even if debugging.

I also tried the downloaded source code and it has the same problem.

Some help please...

(And before someone asks, yes, I have the correct ApiKey)
MorbidDestiny
Junior Developer
Junior Developer
 
Posts: 16
Joined: Fri Mar 26, 2010 4:56 pm

Top
PreviousNext

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests