Nav apps for android phones? - Page 3 - SailNet Community

   Search Sailnet:

 forums  store  


Quick Menu
Forums           
Articles          
Galleries        
Boat Reviews  
Classifieds     
Search SailNet 
Boat Search (new)

Shop the
SailNet Store
Anchor Locker
Boatbuilding & Repair
Charts
Clothing
Electrical
Electronics
Engine
Hatches and Portlights
Interior And Galley
Maintenance
Marine Electronics
Navigation
Other Items
Plumbing and Pumps
Rigging
Safety
Sailing Hardware
Trailer & Watersports
Clearance Items

Advertise Here






Go Back   SailNet Community > On Board > Gear & Maintenance > Electronics
 Not a Member? 
  #21  
Old 12-29-2009
Member
 
Join Date: Jun 2009
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 6
legarots is on a distinguished road
Any software engineer today that claims Java is slow is incompetent.
Reply With Quote Quick reply to this message Share with Facebook
  #22  
Old 12-29-2009
Sea Slacker
 
Join Date: Jan 2007
Posts: 1,789
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 8
brak is on a distinguished road
Quote:
Originally Posted by legarots View Post
Any software engineer today that claims Java is slow is incompetent.
I am a software engineer I am quite competent, thank you very much. I claim that many common processing tasks would execute considerably more slowly when implemented in Java as compared to the same tasks implemented in language compiled to native code (such as C or C++). I would say that, though generalizations are not my speciality, can be a basis for saying "Java is slow"

Would you like to place a bet, put your money where your mouth is, so to speak?

P.S. Although this does not really belong here, below is a very trivial test case. Allocate an array, fill with numbers, repeat.

C version.
Quote:
#include
#include

int main(int ac, char **av)
**
int len, *arr = NULL, rep, i, j;

len = atoi(av[1]);
rep = atoi(av[2]);

printf("Size: %d, reps: %d\n", len, rep);

arr = (int *)malloc(sizeof(int) * len);

for (j = 0; j < rep; ++j) **
for (i = 0; i < len; ++i) **
arr[i] = i + j;
}
}

free(arr);

return 0;
}
Java version (fairly literal copy, as you can see)
Quote:
public class Test
**

public static void main(String [] args)
**
int i, j, len, rep;

len = Integer.parseInt(args[0]);
rep = Integer.parseInt(args[1]);

System.out.printf("Size: %d, Reps: %d\n", len, rep);

int arr[] = new int[len];

for (j = 0; j < rep; ++j) **
for (i = 0; i < len; ++i) **
arr[i] = i + j;
}
}
}
}
Compile and run:
Quote:
> gcc -O2 -o test test.c
> javac Test.java
> time ./test 1000000 3000
Size: 1000000, reps: 3000

real 0m3.035s
user 0m2.990s
sys 0m0.028s
> time java Test 1000000 3000
Size: 1000000, Reps: 3000

real 0m8.427s
user 0m8.216s
sys 0m0.103s
Feel free to do it yourself Note the close to 3x time difference.
Pardon the poor formatting, quote tag does not seem to keep spaces and tabs.

Last edited by brak; 12-29-2009 at 06:55 PM.
Reply With Quote Quick reply to this message Share with Facebook
  #23  
Old 12-29-2009
pegasus1457's Avatar
Arf!
 
Join Date: Apr 2002
Location: Long Island NY
Posts: 609
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 13
pegasus1457 is on a distinguished road
Quote:
Originally Posted by sailingfool View Post
Not to be too picky, but I don't beleive your phone has GPS capabilities...I believe like the iphone it uses cell towers and/or wifi to locate itself, if its in an area with suitable signals, not GPS.
I don't mind your being picky but you are wrong.

The phone has both. When the GPS is turned off it reverts to the cell tower triangulation and shows it with a bloated circle of confusion. The GPS coords are accurate within 10 ft.
__________________
Fluctuat nec mergitur
Reply With Quote Quick reply to this message Share with Facebook
  #24  
Old 12-29-2009
Sea Slacker
 
Join Date: Jan 2007
Posts: 1,789
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 8
brak is on a distinguished road
Quote:
Originally Posted by pegasus1457 View Post
I don't mind your being picky but you are wrong.

