The Friend Finder - MapActivity using GPS - FULL SOURCE

Tutorials that use the MapActivity. Many using GPS functionality.

Postby theseum » Sat Feb 23, 2008 12:36 am

Why is the custom intent reciever / filter in the java sources instead of in manifest.xml? I'm not sure I quite understand how manifest.xml works...

Thanks!
theseum
Once Poster
Once Poster
 
Posts: 1
Joined: Sat Feb 23, 2008 12:34 am

Top

Postby plusminus » Sat Feb 23, 2008 12:00 pm

Hello theseum,

it is placed inside the java-code because we are listening for "internal events" only.

One usually creates an IntentReceiver-Class and places it to the AndroidManifest.xml, if we need to listen for anything else than our own app.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby crayder » Sat Feb 23, 2008 10:32 pm

Hey, guys!
I have one question... according the working of this application on the real devices. Don't you think that attempt to retrieve device location can last much time (gps turning on, satellite communication and so on..). This can lead to the situation that GUI process will be blocked and that user will receive message with prompt to kill this process. What do you think about this?
crayder
Freshman
Freshman
 
Posts: 9
Joined: Mon Feb 04, 2008 12:35 am

can't run friendfinder with m5 for windows xp

Postby zoe11 » Mon Feb 25, 2008 7:33 am

plusminus please help..!!!i can't run friendfinder program with new android sdk for windows xp, i use eclipse.
R.java won't auto update and there is many error
zoe11
Freshman
Freshman
 
Posts: 5
Joined: Mon Feb 25, 2008 7:26 am
Location: Indonesia

Postby plusminus » Mon Feb 25, 2008 9:47 am

Hello zoe,

what exactly is your problem (are you sure it is just updating?).

I know, a non updating R.java can freak one out!
Some succeed in turning off "Build Automatically" and Build manually.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

already solve the problem

Postby zoe11 » Mon Feb 25, 2008 5:03 pm

many thanks for your hint plusminus!!now i alrweady solve the R.java problem and the error on xml file :)
plusminus i need your help on how to push my nmea into android emulator??so i can have my own mock-providers in jakarta coz SF is to far.
i already have my $GPRMC route but i'm clueless on how to make it work in android emulator so i can change the ME location in friendfinder app
zoe11
Freshman
Freshman
 
Posts: 5
Joined: Mon Feb 25, 2008 7:26 am
Location: Indonesia

Top

Postby plusminus » Tue Feb 26, 2008 7:55 pm

Hello zoe,

Its probably not more than exchanging the "nmea"-file on the emulator.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby kleach » Wed Feb 27, 2008 12:54 am

I get an error in AndroidManifest.xml in M5? on this line...


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.         <activity class=".FriendFinder" android:label="@string/main_title">
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


Error is: Tag <activity> missing required attribute name.

I used the .zip file and added

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.     <uses-permission android:name="android.permission.ACCESS_LOCATION"/>
  2.  
  3.     <uses-permission android:name="android.permission.ACCESS_GPS"/>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


to the file

I don't get it...
suggestions?

-Ken
kleach
Freshman
Freshman
 
Posts: 3
Joined: Wed Jan 16, 2008 9:30 pm

Security Exception

Postby gvkreddyvamsi » Wed Feb 27, 2008 6:02 am

HI,

I have loaded friend finder application.

Rectified errors in it.

But i got security Exception....

These permissions already added in manifest file..
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2.  
  3.  
  4.     <uses-permission id="android.permission.READ_CONTACTS"/>
  5.  
  6.     <uses-permission id="android.permission.CALL_PHONE"/>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4



Screen shot is loaded


by
vamsi
Attachments
and.PNG
FriendFinder
and.PNG (46.58 KiB) Viewed 7145 times
gvkreddyvamsi
Developer
Developer
 
Posts: 43
Joined: Mon Jan 21, 2008 5:10 am
Location: INDIA

Postby plusminus » Wed Feb 27, 2008 10:53 am

Hello vamsi,

since m5 it is also "[font=Courier New]android:name[/font]" instead of "[font=Courier New]id[/font]", like this:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.     <uses-permission android:name="android.permission.READ_CONTACTS"/>
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Ramakrishna » Mon Mar 03, 2008 12:20 pm

I am also facing the same problem while running FriendFinder application in M5... It is running perfectly fine with M3.
I changed the required things in "AndroidManifest.xml" but still it is giving the error attached :( .
Please help !
Attachments
error.JPG
error.JPG (31.05 KiB) Viewed 7030 times
Ramakrishna
Freshman
Freshman
 
Posts: 2
Joined: Mon Dec 10, 2007 10:28 am

Postby plusminus » Tue Mar 04, 2008 7:14 pm

Hello Ramakrishna,

it would be helpful, if you debug and post the line, where the exception is thrown.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby aaronsu » Thu Mar 06, 2008 3:32 am

hi plusminus

i have got the same exception and i found it was thrown at

LocationProvider provider = providers.get(0);

because of the providers's size = 0

you should add the permission into manifest file

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <uses-permission android:name="android.permission.ACCESS_LOCATION"/>
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


then workable ~~ :D

aaron))))
User avatar
aaronsu
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Mar 06, 2008 3:05 am
Location: Taiwan

Postby plusminus » Fri Mar 07, 2008 12:54 am

Hello aaron,

thanks for you suggestion. (this tut was mad for sdk-version m3)

In m5 I'm currently using:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. LocationProvider provider = this.myLocationManager.getProvider("gps");
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby pavanch » Fri Mar 07, 2008 7:44 pm

hello

I am running on the new emulator/sdk. Everything works from the code you pasted above with the
changes suggested in the comments section. But it still doesnt show me the distance in my display.

It says, 'distance not set'. I think i know the reason partly..as in the new emulator and GUI it doesnt give
me an option to add notes directly for a contact or more clearly there is no field called 'Notes' for
a contact.
To add something like a 'Notes' field, i need to add a new label and name it to 'Notes'.

So there is not direct URI/(constant like People.NAME etc) from which i can extract the geo string from a contact.

Have you played around with the new emulator and tried out this app?.

Like i said, i am only guessing..so if there is something i missed here, do let me know.

Thanks

Pavan
Attachments
default new contact layout.JPG
New GUI for adding a contact on new emulator. I didnt find a notes field here
default new contact layout.JPG (36.26 KiB) Viewed 6913 times
label for adding an address.JPG
This is where i created a custom label called 'Notes' and added the geo string
label for adding an address.JPG (34.35 KiB) Viewed 6913 times
pavanch
Freshman
Freshman
 
Posts: 2
Joined: Fri Mar 07, 2008 7:15 pm

Top
PreviousNext

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests