Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 29-09-2014, 21:30   #1
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
OCPN for Android Proof of Concept and Teaser....

Ahoy 'Droids...

The elves have been burning the midnight oil.

For a little eye-candy, and food for thought, I attach an image of OCPN running natively in an Android simulator.

Environment:
1. Android version: (simulated) Android 4.4.2
2. Widgets: wxQT 3.1, modified locally for non-trivial wxQt apps on Android.
3. Qt for Android, Ver 5.2.1
4. Installation method: Standard APK in user mode.
5. APK contents:
OCPN executable
wxQT libraries
Qt for Android libraries
GSHHS background chart data
Chart symbols images.
OCPN Icons

6. Changes to OCPN codebase:
Minimal, mostly guards around missing functionality, and expected fiddling with differing window Z-order concepts between OCPN, wxQt, and Qt itself. Also some dancing around Android files system for app-persistent data storage (config files, logfiles, etc).

7. Physical device support:
APK installs and runs fairly smoothly on a cheap($50) Andoid 7" tablet. I would have taken a pix of the real device, but my camera battery is dead...

Now, in true conservative engineering fashion, I must give some caveats....

1. Lots of classes and methods in wxQt-Android are missing and/or bad broken. And there does not seem to be much effort going on in the wxWidgets team regarding wxQt. Sean is participating, and encountering some resistance...So far, there really is no wxQt-Android fork in existence. Just a few private forks of wx with some redundant, though necessary, commits. Thanks, Sean.

However, with effort, all these issues can be worked around. We bundle all the libs in the APK, so we can control this. ultimately. But it is a big effort. Three dynamic code bases to consider....

2. No charts displayed yet. Where to put them? On SDCARD, probably, loaded externally for now.
3. No communications at all. Network and serial ports disabled. So, no GPS position.
4. No OpenGL (yet). Needs a GLES shim layer.
5. No international (locale) support. Unimplemented concept on Qt for Android.
6. Build process is very slow, clumsy, and fussy. Lots of special tools, scripts, hand-crafted steps, with extensive local file path names in the custom build scripts. I'll do some cleanup and commit something to my github repo soon...

The issues with OCPN on Android range from sublime (How many Android users have any concept of a linux backing file system for chart and data management? And how do we work that without root?)... to the ridiculous (Tell me again how we are going to get GPS on the tablets that most people have?).

So, it is a proof of concept. The architecture is valid, and works.
But not at all ready for prime time, or even alpha testing.....yet.

Comments appreciated..

Regards
Dave
Attached Thumbnails
Click image for larger version

Name:	android.jpg
Views:	370
Size:	62.4 KB
ID:	89000  
__________________

__________________
bdbcat is online now   Reply With Quote
Old 29-09-2014, 22:11   #2
Registered User
 
Target9000's Avatar

Join Date: May 2009
Location: New Orleans LA
Boat: 74 Westsail 32
Posts: 1,379
Re: OCPN for Android Proof of Concept and Teaser....

Dave,

I'm not up on all this well enough to provide any technical feedback, but as an android user, all I can says is great job and please keep it up!

I think the one thing that opencpn has lacked is true mobile platform support. Many use other applications on tablets and whatnot. If there was an open source android competitor I think it would open a lot of doors for a lot of people.
__________________

__________________
Let your heart tell you where to go, but let your brain tell you how to get there.

Sundowner Sails Again
Target9000 is offline   Reply With Quote
Old 29-09-2014, 23:26   #3
Registered User

Join Date: Mar 2010
Location: Wandering around North America
Boat: Defever 43 - Gray Hawk
Posts: 602
Re: OCPN for Android Proof of Concept and Teaser....

I'm reading this on my Galaxy S5. Looking forward to being a Alpha tester whenever you get to that stage.

R.J.(Bob) Evans
www.travellingwithgeorge.blogspot.com
__________________
R.J.(Bob) Evans
M/V Gray Hawk, 43 Defever Offshore Cruiser
http://www.bobandmarilyn.ca
bobofthenorth is offline   Reply With Quote
Old 30-09-2014, 04:35   #4
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,803
Re: OCPN for Android Proof of Concept and Teaser....

Quote:
Originally Posted by bdbcat View Post
Ahoy 'Droids...

The elves have been burning the midnight oil.

For a little eye-candy, and food for thought, I attach an image of OCPN running natively in an Android simulator.
Nice, I will try to get an android simulator as well.
Quote:
Environment:
1. Android version: (simulated) Android 4.4.2
2. Widgets: wxQT 3.1, modified locally for non-trivial wxQt apps on Android.
Are you using my fork of wxWidgets? I imagine so from the screenshot, however recently (yesterday) most of my latest commits for wxWidgets got merged with master, so maybe it's good enough to work off that now.
Quote:
3. Qt for Android, Ver 5.2.1
4. Installation method: Standard APK in user mode.
5. APK contents:
OCPN executable
wxQT libraries
Qt for Android libraries
GSHHS background chart data
Chart symbols images.
OCPN Icons

6. Changes to OCPN codebase:
Minimal, mostly guards around missing functionality, and expected fiddling with differing window Z-order concepts between OCPN, wxQt, and Qt itself. Also some dancing around Android files system for app-persistent data storage (config files, logfiles, etc).
Are you working off my wxqt branch of opencpn?
Quote:
7. Physical device support:
APK installs and runs fairly smoothly on a cheap($50) Andoid 7" tablet. I would have taken a pix of the real device, but my camera battery is dead...
Nice, I should be able to also run on some of the arm dev boards I have.
Quote:
Now, in true conservative engineering fashion, I must give some caveats....

1. Lots of classes and methods in wxQt-Android are missing and/or bad broken. And there does not seem to be much effort going on in the wxWidgets team regarding wxQt. Sean is participating, and encountering some resistance...So far, there really is no wxQt-Android fork in existence. Just a few private forks of wx with some redundant, though necessary, commits. Thanks, Sean.
Most of wxQt is merged into master now. Mariano (google summer of code for wxQt) is actually taking the time to look at this after the project ended which is good news.

I went and implemented all the remaining classes that opencpn needs (besides optional graphics contexts), as well as a few others which were easy. Many cases are not optimal and there is a long list of things which are not quite right, but shouldn't matter much for opencpn.

The biggest thing is figuring out the z-order issues.
Quote:
However, with effort, all these issues can be worked around. We bundle all the libs in the APK, so we can control this. ultimately. But it is a big effort. Three dynamic code bases to consider....