The phone has both. When the GPS is turned off it reverts to the cell tower triangulation and shows it with a bloated circle of confusion. The GPS coords are accurate within 10 ft.
Actually, according to Wikipedia (and what I seem to recall from elsewhere) "The iPhone 3G and iPhone 3GS employ A-GPS". That's not quite a true GPS, though it's not triangulation either. However, A-GPS does not work if the phone is not talking to a tower (in fact, it needs to talk to a properly equipped/connected tower). As far as I understand, A-GPS (assisted gps) receives satellite signals directly to the device. However, rather than processing these signals on the device, it forwards them to the special network server which does the actual calculations and then returns the location back to the device. So the current iPhone 3G will not provide GPS functionality when not connected to the network, presumably.

(Interesting, I never tested that - will try later today)
Reply With Quote Quick reply to this message Share with Facebook
  #25  
Old 12-29-2009
pegasus1457's Avatar
Arf!
 
Join Date: Apr 2002
Location: Long Island NY
Posts: 609
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 13
pegasus1457 is on a distinguished road
Nav app for android

I have been active in a thread on anything-sailing.com, on this subject, which I will summarize:

There is an app (Orux Maps) for the android platform that displays your GPS location on a raster-scanned chart. The quality of the chart rendering is acceptable, and entering waypoints is possible, but the app has no way to lay down a route. [The developer is a hiker!]

The raster scanned charts are available at no cost from NOAA, but they have to be chewed up and recast as little morsels that can be downloaded to and displayed on the mobile device screen.
  • The developer of Orux Maps has a desktop utility that will take you part of the way. You need to start with a calibration file (.map) and an extracted raster-scan graphic file (.jpg or .png).
  • I have developed code which bridges this gap: it starts with the BSB files from NOAA and generates the .map and .png files.
  • It runs on a MacOS desktop or in a cygwin (unix-like) environment on Windows machine.
[If someone has a Windows development toolset for C, the source files are posted as noted in the thread cited above; if you want to build a Windows app it would be a service to many in this community.]

For more details see the thread on Anything Sailing Forum
http://www.anything-sailing.com/look...6665#post66665
__________________
Fluctuat nec mergitur
Reply With Quote Quick reply to this message Share with Facebook
  #26  
Old 12-29-2009
pegasus1457's Avatar
Arf!
 
Join Date: Apr 2002
Location: Long Island NY
Posts: 609
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 13
pegasus1457 is on a distinguished road
Quote:
Originally Posted by brak View Post
So the current iPhone 3G will not provide GPS functionality when not connected to the network, presumably.

(Interesting, I never tested that - will try later today)
I will be taking my phone to Europe next month, where there is no Verizon-compatible service. I will check out the GPS behavior and get back with a report.
__________________
Fluctuat nec mergitur
Reply With Quote Quick reply to this message Share with Facebook
  #27  
Old 12-29-2009
pegasus1457's Avatar
Arf!
 
Join Date: Apr 2002
Location: Long Island NY
Posts: 609
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 13
pegasus1457 is on a distinguished road
Quote:
Originally Posted by brak View Post
Feel free to do it yourself Note the close to 3x time difference.
Never could pass up a challenge.

On my machine (MacOS 10.6.2, 2.4 GHz Intel Core 2 Duo, 2GB 667 MHz DDR2) I get completely different results from yours:

pegasus2:~/test_java] mjl% time test 1000000 3000
Size: 1000000, reps: 3000
2.686u 0.006s 0:02.69 99.6% 0+0k 0+0io 0pf+0w


mjl% time java Test 1000000 3000
Size: 1000000, Reps: 3000
3.106u 0.065s 0:03.16 100.0% 0+0k 1+7io 0pf+0w

I get only slightly slower execution in java than in compiled C.
__________________
Fluctuat nec mergitur

Last edited by pegasus1457; 12-29-2009 at 10:18 PM. Reason: forgot the -O2 flag the first time
Reply With Quote Quick reply to this message Share with Facebook
  #28  
Old 12-29-2009
pegasus1457's Avatar
Arf!
 
