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

Mock LocationProvider - Structure/Explanation (NMEA, $GPRMC)

Goto page Previous  1, 2
 
       anddev.org - Android Development Community | Android Tutorials | Index -> Map Tutorials
Author Message
plusminus
Site Admin
Site Admin


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

PostPosted: Sun Mar 09, 2008 12:47 pm    Post subject: Reply with quote

Hello zoe,

did you also try pushing the file via console/terminal Question

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
zoe11
Freshman
Freshman


Joined: 25 Feb 2008
Posts: 5
Location: Indonesia

PostPosted: Sun Mar 09, 2008 5:35 pm    Post subject: still not working..!!! Reply with quote

yes, i already do that too but i always failed to push the $GPRMC?!?
I already succeded to push the nmea($GPRMC for jakarta route) file into emulator via adb but the ME location always point somewhere around india and not jakarta despite how many times i restart the emulator.....
Back to top
View user's profile Send private message Send e-mail
plusminus
Site Admin
Site Admin


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

PostPosted: Mon Mar 10, 2008 12:18 am    Post subject: Reply with quote

Hello zoe,

so it almost worked Wink
Its sounds like you have an error in your GPRMC-route, as the "result" is pretty close.

I attached a working KML-route for Germany. (From "Schriesheim" to "Dossenheim").
Give it a try.

Regards,
plusmunus



kml.zip
 Description:
KML-Route Germany (Schriesheim to Dossenheim)

Download
 Filename:  kml.zip
 Filesize:  2.04 KB
 Downloaded:  397 Time(s)


_________________
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
rawad00
Once Poster
Once Poster


Joined: 22 Feb 2008
Posts: 1
Location: France

PostPosted: Tue Apr 15, 2008 9:58 am    Post subject: Your GPRMC checksum doesn't work, try this one Reply with quote

Your GPRMC checksum doesn't work, try this one
Try it , and compare the results....with the one you gave and the $GPRMC sentence examples you gave...

Java:
public String checkSum(String sentence){
       //Sentence between $ and *
        String message = (String) sentence.subSequence(sentence.indexOf('$')+1, sentence.indexOf('*'));
         
            int checksum = 0;
            for(int i = 0; i < message.length(); i++){

                checksum ^= (byte) message.charAt(i);
            }

            return Integer.toHexString(checksum).toUpperCase();

    }

_________________
!! R@w@d !!
Back to top
View user's profile Send private message
nithin.warier
Experienced Developer
Experienced Developer


Joined: 28 Feb 2008
Posts: 85
Location: Malappuram Kerala India

PostPosted: Mon May 05, 2008 5:55 am    Post subject: Reply with quote

hi plusminus,
i am creating a mock location provider for Chennai (India). I created few sentences in nmea file, the locations file and properties file. But i came across one problem .

1. In the getCheckSum(String sentence) function, how can we get the sentence.
2. using push, shall we can push the folder(test1) to eclipse.

please reply immeadiately,

Thanks
Nithin
Back to top
View user's profile Send private message Visit poster's website
plusminus
Site Admin
Site Admin


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

PostPosted: Tue May 06, 2008 8:41 pm    Post subject: Reply with quote

Hello nithin.warier,

I strongly suggest using kml Exclamation

If you choose kml its a job of minutes Exclamation
You'll find info on how to set up a route using kml here on anddev.

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
nithin.warier
Experienced Developer
Experienced Developer


Joined: 28 Feb 2008
Posts: 85
Location: Malappuram Kerala India

PostPosted: Wed May 07, 2008 5:03 am    Post subject: Reply with quote

Thanks plusminus,

i used kml file and its working..

thank you very much, anddev is helping me a lot..
Back to top
View user's profile Send private message Visit poster's website
plusminus
Site Admin
Site Admin


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

PostPosted: Wed May 07, 2008 7:43 pm    Post subject: Reply with quote

nithin.warier wrote:
Thanks plusminus,

i used kml file and its working..

thank you very much, anddev is helping me a lot..


Thats always nice to hear Smile

_________________
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
aziziti
Freshman
Freshman


Joined: 27 Apr 2009
Posts: 8

PostPosted: Thu May 07, 2009 6:14 pm    Post subject: Reply with quote

Hi everyone, I am using the new 1.5 SDK and I am trying to extract NMEA files but I failed:
I tried to do this:

Code:
C:\AndroidSDK\tools>adb pull data/misc/location/gps/nmea C:\Android


and I got this error:
remote object 'data/misc/location/gps/nmea' does not exist

I am thinking that there is no such folder location.

Please Help me!
Back to top
View user's profile Send private message
Leonard
Freshman
Freshman


Joined: 18 May 2009
Posts: 6
Location: Munich, DE

PostPosted: Tue Jun 02, 2009 1:48 pm    Post subject: Reply with quote

@aziziti: that method is indeed obsolete since SDK 1.5 Check out the location dev guide.

@all: I tried out plusminus's KML route in Germany. When I try to play it in DDMS, an icon shows up at the inital point but never moves, and after a while it simply disappears. Pressing play again doesn't help at all. I was following the tutorial from Andreas Frey's blog. Also, when I'm sending single GPS fixes, it works for 2 or 3 times n then just stops doing anything...I find this behaviour pretty strange.

EDIT: OK, so I did some debugging on the matter: I can only provide a location twice, either through DDMS or telnet. The onStatusChanged method returns gps as available. The icon shows up when I send the first location, moves when I send the second location. When I send a location for the third time, nothing happens. The onLocationChanged method isn’t called, neither are any other locationListener methods - gps isn’t reported to be unavailable or anything. MapActivity reports an error as soon as our Activity is started, saying “Couldn’t get connection factory client”.

Andreas's code works fine because it behaved like expected when I provided fake location coordinates from a simple array.
Any ideas what this might be???
Back to top
View user's profile Send private message
midou55
Freshman
Freshman


Joined: 18 Nov 2009
Posts: 3

PostPosted: Tue Jan 12, 2010 11:20 am    Post subject: about mock location provier Reply with quote

Hello, i have cread a location provider that reads kml files and sends points , this works fine. so i can generate paths as i want and inject them inside sdcard.
Now the probelm is that when testing on real device i get the error below :

01-12 11:00:35.280: ERROR/AndroidRuntime(717): Caused by: java.lang.SecurityException: Requires ACCESS_MOCK_LOCATION secure setting

any idea
Back to top
View user's profile Send private message
fkizewski
Freshman
Freshman


Joined: 16 Dec 2009
Posts: 2
Location: France

PostPosted: Mon Feb 22, 2010 4:14 pm    Post subject: Reply with quote

Hi all,

I've added this at the end of the function in JAVA
Java:

String toReturn = Integer.toHexString(checksum);
if(toReturn.length() < 2)
     toReturn = "0" + toReturn;
// Return the checksum formatted as a two-character hexadecimal
return toReturn.toUpperCase();


Because before i've a cheksum : *e than *0E (that's better for me) - Example : $GPRMC,173725.000,A,5022.1274,N,304.5536,N,0.485963,311.1328,180210,,*0E

By

_________________
Visit Kinomap.com!
Back to top
View user's profile Send private message Visit poster's website
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
Page 2 of 2

 
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.