2. No charts displayed yet. Where to put them? On SDCARD, probably, loaded externally for now.
Perhaps we should have some sort of custom file explorer for android? We must allow network-mounted file systems and advanced configurations, so access to the filesystem is needed.
Quote:
3. No communications at all. Network and serial ports disabled. So, no GPS position.
Why is this? Vlad seems to think unix sockets work just fine on android, so in this case it should just work.. the same as threads. Neither currently are emulated on top of Qt. I would prefer to emulate them both on top of qt, and provide both options at build time (probably needed for wxQt on IOS to work when we want to run on ipads)
Quote:
4. No OpenGL (yet). Needs a GLES shim layer.
Is there any technical reason glshim doesn't work here?
Quote:
5. No international (locale) support. Unimplemented concept on Qt for Android.
I believe locale's are handled in this case by wxwidgets, so should just work.
Quote:
6. Build process is very slow, clumsy, and fussy. Lots of special tools, scripts, hand-crafted steps, with extensive local file path names in the custom build scripts. I'll do some cleanup and commit something to my github repo soon...
Yes, well.. you mean building everything has lots of steps? I hope you applied my patches to cmake (I'm waiting for them to get committed) otherwise you might have had to do some strange things to build opencpn.
Quote:
The issues with OCPN on Android range from sublime (How many Android users have any concept of a linux backing file system for chart and data management? And how do we work that without root?)... to the ridiculous (Tell me again how we are going to get GPS on the tablets that most people have?).
I don't know what tablets most poeple have, but I thought many had gps built in. If not, either usb, bluetooth, or a wifi (networked gps from another machine) should be used.

If a unix filesystem is too confusing, then we are going to need some custom UI to handle chart locations, but initially just use the unix filesystem.
Quote:

So, it is a proof of concept. The architecture is valid, and works.
But not at all ready for prime time, or even alpha testing.....yet.
I wasn't kidding about this one.

Quote:
Originally Posted by Target9000 View Post
Dave,

I'm not up on all this well enough to provide any technical feedback, but as an android user, all I can says is great job and please keep it up!

I think the one thing that opencpn has lacked is true mobile platform support. Many use other applications on tablets and whatnot. If there was an open source android competitor I think it would open a lot of doors for a lot of people.
This can also work for IOS for ipads. Are there any other mobile platforms of significance?
__________________
boat_alexandra is offline   Reply With Quote
Old 30-09-2014, 07:15   #5
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
Re: OCPN for Android Proof of Concept and Teaser....

Sean:
Quote:
I went and implemented all the remaining classes that opencpn needs (besides optional graphics contexts), as well as a few others which were easy. Many cases are not optimal and there is a long list of things which are not quite right, but shouldn't matter much for opencpn.
Wow. You've been busy. Bdcat, Sean this is remarkable progress.

We have Samsung S4 phones and a Samsung Note 8.0 and they all have dedicated GPS which operates without the phone network, although there is a pesky message to turn it on for more accuracy. It takes awhile to get located, but we have found the App "GPS Status" to be a big assist in that respect. Is a Samsung Note 12.0 at the helm a possibility?

For Radar, AIS and Nmea data sensors would you need a small attached computer with wifi to process and send to the tablet via Wifi just the nmea data and radar/ais overlays? --But keep the charts on the Android for reliability.

I guess that's a little too forward looking... possibility of ipad too would be welcomed by many.

PS: Thanks, it gets you thinking.
__________________
rgleason is offline   Reply With Quote
Old 30-09-2014, 07:40   #6
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
Re: OCPN for Android Proof of Concept and Teaser....

Sean...

Simulator: Part of Android NDK.

wxQt: I pulled the github wx repo with the gsoc2014 qt stuff merged. Cherry picked a few of yours and Mariano's commits. I need to scrub this and see what has made it into the trunk by now. There is one critical commit that must be made, or done locally: wcstombs/mbstocws is just broken on Android, and prevents wx from doing anything useful with wxStrings on Android. Mariano has this one in his tree. Non-unicode build of wxQt is also broken....

OCPN: Also cherry picked a few of your commits, just enough to get it to work. Added a bunch more guards. Refactored CMakeLists.txt, again I'll look again at your OCPN pull request, pick some, and commit to a separate branch. Then we can close the pull request and all be on the same page.

Stuff that I have not yet implemented might just work, but each one is a separate couple of days of work. The debug environment is poor.

For example, wxlocale is broken because wxString::ToDouble() depends on the decimal point definition, "." or ",". And its broken somewhere deep inside. These kinds of things can take hours and hours to root out.

So, the config string needed for wxQt build is full of "--disable-xxx".
I find it easiest in this environment to build brick-upon-brick, rather than enable everything and hope for the best. Makes the build images smaller, too. Who needs wxRichText, anyway?

We will need a custom chart finder/management dialog that works without root.

I will be moving ahead with this fork at lower priority now that it is proven. I'll get some notes and patches committed, and look forward to your help.

Thanks
Dave
__________________
bdbcat is online now   Reply With Quote
Old 30-09-2014, 07:48   #7
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OCPN for Android Proof of Concept and Teaser....

If you check Google Play there are apks that bridge the gap between different types of gps and other applications. GPS Share WIFI is in use by people running OpenCPN in a linux chroot environment on androids. Can they also serve a purpose here? Another kind of plugin...

Another consideration is that some built in gps on androids generate nmea data while others do not. In the latter case GPS Share WIFI and others take 'position' information and produce 'fake' nmea data from it.
__________________
Wrong is offline   Reply With Quote
Old 30-09-2014, 08:54   #8
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OCPN for Android Proof of Concept and Teaser....

I am not a programmer, so I haven't any idea whether or not this is useful. But, back in the early days when I was trying to find a way to get gps working in the chroot environment, I queried a programmer friend of mine for ideas. His response:

If the raw NMEA API is not available, use the Android Location API to
get position, and then output fake NMEA sentences for OpenCPN to read.

Sample Java code to write an NMEA sentence is in the 'writeGGASentence' method in:
http://worldwind31.arc.nasa.gov/svn/...meaWriter.java

Seems his answer suggests using NMEA API's and java should be applicable here.
__________________
Wrong is offline   Reply With Quote
Old 30-09-2014, 10:11   #9
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OCPN for Android Proof of Concept and Teaser....

In regard to OpenGL on androids. My experience reveals at least for the Motorola Xoom with a Nvidia graphics chip, that OpenGL does not work when OpenCPN from source is built against the following dependencies:

1) libgl1-mesa-dev
2) libgl1-mesa-glx
3) libglu1-mesa-dev

I get a blank white screen, and I'll be surprised if any arm tablet is going to be different. In order to enable OpenGL on my Xoom (with subtle differences in how charts display, and no huge increase in frames per second) libgl1-mesa-swx11 must be installed. But, it conflicts with the dependencies listed above. Worse yet, switching to non-OpenGL has undesirable consequences the most significant being that my 'ownship' icon no longer displays (the red boat when gps is on).