Join Date: Apr 2002
Location: Long Island NY
Posts: 609
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 13
pegasus1457 is on a distinguished road
Quote:
Originally Posted by brak View Post
Actually, according to Wikipedia (and what I seem to recall from elsewhere) "The iPhone 3G and iPhone 3GS employ A-GPS". That's not quite a true GPS, though it's not triangulation either. However, A-GPS does not work if the phone is not talking to a tower (in fact, it needs to talk to a properly equipped/connected tower).
Re the platform I am using (HTC Eris):

HTC Droid Eris | Android Devices

This site claims there is a built-in GPS (other devices profiled on this site claim GPS/aGPS)
__________________
Fluctuat nec mergitur
Reply With Quote Quick reply to this message Share with Facebook
  #29  
Old 12-30-2009
Sea Slacker
 
Join Date: Jan 2007
Posts: 1,789
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 8
brak is on a distinguished road
Quote:
Originally Posted by pegasus1457 View Post
Never could pass up a challenge.

On my machine (MacOS 10.6.2, 2.4 GHz Intel Core 2 Duo, 2GB 667 MHz DDR2) I get completely different results from yours:
Cool stuff. My test machine is not too dissimilar:
2.16 Ghz Intel Core 2 Dua, 3Gb 667 Mhz DDR2, MacOS 10.5.8

The difference in "real" run time for C is almost exactly proportional to processor speed-up (2.69/3.03 vs 2.16/2.4), so no surprises there.

So clearly Java is working a lot faster (though 20% difference is still nothing to sneeze at, i.e. I am completely refactoring chart handling code now and if I get 20% out of that I'd be extatic ).

Here is what my java says: java version "1.5.0_20"
What do you have on your machine?

If I am not too busy later I'll boot up and try it on my friendly Linux box (no Java compiler on windows).
Reply With Quote Quick reply to this message Share with Facebook
  #30  
Old 12-30-2009
Sea Slacker
 
Join Date: Jan 2007
Posts: 1,789
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 8
brak is on a distinguished road
Visual C Express for Windows is free nowadays - so anyone can get a functional windows development environment at no cost.

RainDog - so here is one place where someone can definitely build an integrated solution (end to end "something" so that users don't have to go through the hassle). May be even more interesting to preprocess all those charts on *your* server and then have a program that downloads those pre-processed cells directly. And that's a proven way to get charts working on Android, no unknowns.

Quote:
Originally Posted by pegasus1457 View Post
I have been active in a thread on anything-sailing.com, on this subject, which I will summarize:

There is an app (Orux Maps) for the android platform that displays your GPS location on a raster-scanned chart. The quality of the chart rendering is acceptable, and entering waypoints is possible, but the app has no way to lay down a route. [The developer is a hiker!]

The raster scanned charts are available at no cost from NOAA, but they have to be chewed up and recast as little morsels that can be downloaded to and displayed on the mobile device screen.
  • The developer of Orux Maps has a desktop utility that will take you part of the way. You need to start with a calibration file (.map) and an extracted raster-scan graphic file (.jpg or .png).
  • I have developed code which bridges this gap: it starts with the BSB files from NOAA and generates the .map and .png files.
  • It runs on a MacOS desktop or in a cygwin (unix-like) environment on Windows machine.
[If someone has a Windows development toolset for C, the source files are posted as noted in the thread cited above; if you want to build a Windows app it would be a service to many in this community.]

For more details see the thread on Anything Sailing Forum
http://www.anything-sailing.com/look...6665#post66665
Reply With Quote Quick reply to this message Share with Facebook
Reply

Quick Reply
Message:
Options

By choosing to post the reply above you agree to the rules you agreed to when joining Sailnet.
Click Here to view those rules.

Register Now

In order to be able to post messages on the SailNet Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
Please note: After entering 3 characters a list of Usernames already in use will appear and the list will disappear once a valid Username is entered.
User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in

Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

 
Posting Rules
You may post new threads
You may post replies
You may post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Up Your Nav Station Sue & Larry Gear and Maintenance Articles 0 07-26-2002 09:00 PM


All times are GMT -4. The time now is 09:38 PM.

Add to My Yahoo!         
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.1
(c) Marine.com LLC 2000-2012

The SailNet.com store is owned and operated by a company independent of the SailNet.com forum. You are now leaving the SailNet forum. Click OK to continue or Cancel to return to the SailNet forum.