Author Topic: Android  (Read 68422 times)

Admin

Android
« on: August 31, 2015, 04:52:49 pm »
Hi All,

Probably worth mentioning where we are on this topic.

The only thing holding back PilotAware from running under Android is the CollisionAware App
This is something I wrote which is only available on iOS.

Chris Mills is currently porting this to Android, and in Parallel I have been investigating the ability
to use off the shelf apps which send GPS/NMEA messages over WiFi.

On iOS there is an app called GPS NMEA
https://itunes.apple.com/gb/app/nmea-gps/id590868529?mt=8

and on Android there is an app called BlueNMEA
http://max.kellermann.name/projects/blue-nmea/

Both of these should provide the ability to stream the GPS data to PilotAware.

I am currently testing the iOS/GPS-NMEA application and I pretty much have it working, in which case I am
hopeful that I can use the same mechanism for Android/BlueNMEA.

This also means I can drop my iOS Developer License and save some money - Hurrah!

Thx
Lee

rg

Re: Android
« Reply #1 on: August 31, 2015, 08:17:32 pm »
That's interesting.  Bluenmea just gives me errors.

I'm using a GNS2000 with android so have to use Bluetooth GPS with mock locations to use the gps with SD.   The app as an NMEA tab spewing out a data stream.

https://play.google.com/store/apps/details?id=googoo.android.btgps&hl=en_GB&referrer=utm_source%3Dgoogle%26utm_medium%3Dorganic%26utm_term%3Dbluetooth+gps+play+store&pcampaignid=APPU_1_4abkVfmwBYOhgwSA3qrYCg

I can't see either in bluetooth gps or Bluenmea how set set a port to send this data to. What's the best way of testing if pilot aware is getting the data?

Admin

Re: Android
« Reply #2 on: August 31, 2015, 08:28:52 pm »
Hi

There is some work to do still, at the moment CollisionAware provides the location info to
PilotAware, and that is a bespoke protocol

BlueNMEA I presume is streaming NMEA messages over WiFi.
So I need to create a parser to read those messages, not too difficult really.

My plan is to get PilotAware accepting the messages from the iOS app GPS NMEA firstly,
then this should just work (famous last words) when accepting messages from BlueNMEA

I am kind of halfway there, EasyVFR have now builtin a GPS broadcast. This means I can
connect EasyVFR to PilotAware without the need to run CollisionAware, but more importantly
(but not yet tested) this means that EasyVFR should work on Android straight off the bat

but lets prove this first

Thx
Lee

rg

Re: Android
« Reply #3 on: August 31, 2015, 08:31:27 pm »
Thnx.

I posted on the SD beta forum asking Tim to build collision aware into SD.

Fingers crossed.

rg

Re: Android
« Reply #4 on: September 01, 2015, 02:16:21 pm »
BlueNMEA I presume is streaming NMEA messages over WiFi.

I think its streaming it over bluetooth. 

This might do it (or help Chris) https://play.google.com/store/apps/details?id=com.alexandreroman.nrelay

Admin

Re: Android
« Reply #5 on: September 01, 2015, 03:33:10 pm »
BlueNMEA I presume is streaming NMEA messages over WiFi.

I think its streaming it over bluetooth. 

This might do it (or help Chris) https://play.google.com/store/apps/details?id=com.alexandreroman.nrelay

Apparently BlueNMEA can stream over bluetooth, or TCP.
Quote
BlueNMEA is an Android application which sends location data over Bluetooth (RFCOMM) or TCP in the NMEA format.
I would prefer UDP I think to make everything orthogonal, but TCP is fine too

I think Chris Mills may have his solution working shortly anyway.

Thx
Lee

chrismills

Re: Android
« Reply #6 on: September 07, 2015, 02:15:21 am »
Hi Lee.

Making progress with the android app. Currently I am able to grab all the required gps data and construct a P3I sentence. I can broadcast this over UDP to my desktop using an onscreen button to send each sentence.

Only things left to do are move the broadcast to a recurring event, rather than button driven, test using PilotAware box and make the app look a bit prettier. Which version of the Pi code do I need in order for it to receive UDP broadcasts?

Once I have a version which seems to be working for me I will publish on the Google Play Store. Hopefully soon.

I suspect there may be some initial issues to resolve with the app going to sleep, Android killing "unused" processes, etc, but at least it's a start.

BW, Chris

rg

Re: Android
« Reply #7 on: September 07, 2015, 12:03:46 pm »
Sounds good Chris.

There's a PERSISTENT_ACTIVITY property option in Xmarin projects which is not on by default.  Must be something similar in your IDE. 

Looking forward to testing it out!

Admin

Re: Android
« Reply #8 on: September 07, 2015, 08:07:46 pm »
Hi Chris

Busy at show, hence I have been quiet.

I am guessing there are a number of ways to get this to repeat.
I presume the code is in java, so I am not much use on the syntax, but....

You either need to spawn a thread with a constant delay loop, like 1 second, or
Register a function callback on a timer event to perform the send

I am sure java would have these constructs available

Thx
Lee

chrismills

Re: Android
« Reply #9 on: September 07, 2015, 11:57:01 pm »
Thanks Lee.
You are correct in that I'm working in Java. Bit of a learning curve for me. It's been a long time since I've done any Java coding and even then, not to a high standard. However, making progress.
I'll keep you posted.
Hope the show was a good time and big success.
BW, Chris

ianfallon

Re: Android
« Reply #10 on: September 08, 2015, 07:49:47 am »
Thanks Lee.
You are correct in that I'm working in Java. Bit of a learning curve for me. It's been a long time since I've done any Java coding and even then, not to a high standard. However, making progress.
I'll keep you posted.
Hope the show was a good time and big success.
BW, Chris

Hi Chris - I do Java s/w dev for a living - let me know if you get stuck. I've not ventured into Android programming yet but Java no problem.

chrismills

Re: Android
« Reply #11 on: September 11, 2015, 01:06:50 am »
Thanks for the offer of help Ian.

I'm please to say that I've cracked it. I have a very rough Android app running on my phone, providing GPS data and feeds that along with traffic to my tablet running Skydemon. Hooray.

My plan is to tidy up the app a bit and publish on the App store. I'll try to get something available tomorrow night, in time for the weekend.

Once it's published then I think it might be helpful if you like to take a look at my code and tidy up a bit. Even I think it's a bit of a mess and I'm sure and experienced Java developer would be mortally offended by it.

Cheers, Chris.


onkelmuetze

Re: Android
« Reply #12 on: September 11, 2015, 06:36:25 am »
That's good news! I really appreciate your efforts on this, Chris, and I am really looking forward to do some testing this weekend ;)

ianfallon

Re: Android
« Reply #13 on: September 11, 2015, 08:29:17 am »
Great news Chris. Happy to have a look - don't worry am sure I have seen much worse and I won't rip it to bits!

Andy Fell

Re: Android
« Reply #14 on: September 11, 2015, 09:48:52 am »
:-)