British Forum > General Discussion

Enhancement Requests

(1/84) > >>

Admin:
First Posting

chrismills:
Hi Lee.
House move completed. Ready to have a go at writing Android version of app. Have ordered kit of parts which should all be here this week.  Any documentation or tips on where to start, source code etc that I could get started with?
BW Chris Mills

Shortwing:
I may be able to assist with an android app - I have some experience.  If you need any assistance chrismills shout

Admin:
Excellent!

Where to start - I have no idea, I have never done any android development  :o
I do have a wealth of experience on Linux, and of course Android is built on Linux.

Let me give a brief overview.

The CollisionAware App does nothing more than connect to a listening posix socket on PilotAware,
then it streams the Location services information through the socket connection.
in essence - thats it!

So I would start by investigating :-
1. How to access location services on Android
2. Socket Comms on Android

I would hope (2) is Linux/Posix compliant, in which case we can just lift the code straight from the
IOS Application.

We could probably take most of this info offline through direct email, but let me start by saying this is
what the code in the IOS callback thread looks like for grabbing the location data.


--- Quote ---gps.f32lat    = (Float32) (currentLocation.coordinate.latitude);
gps.f32lon    = (Float32) (currentLocation.coordinate.longitude);
gps.i32altmtr = (int32_t) (currentLocation.altitude);
gps.course    = (int32_t) (currentLocation.course);
gps.speedms   = (int32_t) (currentLocation.speed);
           
// convert Metres to feet
gps.i32altft  = gps.i32altmtr * METRES_TO_FEET;
gps.speedkns  = gps.speedms * MS_TO_KNOTS;
--- End quote ---

Hopefully location services data in Android is all in the same format - but may not be the case.

so as you can see from above I grab the data into a structure, and then this is sent over the posix socket,
in another thread with a specific interval period of 1 second


--- Quote ---        //
        // If we are connected to the port
        //
        sprintf(tbuf, "$P3IGGA,%f,%f,%d,%d,%d,%d,%d,%d,*FF\r\n",
                gps.f32lat, gps.f32lon, gps.i32altft,
                gps.course, gps.speedkns, date, time,
                gps.valid);
        if (sendData(gps.sockfd, tbuf, &gps.commsok) <= 0) {
            NSLog(@"sendData Failed self=%@", self);
        }
--- End quote ---

This is then received by PilotAware and used accordingly.

Is this enough bootstrap info ?
As I mentioned 2 things to investigate, accessing location services, setting up posix thread connections.

Thx
Lee

grvbc:
Really pleased that you guys are on the Android app version - it'll open it up to many more and thereby encourage adoption.

On that note - can PilotAware pick up location info from the RS232 with NMEA already?  I.e. for those of use that want to use the aircraft's already installed GPS.  I guess the question is more a case of - do we have to have a phone/pad for other functionality (such as licencing)?

In my personal case I'd love to use the installed 496 to send NMEA location to PilotAware, and be able to display the traffic alerts graphically on the traffic-capable GPS, rather than need to have a phone/pad in the cockpit too.

All the kit ordered now and on the way.

Thanks

Navigation

[0] Message Index

[#] Next page

Go to full version