So, I have reinstalled the required dependencies, removed libgl1-mesa-swx11, used a binary opencpn_3.3.1618-armhf.deb I generated for others and returned to normalcy.
__________________
__________________
Wrong is offline   Reply With Quote
Old 30-09-2014, 11:09   #10
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OCPN for Android Proof of Concept and Teaser....

Dave said:

"The issues with OCPN on Android range from sublime (How many Android users have any concept of a linux backing file system for chart and data management? And how do we work that without root?)"

Sean said:

Perhaps we should have some sort of custom file explorer for android? We must allow network-mounted file systems and advanced configurations, so access to the filesystem is needed.

I say:

There are already very robust freely available android file managers available from Google Play. For use in root or non-root environments. I cannot speak to restrictions that may complicate copying charts to /sdcard since I've always had a rooted device. I recommend XDA Developers for information regarding this potential problem and possible solutions. It is very easy for users to understand /sdcard is the primary userspace, so even if they haven't a clue that the underlying system is linux, copying to and accessing charts from /sdcard in OpenCPN should be easy - provided it can be done without root. On stock android devices, copying, moving (cut & paste) to and from the same or different card (/sdcard1) may restricted, permitting a copy operation but not a cut & move operation... I created /sdcard/CM93 o.k., but even on my rooted device cannot subsequently delete CM93...
__________________
Wrong is offline   Reply With Quote
Old 03-10-2014, 07:19   #11
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OCPN for Android Proof of Concept and Teaser....

"In the meanwhile", people wanting to use OpenCPN on their android devices NOW can follow my mostly copy & paste instructions here: Building on Motorola Xoom | Official OpenCPN Homepage

__________________
Wrong is offline   Reply With Quote
Old 03-10-2014, 08:49   #12
Senior Cruiser

Cruisers Forum Supporter

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 17,314
Re: OCPN for Android Proof of Concept and Teaser....

Finally!

Great effort and most appreciated here.

I think internal GPS and wifi data in (first, AIS, instrumanets, etc.) and out (last) essential.

PLS let us know when any early build available for testing. I will give it a ride. We are on 7'' 4.2.2. Jelly Beans and I have some basic understanding of most concepts involved.

Again: GREAT thanks. You are making this world a better, safer sailing place.

Regards,
barnakiel
__________________
barnakiel is offline   Reply With Quote
Old 03-10-2014, 09:15   #13
Registered User
 
Wrong's Avatar

Join Date: Jul 2013
Posts: 1,702
Re: OCPN for Android Proof of Concept and Teaser....

Here's OpenCPN running on my Motorola Xoom. First photo without OpenGL, second photo with OpenGL enabled. Instructions how to accomplish this are in my previous post.
Attached Thumbnails
Click image for larger version

Name:	tmp_4003-Non_OpenGLview1417433601.png
Views:	205
Size:	232.9 KB
ID:	89191   Click image for larger version

Name:	tmp_4003-OpenGLview-241741390.png
Views:	201
Size:	300.2 KB
ID:	89192  

__________________
Wrong is offline   Reply With Quote
Old 03-10-2014, 12:26   #14
Senior Cruiser

Cruisers Forum Supporter

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 17,314
Re: OCPN for Android Proof of Concept and Teaser....

@wrong

Excuse me, I believe this thread relates to an Android App.

@bdbcat

Or does it not?

Cheers,
b.
__________________
barnakiel is offline   Reply With Quote
Old 03-10-2014, 12:46   #15
Registered User

Join Date: Jul 2010
Location: Monastir, Tunisia
Boat: Amel Sharki
Posts: 1,774
Re: OCPN for Android Proof of Concept and Teaser....

Instead of opening a new playground it would be nice to finish first the running projects like OpenCPN v3.4, s63 plugin, and other unfinished projects.

Gerhard
__________________

__________________
CarCode is offline   Reply With Quote
Reply

Tags
concept

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Android Anchor Drag Alarm for Android? phantomracer Marine Electronics 15 20-07-2014 10:03
OCPN to Android a possibility? sinbad7 OpenCPN 0 17-01-2014 08:47
Teaser from Vendee Globe DeepFrz Monohull Sailboats 1 16-09-2012 21:05
Perkins Injector Pump Timing Brain Teaser Sailmel Engines and Propulsion Systems 3 28-03-2010 17:19



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 22:54.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.