React JS: Remove duplicates by values from object array inside reduce

Question: I am currently working on a react project together with antd.
I receive data and calculations from customers, which I have to fill inside a table.
For this, I map the data inside an object array in this form:
const personTableData = filteredCalc.map((calc, index) => ({
    key: index,
    personName: `${calc.Person.Firstname} ${calc.Person.Lastname}`,
    personBirthday: <FormattedDate value={calc.Person.Birthday} />,
    personMaritalStatus: checkMaritalStatus(calc.Person.MaritalStatus),
    jobBeforeAccident: calc.BeforeAccJob || noData,
    leadingDiagnosis:...
        ))
      : noData,
  }));

I have multiple calculations, where the customer and his main information stays the same.
I want to remove duplicates by Firstname + Lastname and the corresponding id.
For example, I receive something like this:
[{Firstname: 'Billy', Lastname:'Johnson', '_id: 2, Age: 15, ...},
{Firstname: 'Billy', Lastname:'Johnson', '_id: 5, Age: 24, ...},
{Firstname: 'Billy', Lastname:'Johnson', '_id: 5, Age: 24, ...},
{Firstname: 'Ashley', Lastname:'Johnson', '_id: 9, Age: 15, ...}]

I want to get something like this (remove if same NAME and ID):
[{Firstname: 'Billy', Lastname:'Johnson', '_id: 2, Age: 15, ...},
{Firstname: 'Billy', Lastname:'Johnson', '_id: 5, Age: 24, ...},
{Firstname: 'Ashley', Lastname:'Johnson', '_id: 9, Age: 15, ...}]

I already have a reducer function, that filters out what I need. What can I extend here, to remove duplicates with Firstname + Lastname & ID ?
 const filteredCalc = allPersonsDetails.calculations.reduce(
    (reducer, calc) => {
      // check if Person has any Icds element has IsLeading === true
      const filtered = calc.Person.Icds.filter((icd) => icd.IsLeading === true);
      // use current calc and replace with filtered Icds
      const newData = { ...calc, Person: { ...calc.Person, Icds: filtered } };
      reducer.push(newData);
      // always return the reducer array
      return reducer;
    },
    []
  );

This is the object array, I use the reduce function on:
[
    {
        "_id": "62ea6a81b7f32a7497ebdb70",
        "BeforeAccJob": "",
        "Person": {
            "_id": "T1145350",
            "Firstname": "Udo",
            "Lastname": "Kirschenbaum",
            "Birthday": "1950-04-16T22:00:00.000Z",
            "MaritalStatus": "NotSet",
            "Icds": [
                {
                    "_id": 912386,
                    "Mk": 2,
                    "Code": "S92.3",
                    "ActineoText": "Fraktur der Mittelfußknochen",
                    "Text": "Fraktur der Mittelfußknochen",
                    "Status": "assured",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912387,
                    "Mk": 2,
                    "Code": "S52.50",
                    "ActineoText": "Distale Fraktur des Radius",
                    "Text": "Distale Fraktur des Radius: Nicht näher bezeichnet",
                    "Status": "assured",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912388,
                    "Mk": 3,
                    "Code": "S22.2",
                    "ActineoText": "Fraktur des Sternums",
                    "Text": "Fraktur des Sternums",
                    "Status": "assured",
                    "IsLeading": true,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912389,
                    "Mk": 3,
                    "Code": "S22.44",
                    "ActineoText": "Rippenserienfraktur (4 oder mehr)",
                    "Text": "Rippenserienfraktur: Mit Beteiligung von vier und mehr Rippen",
                    "Status": "assured",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912390,
                    "Mk": 2,
                    "Code": "S27.31",
                    "ActineoText": "Prellung und Hämatom der Lunge",
                    "Text": "Prellung und Hämatom der Lunge",
                    "Status": "assured",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912391,
                    "Mk": 2,
                    "Code": "S39.9",
                    "ActineoText": "Verletzung abdominal, lumbosakral und/oder Becken",
                    "Text": "Nicht näher bezeichnete Verletzung des Abdomens, der Lumbosakralgegend und des Beckens",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912392,
                    "Mk": 1,
                    "Code": "R58",
                    "ActineoText": "Blutung",
                    "Text": "Blutung, anderenorts nicht klassifiziert",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912393,
                    "Mk": 1,
                    "Code": "T14.1",
                    "ActineoText": "Offene Wunde an einer nicht näher bezeichneten Körperregion",
                    "Text": "Offene Wunde an einer nicht näher bezeichneten Körperregion",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912394,
                    "Mk": 1,
                    "Code": "R23.8",
                    "ActineoText": "Sonstige und nicht näher bezeichnete Hautveränderungen",
                    "Text": "Sonstige und nicht näher bezeichnete Hautveränderungen",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912395,
                    "Mk": 3,
                    "Code": "S37.00",
                    "ActineoText": "Verletzung der Niere, nicht näher bezeichnet",
                    "Text": "Verletzung der Niere, nicht näher bezeichnet",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912396,
                    "Mk": 3,
                    "Code": "S62.3",
                    "ActineoText": "Fraktur im Bereich der Hand",
                    "Text": "Fraktur sonstiger und nicht näher bezeichneter Teile des Handgelenkes und der Hand",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 920670,
                    "Mk": 3,
                    "Code": "S37.03",
                    "ActineoText": "Komplette Ruptur des Nierenparenchyms",
                    "Text": "Komplette Ruptur des Nierenparenchyms",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 920671,
                    "Mk": 2,
                    "Code": "S52.51",
                    "ActineoText": "Distale Fraktur des Radius: Extensionsfraktur",
                    "Text": "Distale Fraktur des Radius: Extensionsfraktur",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 920663,
                    "Mk": 1,
                    "Code": "S51.9",
                    "ActineoText": "Offene Wunde des Unterarmes, Teil nicht näher bezeichnet",
                    "Text": "Offene Wunde des Unterarmes, Teil nicht näher bezeichnet",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 920665,
                    "Mk": 1,
                    "Code": "J90",
                    "ActineoText": "Pleuraerguss",
                    "Text": "Pleuraerguss, anderenorts nicht klassifiziert",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                }
            ],
            "__typename": "Person"
        },
        "__typename": "CalculationEntity"
    },
    {
        "_id": "61b23b256cc8961a3445dc63",
        "BeforeAccJob": "",
        "Person": {
            "_id": "T1056702",
            "Firstname": "Olaf",
            "Lastname": "Kirschenbaum",
            "Birthday": "1979-12-13T23:00:00.000Z",
            "MaritalStatus": "NotSet",
            "Icds": [
                {
                    "_id": 922613,
                    "Mk": 3,
                    "Code": "S92.0",
                    "ActineoText": "Fraktur des Kalkaneus",
                    "Text": "Fraktur des Kalkaneus",
                    "Status": "unknown",
                    "IsLeading": true,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 922614,
                    "Mk": 2,
                    "Code": "S92.3",
                    "ActineoText": "Fraktur der Mittelfußknochen",
                    "Text": "Fraktur der Mittelfußknochen",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 922616,
                    "Mk": 3,
                    "Code": "S22.2",
                    "ActineoText": "Fraktur des Sternums",
                    "Text": "Fraktur des Sternums",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                }
            ],
            "__typename": "Person"
        },
        "__typename": "CalculationEntity"
    },
    {
        "_id": "630492a8f71829079d52d22b",
        "BeforeAccJob": "",
        "Person": {
            "_id": "C34177",
            "Firstname": "",
            "Lastname": "",
            "Birthday": "2022-08-23T06:42:02.316Z",
            "MaritalStatus": "NotSet",
            "Icds": [],
            "__typename": "Person"
        },
        "__typename": "CalculationEntity"
    },
    {
        "_id": "630492b8f71829079d52d2af",
        "BeforeAccJob": "",
        "Person": {
            "_id": "C52679",
            "Firstname": "",
            "Lastname": "",
            "Birthday": "2022-08-23T06:42:02.316Z",
            "MaritalStatus": "NotSet",
            "Icds": [],
            "__typename": "Person"
        },
        "__typename": "CalculationEntity"
    },
    {
        "_id": "61b23b346cc8961a3445dca5",
        "BeforeAccJob": "",
        "Person": {
            "_id": "T1145350",
            "Firstname": "Udo",
            "Lastname": "Kirschenbaum",
            "Birthday": "1950-04-16T22:00:00.000Z",
            "MaritalStatus": "NotSet",
            "Icds": [
                {
                    "_id": 912386,
                    "Mk": 2,
                    "Code": "S92.3",
                    "ActineoText": "Fraktur der Mittelfußknochen",
                    "Text": "Fraktur der Mittelfußknochen",
                    "Status": "assured",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912387,
                    "Mk": 2,
                    "Code": "S52.50",
                    "ActineoText": "Distale Fraktur des Radius",
                    "Text": "Distale Fraktur des Radius: Nicht näher bezeichnet",
                    "Status": "assured",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912388,
                    "Mk": 3,
                    "Code": "S22.2",
                    "ActineoText": "Fraktur des Sternums",
                    "Text": "Fraktur des Sternums",
                    "Status": "assured",
                    "IsLeading": true,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912389,
                    "Mk": 3,
                    "Code": "S22.44",
                    "ActineoText": "Rippenserienfraktur (4 oder mehr)",
                    "Text": "Rippenserienfraktur: Mit Beteiligung von vier und mehr Rippen",
                    "Status": "assured",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912390,
                    "Mk": 2,
                    "Code": "S27.31",
                    "ActineoText": "Prellung und Hämatom der Lunge",
                    "Text": "Prellung und Hämatom der Lunge",
                    "Status": "assured",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912391,
                    "Mk": 2,
                    "Code": "S39.9",
                    "ActineoText": "Verletzung abdominal, lumbosakral und/oder Becken",
                    "Text": "Nicht näher bezeichnete Verletzung des Abdomens, der Lumbosakralgegend und des Beckens",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912392,
                    "Mk": 1,
                    "Code": "R58",
                    "ActineoText": "Blutung",
                    "Text": "Blutung, anderenorts nicht klassifiziert",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912393,
                    "Mk": 1,
                    "Code": "T14.1",
                    "ActineoText": "Offene Wunde an einer nicht näher bezeichneten Körperregion",
                    "Text": "Offene Wunde an einer nicht näher bezeichneten Körperregion",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912394,
                    "Mk": 1,
                    "Code": "R23.8",
                    "ActineoText": "Sonstige und nicht näher bezeichnete Hautveränderungen",
                    "Text": "Sonstige und nicht näher bezeichnete Hautveränderungen",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912395,
                    "Mk": 3,
                    "Code": "S37.00",
                    "ActineoText": "Verletzung der Niere, nicht näher bezeichnet",
                    "Text": "Verletzung der Niere, nicht näher bezeichnet",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 912396,
                    "Mk": 3,
                    "Code": "S62.3",
                    "ActineoText": "Fraktur im Bereich der Hand",
                    "Text": "Fraktur sonstiger und nicht näher bezeichneter Teile des Handgelenkes und der Hand",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 920670,
                    "Mk": 3,
                    "Code": "S37.03",
                    "ActineoText": "Komplette Ruptur des Nierenparenchyms",
                    "Text": "Komplette Ruptur des Nierenparenchyms",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 920671,
                    "Mk": 2,
                    "Code": "S52.51",
                    "ActineoText": "Distale Fraktur des Radius: Extensionsfraktur",
                    "Text": "Distale Fraktur des Radius: Extensionsfraktur",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 920663,
                    "Mk": 1,
                    "Code": "S51.9",
                    "ActineoText": "Offene Wunde des Unterarmes, Teil nicht näher bezeichnet",
                    "Text": "Offene Wunde des Unterarmes, Teil nicht näher bezeichnet",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                },
                {
                    "_id": 920665,
                    "Mk": 1,
                    "Code": "J90",
                    "ActineoText": "Pleuraerguss",
                    "Text": "Pleuraerguss, anderenorts nicht klassifiziert",
                    "Status": "unknown",
                    "IsLeading": false,
                    "__typename": "ProcessICD"
                }
            ],
            "__typename": "Person"
        },
        "__typename": "CalculationEntity"
    }
]

As you can see, I get the same persons multiple times inside my table:
Comment: I ADDED A PLAYGROUND FOR YOU TO TRY ON: https://stackblitz.com/edit/js-pvup4p?file=index.js
Answer: I think _id field is unique, so you don't need to use firstname + lastname in condition. You can use find inside reducer to look if accumulator has the entity with the same _id. If not - add it to accumulator.

const data = [
  {
    _id: '62ea6a81b7f32a7497ebdb70',
    BeforeAccJob: '',
    Person: {
      _id: 'T1145350',
      Firstname: 'Udo',
      Lastname: 'Kirschenbaum',
      Birthday: '1950-04-16T22:00:00.000Z',
      MaritalStatus: 'NotSet',
      Icds: [
        {
          _id: 912386,
          Mk: 2,
          Code: 'S92.3',
          ActineoText: 'Fraktur der Mittelfußknochen',
          Text: 'Fraktur der Mittelfußknochen',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912387,
          Mk: 2,
          Code: 'S52.50',
          ActineoText: 'Distale Fraktur des Radius',
          Text: 'Distale Fraktur des Radius: Nicht näher bezeichnet',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912388,
          Mk: 3,
          Code: 'S22.2',
          ActineoText: 'Fraktur des Sternums',
          Text: 'Fraktur des Sternums',
          Status: 'assured',
          IsLeading: true,
          __typename: 'ProcessICD',
        },
        {
          _id: 912389,
          Mk: 3,
          Code: 'S22.44',
          ActineoText: 'Rippenserienfraktur (4 oder mehr)',
          Text: 'Rippenserienfraktur: Mit Beteiligung von vier und mehr Rippen',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912390,
          Mk: 2,
          Code: 'S27.31',
          ActineoText: 'Prellung und Hämatom der Lunge',
          Text: 'Prellung und Hämatom der Lunge',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912391,
          Mk: 2,
          Code: 'S39.9',
          ActineoText: 'Verletzung abdominal, lumbosakral und/oder Becken',
          Text: 'Nicht näher bezeichnete Verletzung des Abdomens, der Lumbosakralgegend und des Beckens',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912392,
          Mk: 1,
          Code: 'R58',
          ActineoText: 'Blutung',
          Text: 'Blutung, anderenorts nicht klassifiziert',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912393,
          Mk: 1,
          Code: 'T14.1',
          ActineoText:
            'Offene Wunde an einer nicht näher bezeichneten Körperregion',
          Text: 'Offene Wunde an einer nicht näher bezeichneten Körperregion',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912394,
          Mk: 1,
          Code: 'R23.8',
          ActineoText: 'Sonstige und nicht näher bezeichnete Hautveränderungen',
          Text: 'Sonstige und nicht näher bezeichnete Hautveränderungen',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912395,
          Mk: 3,
          Code: 'S37.00',
          ActineoText: 'Verletzung der Niere, nicht näher bezeichnet',
          Text: 'Verletzung der Niere, nicht näher bezeichnet',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912396,
          Mk: 3,
          Code: 'S62.3',
          ActineoText: 'Fraktur im Bereich der Hand',
          Text: 'Fraktur sonstiger und nicht näher bezeichneter Teile des Handgelenkes und der Hand',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920670,
          Mk: 3,
          Code: 'S37.03',
          ActineoText: 'Komplette Ruptur des Nierenparenchyms',
          Text: 'Komplette Ruptur des Nierenparenchyms',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920671,
          Mk: 2,
          Code: 'S52.51',
          ActineoText: 'Distale Fraktur des Radius: Extensionsfraktur',
          Text: 'Distale Fraktur des Radius: Extensionsfraktur',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920663,
          Mk: 1,
          Code: 'S51.9',
          ActineoText:
            'Offene Wunde des Unterarmes, Teil nicht näher bezeichnet',
          Text: 'Offene Wunde des Unterarmes, Teil nicht näher bezeichnet',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920665,
          Mk: 1,
          Code: 'J90',
          ActineoText: 'Pleuraerguss',
          Text: 'Pleuraerguss, anderenorts nicht klassifiziert',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
      ],
      __typename: 'Person',
    },
    __typename: 'CalculationEntity',
  },
  {
    _id: '61b23b256cc8961a3445dc63',
    BeforeAccJob: '',
    Person: {
      _id: 'T1056702',
      Firstname: 'Olaf',
      Lastname: 'Kirschenbaum',
      Birthday: '1979-12-13T23:00:00.000Z',
      MaritalStatus: 'NotSet',
      Icds: [
        {
          _id: 922613,
          Mk: 3,
          Code: 'S92.0',
          ActineoText: 'Fraktur des Kalkaneus',
          Text: 'Fraktur des Kalkaneus',
          Status: 'unknown',
          IsLeading: true,
          __typename: 'ProcessICD',
        },
        {
          _id: 922614,
          Mk: 2,
          Code: 'S92.3',
          ActineoText: 'Fraktur der Mittelfußknochen',
          Text: 'Fraktur der Mittelfußknochen',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 922616,
          Mk: 3,
          Code: 'S22.2',
          ActineoText: 'Fraktur des Sternums',
          Text: 'Fraktur des Sternums',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
      ],
      __typename: 'Person',
    },
    __typename: 'CalculationEntity',
  },
  {
    _id: '630492a8f71829079d52d22b',
    BeforeAccJob: '',
    Person: {
      _id: 'C34177',
      Firstname: '',
      Lastname: '',
      Birthday: '2022-08-23T06:42:02.316Z',
      MaritalStatus: 'NotSet',
      Icds: [],
      __typename: 'Person',
    },
    __typename: 'CalculationEntity',
  },
  {
    _id: '630492b8f71829079d52d2af',
    BeforeAccJob: '',
    Person: {
      _id: 'C52679',
      Firstname: '',
      Lastname: '',
      Birthday: '2022-08-23T06:42:02.316Z',
      MaritalStatus: 'NotSet',
      Icds: [],
      __typename: 'Person',
    },
    __typename: 'CalculationEntity',
  },
  {
    _id: '61b23b346cc8961a3445dca5',
    BeforeAccJob: '',
    Person: {
      _id: 'T1145350',
      Firstname: 'Udo',
      Lastname: 'Kirschenbaum',
      Birthday: '1950-04-16T22:00:00.000Z',
      MaritalStatus: 'NotSet',
      Icds: [
        {
          _id: 912386,
          Mk: 2,
          Code: 'S92.3',
          ActineoText: 'Fraktur der Mittelfußknochen',
          Text: 'Fraktur der Mittelfußknochen',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912387,
          Mk: 2,
          Code: 'S52.50',
          ActineoText: 'Distale Fraktur des Radius',
          Text: 'Distale Fraktur des Radius: Nicht näher bezeichnet',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912388,
          Mk: 3,
          Code: 'S22.2',
          ActineoText: 'Fraktur des Sternums',
          Text: 'Fraktur des Sternums',
          Status: 'assured',
          IsLeading: true,
          __typename: 'ProcessICD',
        },
        {
          _id: 912389,
          Mk: 3,
          Code: 'S22.44',
          ActineoText: 'Rippenserienfraktur (4 oder mehr)',
          Text: 'Rippenserienfraktur: Mit Beteiligung von vier und mehr Rippen',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912390,
          Mk: 2,
          Code: 'S27.31',
          ActineoText: 'Prellung und Hämatom der Lunge',
          Text: 'Prellung und Hämatom der Lunge',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912391,
          Mk: 2,
          Code: 'S39.9',
          ActineoText: 'Verletzung abdominal, lumbosakral und/oder Becken',
          Text: 'Nicht näher bezeichnete Verletzung des Abdomens, der Lumbosakralgegend und des Beckens',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912392,
          Mk: 1,
          Code: 'R58',
          ActineoText: 'Blutung',
          Text: 'Blutung, anderenorts nicht klassifiziert',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912393,
          Mk: 1,
          Code: 'T14.1',
          ActineoText:
            'Offene Wunde an einer nicht näher bezeichneten Körperregion',
          Text: 'Offene Wunde an einer nicht näher bezeichneten Körperregion',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912394,
          Mk: 1,
          Code: 'R23.8',
          ActineoText: 'Sonstige und nicht näher bezeichnete Hautveränderungen',
          Text: 'Sonstige und nicht näher bezeichnete Hautveränderungen',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912395,
          Mk: 3,
          Code: 'S37.00',
          ActineoText: 'Verletzung der Niere, nicht näher bezeichnet',
          Text: 'Verletzung der Niere, nicht näher bezeichnet',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912396,
          Mk: 3,
          Code: 'S62.3',
          ActineoText: 'Fraktur im Bereich der Hand',
          Text: 'Fraktur sonstiger und nicht näher bezeichneter Teile des Handgelenkes und der Hand',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920670,
          Mk: 3,
          Code: 'S37.03',
          ActineoText: 'Komplette Ruptur des Nierenparenchyms',
          Text: 'Komplette Ruptur des Nierenparenchyms',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920671,
          Mk: 2,
          Code: 'S52.51',
          ActineoText: 'Distale Fraktur des Radius: Extensionsfraktur',
          Text: 'Distale Fraktur des Radius: Extensionsfraktur',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920663,
          Mk: 1,
          Code: 'S51.9',
          ActineoText:
            'Offene Wunde des Unterarmes, Teil nicht näher bezeichnet',
          Text: 'Offene Wunde des Unterarmes, Teil nicht näher bezeichnet',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920665,
          Mk: 1,
          Code: 'J90',
          ActineoText: 'Pleuraerguss',
          Text: 'Pleuraerguss, anderenorts nicht klassifiziert',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
      ],
      __typename: 'Person',
    },
    __typename: 'CalculationEntity',
  },
  {
    _id: '5f69f2c6ef296153814ba870',
    BeforeAccJob: '',
    Person: {
      _id: 'T1145350',
      Firstname: 'Udo',
      Lastname: 'Kirschenbaum',
      Birthday: '1950-04-16T22:00:00.000Z',
      MaritalStatus: 'NotSet',
      Icds: [
        {
          _id: 912386,
          Mk: 2,
          Code: 'S92.3',
          ActineoText: 'Fraktur der Mittelfußknochen',
          Text: 'Fraktur der Mittelfußknochen',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912387,
          Mk: 2,
          Code: 'S52.50',
          ActineoText: 'Distale Fraktur des Radius',
          Text: 'Distale Fraktur des Radius: Nicht näher bezeichnet',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912388,
          Mk: 3,
          Code: 'S22.2',
          ActineoText: 'Fraktur des Sternums',
          Text: 'Fraktur des Sternums',
          Status: 'assured',
          IsLeading: true,
          __typename: 'ProcessICD',
        },
        {
          _id: 912389,
          Mk: 3,
          Code: 'S22.44',
          ActineoText: 'Rippenserienfraktur (4 oder mehr)',
          Text: 'Rippenserienfraktur: Mit Beteiligung von vier und mehr Rippen',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912390,
          Mk: 2,
          Code: 'S27.31',
          ActineoText: 'Prellung und Hämatom der Lunge',
          Text: 'Prellung und Hämatom der Lunge',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912391,
          Mk: 2,
          Code: 'S39.9',
          ActineoText: 'Verletzung abdominal, lumbosakral und/oder Becken',
          Text: 'Nicht näher bezeichnete Verletzung des Abdomens, der Lumbosakralgegend und des Beckens',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912392,
          Mk: 1,
          Code: 'R58',
          ActineoText: 'Blutung',
          Text: 'Blutung, anderenorts nicht klassifiziert',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912393,
          Mk: 1,
          Code: 'T14.1',
          ActineoText:
            'Offene Wunde an einer nicht näher bezeichneten Körperregion',
          Text: 'Offene Wunde an einer nicht näher bezeichneten Körperregion',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912394,
          Mk: 1,
          Code: 'R23.8',
          ActineoText: 'Sonstige und nicht näher bezeichnete Hautveränderungen',
          Text: 'Sonstige und nicht näher bezeichnete Hautveränderungen',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912395,
          Mk: 3,
          Code: 'S37.00',
          ActineoText: 'Verletzung der Niere, nicht näher bezeichnet',
          Text: 'Verletzung der Niere, nicht näher bezeichnet',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912396,
          Mk: 3,
          Code: 'S62.3',
          ActineoText: 'Fraktur im Bereich der Hand',
          Text: 'Fraktur sonstiger und nicht näher bezeichneter Teile des Handgelenkes und der Hand',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920670,
          Mk: 3,
          Code: 'S37.03',
          ActineoText: 'Komplette Ruptur des Nierenparenchyms',
          Text: 'Komplette Ruptur des Nierenparenchyms',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920671,
          Mk: 2,
          Code: 'S52.51',
          ActineoText: 'Distale Fraktur des Radius: Extensionsfraktur',
          Text: 'Distale Fraktur des Radius: Extensionsfraktur',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920663,
          Mk: 1,
          Code: 'S51.9',
          ActineoText:
            'Offene Wunde des Unterarmes, Teil nicht näher bezeichnet',
          Text: 'Offene Wunde des Unterarmes, Teil nicht näher bezeichnet',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920665,
          Mk: 1,
          Code: 'J90',
          ActineoText: 'Pleuraerguss',
          Text: 'Pleuraerguss, anderenorts nicht klassifiziert',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
      ],
      __typename: 'Person',
    },
    __typename: 'CalculationEntity',
  },
  {
    _id: '5f69bf5a933a2414c8f540e7',
    BeforeAccJob: '',
    Person: {
      _id: 'T1145350',
      Firstname: 'Udo',
      Lastname: 'Kirschenbaum',
      Birthday: '1950-04-16T22:00:00.000Z',
      MaritalStatus: 'NotSet',
      Icds: [
        {
          _id: 912386,
          Mk: 2,
          Code: 'S92.3',
          ActineoText: 'Fraktur der Mittelfußknochen',
          Text: 'Fraktur der Mittelfußknochen',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912387,
          Mk: 2,
          Code: 'S52.50',
          ActineoText: 'Distale Fraktur des Radius',
          Text: 'Distale Fraktur des Radius: Nicht näher bezeichnet',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912388,
          Mk: 3,
          Code: 'S22.2',
          ActineoText: 'Fraktur des Sternums',
          Text: 'Fraktur des Sternums',
          Status: 'assured',
          IsLeading: true,
          __typename: 'ProcessICD',
        },
        {
          _id: 912389,
          Mk: 3,
          Code: 'S22.44',
          ActineoText: 'Rippenserienfraktur (4 oder mehr)',
          Text: 'Rippenserienfraktur: Mit Beteiligung von vier und mehr Rippen',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912390,
          Mk: 2,
          Code: 'S27.31',
          ActineoText: 'Prellung und Hämatom der Lunge',
          Text: 'Prellung und Hämatom der Lunge',
          Status: 'assured',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912391,
          Mk: 2,
          Code: 'S39.9',
          ActineoText: 'Verletzung abdominal, lumbosakral und/oder Becken',
          Text: 'Nicht näher bezeichnete Verletzung des Abdomens, der Lumbosakralgegend und des Beckens',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912392,
          Mk: 1,
          Code: 'R58',
          ActineoText: 'Blutung',
          Text: 'Blutung, anderenorts nicht klassifiziert',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912393,
          Mk: 1,
          Code: 'T14.1',
          ActineoText:
            'Offene Wunde an einer nicht näher bezeichneten Körperregion',
          Text: 'Offene Wunde an einer nicht näher bezeichneten Körperregion',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912394,
          Mk: 1,
          Code: 'R23.8',
          ActineoText: 'Sonstige und nicht näher bezeichnete Hautveränderungen',
          Text: 'Sonstige und nicht näher bezeichnete Hautveränderungen',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912395,
          Mk: 3,
          Code: 'S37.00',
          ActineoText: 'Verletzung der Niere, nicht näher bezeichnet',
          Text: 'Verletzung der Niere, nicht näher bezeichnet',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 912396,
          Mk: 3,
          Code: 'S62.3',
          ActineoText: 'Fraktur im Bereich der Hand',
          Text: 'Fraktur sonstiger und nicht näher bezeichneter Teile des Handgelenkes und der Hand',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920670,
          Mk: 3,
          Code: 'S37.03',
          ActineoText: 'Komplette Ruptur des Nierenparenchyms',
          Text: 'Komplette Ruptur des Nierenparenchyms',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920671,
          Mk: 2,
          Code: 'S52.51',
          ActineoText: 'Distale Fraktur des Radius: Extensionsfraktur',
          Text: 'Distale Fraktur des Radius: Extensionsfraktur',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920663,
          Mk: 1,
          Code: 'S51.9',
          ActineoText:
            'Offene Wunde des Unterarmes, Teil nicht näher bezeichnet',
          Text: 'Offene Wunde des Unterarmes, Teil nicht näher bezeichnet',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
        {
          _id: 920665,
          Mk: 1,
          Code: 'J90',
          ActineoText: 'Pleuraerguss',
          Text: 'Pleuraerguss, anderenorts nicht klassifiziert',
          Status: 'unknown',
          IsLeading: false,
          __typename: 'ProcessICD',
        },
      ],
      __typename: 'Person',
    },
    __typename: 'CalculationEntity',
  },
];

const filteredCalc = data.reduce((reducer, calc) => {
  if (reducer.find(reducerItem => reducerItem.Person._id === calc.Person._id)) {
    return reducer;
  }
  // check if Person has any Icds element has IsLeading === true
  const filtered = calc.Person.Icds.filter((icd) => icd.IsLeading === true);
  // use current calc and replace with filtered Icds
  const newData = { ...calc, Person: { ...calc.Person, Icds: filtered } };
  reducer.push(newData);
  // always return the reducer array
  return reducer;
}, []);

console.log(data);
console.log(filteredCalc);
Comment: How would I include this inside my reducer function ? I've added your if statement but I still get the same results.
Comment: @LaFllamme I have updated my post snippet with yours playground, check it out.
I just added if statement in reducer function

`if (reducer.find(reducerItem => reducerItem.Person._id === calc.Person._id)) {
    return reducer;
  }`
Comment: Did you save it? Not seeing any changes in playground
Comment: ```const filteredCalc = allPersonsDetails.calculations.reduce(
    (reducer, calc) => {
      if (
        reducer.find(
          (reducerItem) => reducerItem.Person._id === calc.Person._id
        )
      ) {
     do my code
      }
    },
    []
  );```
Comment: I didn't save your playground, just copied here, in the post. Check code snippet.
UPDATE: if `reducer.find` is `true`, you should return reducer without changes.
Answer: Simplest solution I can think of is instead of using an array and reducing, use a dictionary. This will automatically remove all duplicates (technically overwrite them) and leave you with a single row per customer.
const dict = {};
const filteredCalc = allPersonsDetails.calculations.forEach((calc) => {
    // check if Person has any Icds element has IsLeading === true
    const filtered = calc.Person.Icds.filter((icd) => icd.IsLeading);
    // use current calc and replace with filtered Icds
    const newData = { ...calc, Person: { ...calc.Person, Icds: filtered } };
    // store new data with key to preventduplicates
    dict[`${calc.Person._id}${calc.Person.Firstname}${calc.Person.Lastname}`] =
        newData;
});

// Your values are stored in the Object's values.
Object.values(dict);


Android NDK build of spatialite?

Question: I'm attempting to build a copy of sqlite with spatialite extensions. I've seen the one or two related posts online related to this issue, but no one seems to have gone all the way.
I've downloaded the spatialite amalgamation, GEOS and PROJ sources. I've created empty Android projects and moved the uncompressed files into the jni/ directory. The wall I'm running into now is creating the jni/Android.mk file. Does anyone have an example for the GEOS or PROJ dependencies? Has anyone been able to work through this process since the last stackexchange question linked to above?
Comment: I just happened upon this question while searching for prior work in this area. Since I've found nothing done yet, I am about to embark on this task myself. I'll post updates here if I make useful progress!
Answer: I've set things up to compile spatialite as a shared library, and geos and proj as static libs (statically linked with spatialite). These also need libiconv (AFAIK) since the NDK libc doesn't provide iconv.h.
Fortunately, all of these are LGPL or compatible, so it's safe to include these in your app without fear of license issues.
NOTE: You need to run a './configure' first, inside both libiconv and libspatialite in order to generate headers. This requires 'autoconf' be installed.
Also note, this is on Linux (Ubuntu 10.10).
GEOS can't be built and linked in right now because C++ support for STL is completely missing in the NDK. If anyone can come up with a solution to building GEOS, let us know! I'm not sure how critical it is to have the advanced functions in GEOS, but it saves over 1MB of library size leaving it out according to the README.
Here's my main 'jni/Android.mk'. It could be split up into multiple files but I didn't bother cause I'm lazy :-)
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE    := iconv
LOCAL_CFLAGS    := \
    -Wno-multichar \
    -D_ANDROID \
    -DLIBDIR="\"c\"" \
    -DBUILDING_LIBICONV \
    -DIN_LIBRARY
LOCAL_C_INCLUDES := \
    libiconv-1.13.1 \
    libiconv-1.13.1/include \
    libiconv-1.13.1/lib \
    libiconv-1.13.1/libcharset/include
LOCAL_SRC_FILES := \
    libiconv-1.13.1/lib/iconv.c \
    libiconv-1.13.1/lib/relocatable.c \
    libiconv-1.13.1/libcharset/lib/localcharset.c
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := proj
LOCAL_C_INCLUDES := proj-4.7.0/src
LOCAL_LDLIBS := -lm
# this list was generated with:
#   find proj-4.7.0/ -name "*.c" | grep -Ev "tests|doc" | sort | awk '{ print "\t"$1" \\" }'
LOCAL_SRC_FILES := \
    proj-4.7.0/src/aasincos.c \
    proj-4.7.0/src/adjlon.c \
    proj-4.7.0/src/bch2bps.c \
    proj-4.7.0/src/bchgen.c \
    proj-4.7.0/src/biveval.c \
    proj-4.7.0/src/cs2cs.c \
    proj-4.7.0/src/dmstor.c \
    proj-4.7.0/src/emess.c \
    proj-4.7.0/src/gen_cheb.c \
    proj-4.7.0/src/geocent.c \
    proj-4.7.0/src/geod.c \
    proj-4.7.0/src/geod_for.c \
    proj-4.7.0/src/geod_inv.c \
    proj-4.7.0/src/geod_set.c \
    proj-4.7.0/src/jniproj.c \
    proj-4.7.0/src/mk_cheby.c \
    proj-4.7.0/src/nad2bin.c \
    proj-4.7.0/src/nad2nad.c \
    proj-4.7.0/src/nad_cvt.c \
    proj-4.7.0/src/nad_init.c \
    proj-4.7.0/src/nad_intr.c \
    proj-4.7.0/src/PJ_aea.c \
    proj-4.7.0/src/PJ_aeqd.c \
    proj-4.7.0/src/PJ_airy.c \
    proj-4.7.0/src/PJ_aitoff.c \
    proj-4.7.0/src/pj_apply_gridshift.c \
    proj-4.7.0/src/PJ_august.c \
    proj-4.7.0/src/pj_auth.c \
    proj-4.7.0/src/PJ_bacon.c \
    proj-4.7.0/src/PJ_bipc.c \
    proj-4.7.0/src/PJ_boggs.c \
    proj-4.7.0/src/PJ_bonne.c \
    proj-4.7.0/src/PJ_cass.c \
    proj-4.7.0/src/PJ_cc.c \
    proj-4.7.0/src/PJ_cea.c \
    proj-4.7.0/src/PJ_chamb.c \
    proj-4.7.0/src/PJ_collg.c \
    proj-4.7.0/src/PJ_crast.c \
    proj-4.7.0/src/pj_datums.c \
    proj-4.7.0/src/pj_datum_set.c \
    proj-4.7.0/src/PJ_denoy.c \
    proj-4.7.0/src/pj_deriv.c \
    proj-4.7.0/src/PJ_eck1.c \
    proj-4.7.0/src/PJ_eck2.c \
    proj-4.7.0/src/PJ_eck3.c \
    proj-4.7.0/src/PJ_eck4.c \
    proj-4.7.0/src/PJ_eck5.c \
    proj-4.7.0/src/pj_ellps.c \
    proj-4.7.0/src/pj_ell_set.c \
    proj-4.7.0/src/PJ_eqc.c \
    proj-4.7.0/src/PJ_eqdc.c \
    proj-4.7.0/src/pj_errno.c \
    proj-4.7.0/src/pj_factors.c \
    proj-4.7.0/src/PJ_fahey.c \
    proj-4.7.0/src/PJ_fouc_s.c \
    proj-4.7.0/src/pj_fwd.c \
    proj-4.7.0/src/PJ_gall.c \
    proj-4.7.0/src/pj_gauss.c \
    proj-4.7.0/src/pj_geocent.c \
    proj-4.7.0/src/PJ_geos.c \
    proj-4.7.0/src/PJ_gins8.c \
    proj-4.7.0/src/PJ_gnom.c \
    proj-4.7.0/src/PJ_gn_sinu.c \
    proj-4.7.0/src/PJ_goode.c \
    proj-4.7.0/src/pj_gridinfo.c \
    proj-4.7.0/src/pj_gridlist.c \
    proj-4.7.0/src/PJ_gstmerc.c \
    proj-4.7.0/src/PJ_hammer.c \
    proj-4.7.0/src/PJ_hatano.c \
    proj-4.7.0/src/PJ_imw_p.c \
    proj-4.7.0/src/pj_init.c \
    proj-4.7.0/src/pj_initcache.c \
    proj-4.7.0/src/pj_inv.c \
    proj-4.7.0/src/PJ_krovak.c \
    proj-4.7.0/src/PJ_labrd.c \
    proj-4.7.0/src/PJ_laea.c \
    proj-4.7.0/src/PJ_lagrng.c \
    proj-4.7.0/src/PJ_larr.c \
    proj-4.7.0/src/PJ_lask.c \
    proj-4.7.0/src/pj_latlong.c \
    proj-4.7.0/src/PJ_lcca.c \
    proj-4.7.0/src/PJ_lcc.c \
    proj-4.7.0/src/pj_list.c \
    proj-4.7.0/src/PJ_loxim.c \
    proj-4.7.0/src/PJ_lsat.c \
    proj-4.7.0/src/pj_malloc.c \
    proj-4.7.0/src/PJ_mbtfpp.c \
    proj-4.7.0/src/PJ_mbtfpq.c \
    proj-4.7.0/src/PJ_mbt_fps.c \
    proj-4.7.0/src/PJ_merc.c \
    proj-4.7.0/src/PJ_mill.c \
    proj-4.7.0/src/pj_mlfn.c \
    proj-4.7.0/src/PJ_mod_ster.c \
    proj-4.7.0/src/PJ_moll.c \
    proj-4.7.0/src/pj_msfn.c \
    proj-4.7.0/src/pj_mutex.c \
    proj-4.7.0/src/PJ_nell.c \
    proj-4.7.0/src/PJ_nell_h.c \
    proj-4.7.0/src/PJ_nocol.c \
    proj-4.7.0/src/PJ_nsper.c \
    proj-4.7.0/src/PJ_nzmg.c \
    proj-4.7.0/src/PJ_ob_tran.c \
    proj-4.7.0/src/PJ_ocea.c \
    proj-4.7.0/src/PJ_oea.c \
    proj-4.7.0/src/PJ_omerc.c \
    proj-4.7.0/src/pj_open_lib.c \
    proj-4.7.0/src/PJ_ortho.c \
    proj-4.7.0/src/pj_param.c \
    proj-4.7.0/src/pj_phi2.c \
    proj-4.7.0/src/PJ_poly.c \
    proj-4.7.0/src/pj_pr_list.c \
    proj-4.7.0/src/PJ_putp2.c \
    proj-4.7.0/src/PJ_putp3.c \
    proj-4.7.0/src/PJ_putp4p.c \
    proj-4.7.0/src/PJ_putp5.c \
    proj-4.7.0/src/PJ_putp6.c \
    proj-4.7.0/src/pj_qsfn.c \
    proj-4.7.0/src/pj_release.c \
    proj-4.7.0/src/PJ_robin.c \
    proj-4.7.0/src/PJ_rpoly.c \
    proj-4.7.0/src/PJ_sconics.c \
    proj-4.7.0/src/PJ_somerc.c \
    proj-4.7.0/src/PJ_sterea.c \
    proj-4.7.0/src/PJ_stere.c \
    proj-4.7.0/src/pj_strerrno.c \
    proj-4.7.0/src/PJ_sts.c \
    proj-4.7.0/src/PJ_tcc.c \
    proj-4.7.0/src/PJ_tcea.c \
    proj-4.7.0/src/PJ_tmerc.c \
    proj-4.7.0/src/PJ_tpeqd.c \
    proj-4.7.0/src/pj_transform.c \
    proj-4.7.0/src/pj_tsfn.c \
    proj-4.7.0/src/pj_units.c \
    proj-4.7.0/src/PJ_urm5.c \
    proj-4.7.0/src/PJ_urmfps.c \
    proj-4.7.0/src/pj_utils.c \
    proj-4.7.0/src/PJ_vandg2.c \
    proj-4.7.0/src/PJ_vandg4.c \
    proj-4.7.0/src/PJ_vandg.c \
    proj-4.7.0/src/PJ_wag2.c \
    proj-4.7.0/src/PJ_wag3.c \
    proj-4.7.0/src/PJ_wag7.c \
    proj-4.7.0/src/PJ_wink1.c \
    proj-4.7.0/src/PJ_wink2.c \
    proj-4.7.0/src/pj_zpoly1.c \
    proj-4.7.0/src/proj.c \
    proj-4.7.0/src/proj_mdist.c \
    proj-4.7.0/src/proj_rouss.c \
    proj-4.7.0/src/p_series.c \
    proj-4.7.0/src/rtodms.c \
    proj-4.7.0/src/vector1.c
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := spatialite
LOCAL_CFLAGS    := -D__ANDROID__ -DOMIT_GEOS=1 -Dfdatasync=fsync
LOCAL_C_INCLUDES := \
    libiconv-1.13.1/include \
    libiconv-1.13.1/libcharset/include \
    geos-3.2.2/source/headers \
    geos-3.2.2/capi \
    proj-4.7.0/src
LOCAL_SRC_FILES := \
    ./libspatialite-amalgamation-2.3.1/spatialite.c \
    ./libspatialite-amalgamation-2.3.1/sqlite3.c
LOCAL_STATIC_LIBRARIES := iconv proj
include $(BUILD_SHARED_LIBRARY)

With this you'll need to apply some small patches to the sources to get things pulling in the right headers. The Mac build was close but using -D_APPLE_ caused some other weirdness. I ended up just patching up the parts of libiconv and spatialite that I needed to:
diff --git a/android/jni/libiconv-1.13.1/libcharset/lib/localcharset.c b/android/jni/libiconv-1.13.1/libcharset/lib/localcharset.c
index 434fc7c..44b087d 100644
--- a/android/jni/libiconv-1.13.1/libcharset/lib/localcharset.c
+++ b/android/jni/libiconv-1.13.1/libcharset/lib/localcharset.c
@@ -44,7 +44,7 @@
 # endif
 #endif

-#if !defined WIN32_NATIVE
+#if !defined(WIN32_NATIVE) && !defined(__ANDROID__)
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 # else
@@ -328,7 +328,7 @@ locale_charset (void)
   const char *codeset;
   const char *aliases;

-#if !(defined WIN32_NATIVE || defined OS2)
+#if !(defined WIN32_NATIVE || defined OS2 || defined __ANDROID__)

 # if HAVE_LANGINFO_CODESET

diff --git a/android/jni/libspatialite-amalgamation-2.3.1/spatialite.c b/android/jni/libspatialite-amalgamation-2.3.1/spatialite.c
index 5fed6f0..d482ecc 100644
--- a/android/jni/libspatialite-amalgamation-2.3.1/spatialite.c
+++ b/android/jni/libspatialite-amalgamation-2.3.1/spatialite.c
@@ -72,7 +72,7 @@ extern const char * locale_charset (void);
 #include <localcharset.h>
 #endif /* end localcharset */
 #else /* not WINDOWS */
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__ANDROID__)
 #include <iconv.h>
 #include <localcharset.h>
 #else /* not Mac OsX */
@@ -7508,7 +7508,7 @@ gaiaCleanSqlString (char *value)
 #define LIBCHARSET_STATIC
 /* #include <localcharset.h> */
 #else /* not MINGW32 - WIN32 */
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__ANDROID__)
 /* #include <iconv.h> */
 /* #include <localcharset.h> */
 #else /* not Mac OsX */
@@ -7526,7 +7526,7 @@ gaiaGetLocaleCharset ()
 #if defined(__MINGW32__) || defined(_WIN32)
     return locale_charset ();
 #else /* not MINGW32 - WIN32 */
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__ANDROID__)
     return locale_charset ();
 #else /* not Mac OsX */
     return nl_langinfo (CODESET);
@@ -13896,7 +13896,7 @@ gaiaPolygonize (gaiaGeomCollPtr geom_org, int force_multipolygon)
 #define LIBCHARSET_STATIC
 /* #include <localcharset.h> */
 #else /* not MINGW32 */
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__ANDROID__)
 /* #include <iconv.h> */
 /* #include <localcharset.h> */
 #else /* not Mac OsX */

And here's the output:
mark@beast:~/Code/android-spatialite/jni$ ndk-build
Compile thumb  : spatialite <= spatialite.c
Compile thumb  : spatialite <= sqlite3.c
/home/mark/Code/android-spatialite/jni/./libspatialite-amalgamation-2.3.1/sqlite3.c: In function 'unixDlError':
/home/mark/Code/android-spatialite/jni/./libspatialite-amalgamation-2.3.1/sqlite3.c:24986: warning: assignment discards qualifiers from pointer target type
Compile thumb  : iconv <= iconv.c
Compile thumb  : iconv <= relocatable.c
Compile thumb  : iconv <= localcharset.c
StaticLibrary  : libiconv.a
Compile thumb  : proj <= aasincos.c
Compile thumb  : proj <= adjlon.c
Compile thumb  : proj <= bch2bps.c
Compile thumb  : proj <= bchgen.c
Compile thumb  : proj <= biveval.c
Compile thumb  : proj <= cs2cs.c
Compile thumb  : proj <= dmstor.c
Compile thumb  : proj <= emess.c
Compile thumb  : proj <= gen_cheb.c
Compile thumb  : proj <= geocent.c
Compile thumb  : proj <= geod.c
Compile thumb  : proj <= geod_for.c
Compile thumb  : proj <= geod_inv.c
Compile thumb  : proj <= geod_set.c
Compile thumb  : proj <= jniproj.c
Compile thumb  : proj <= mk_cheby.c
Compile thumb  : proj <= nad2bin.c
Compile thumb  : proj <= nad2nad.c
Compile thumb  : proj <= nad_cvt.c
Compile thumb  : proj <= nad_init.c
Compile thumb  : proj <= nad_intr.c
Compile thumb  : proj <= PJ_aea.c
Compile thumb  : proj <= PJ_aeqd.c
Compile thumb  : proj <= PJ_airy.c
Compile thumb  : proj <= PJ_aitoff.c
Compile thumb  : proj <= pj_apply_gridshift.c
Compile thumb  : proj <= PJ_august.c
Compile thumb  : proj <= pj_auth.c
Compile thumb  : proj <= PJ_bacon.c
Compile thumb  : proj <= PJ_bipc.c
Compile thumb  : proj <= PJ_boggs.c
Compile thumb  : proj <= PJ_bonne.c
Compile thumb  : proj <= PJ_cass.c
Compile thumb  : proj <= PJ_cc.c
Compile thumb  : proj <= PJ_cea.c
Compile thumb  : proj <= PJ_chamb.c
Compile thumb  : proj <= PJ_collg.c
Compile thumb  : proj <= PJ_crast.c
Compile thumb  : proj <= pj_datums.c
Compile thumb  : proj <= pj_datum_set.c
Compile thumb  : proj <= PJ_denoy.c
Compile thumb  : proj <= pj_deriv.c
Compile thumb  : proj <= PJ_eck1.c
Compile thumb  : proj <= PJ_eck2.c
Compile thumb  : proj <= PJ_eck3.c
Compile thumb  : proj <= PJ_eck4.c
Compile thumb  : proj <= PJ_eck5.c
Compile thumb  : proj <= pj_ellps.c
Compile thumb  : proj <= pj_ell_set.c
Compile thumb  : proj <= PJ_eqc.c
Compile thumb  : proj <= PJ_eqdc.c
Compile thumb  : proj <= pj_errno.c
Compile thumb  : proj <= pj_factors.c
Compile thumb  : proj <= PJ_fahey.c
Compile thumb  : proj <= PJ_fouc_s.c
Compile thumb  : proj <= pj_fwd.c
Compile thumb  : proj <= PJ_gall.c
Compile thumb  : proj <= pj_gauss.c
Compile thumb  : proj <= pj_geocent.c
Compile thumb  : proj <= PJ_geos.c
Compile thumb  : proj <= PJ_gins8.c
Compile thumb  : proj <= PJ_gnom.c
Compile thumb  : proj <= PJ_gn_sinu.c
Compile thumb  : proj <= PJ_goode.c
Compile thumb  : proj <= pj_gridinfo.c
Compile thumb  : proj <= pj_gridlist.c
Compile thumb  : proj <= PJ_gstmerc.c
Compile thumb  : proj <= PJ_hammer.c
Compile thumb  : proj <= PJ_hatano.c
Compile thumb  : proj <= PJ_imw_p.c
Compile thumb  : proj <= pj_init.c
Compile thumb  : proj <= pj_initcache.c
Compile thumb  : proj <= pj_inv.c
Compile thumb  : proj <= PJ_krovak.c
Compile thumb  : proj <= PJ_labrd.c
Compile thumb  : proj <= PJ_laea.c
Compile thumb  : proj <= PJ_lagrng.c
Compile thumb  : proj <= PJ_larr.c
Compile thumb  : proj <= PJ_lask.c
Compile thumb  : proj <= pj_latlong.c
Compile thumb  : proj <= PJ_lcca.c
Compile thumb  : proj <= PJ_lcc.c
Compile thumb  : proj <= pj_list.c
Compile thumb  : proj <= PJ_loxim.c
Compile thumb  : proj <= PJ_lsat.c
Compile thumb  : proj <= pj_malloc.c
Compile thumb  : proj <= PJ_mbtfpp.c
Compile thumb  : proj <= PJ_mbtfpq.c
Compile thumb  : proj <= PJ_mbt_fps.c
Compile thumb  : proj <= PJ_merc.c
Compile thumb  : proj <= PJ_mill.c
Compile thumb  : proj <= pj_mlfn.c
Compile thumb  : proj <= PJ_mod_ster.c
Compile thumb  : proj <= PJ_moll.c
Compile thumb  : proj <= pj_msfn.c
Compile thumb  : proj <= pj_mutex.c
Compile thumb  : proj <= PJ_nell.c
Compile thumb  : proj <= PJ_nell_h.c
Compile thumb  : proj <= PJ_nocol.c
Compile thumb  : proj <= PJ_nsper.c
Compile thumb  : proj <= PJ_nzmg.c
Compile thumb  : proj <= PJ_ob_tran.c
Compile thumb  : proj <= PJ_ocea.c
Compile thumb  : proj <= PJ_oea.c
Compile thumb  : proj <= PJ_omerc.c
Compile thumb  : proj <= pj_open_lib.c
Compile thumb  : proj <= PJ_ortho.c
Compile thumb  : proj <= pj_param.c
Compile thumb  : proj <= pj_phi2.c
Compile thumb  : proj <= PJ_poly.c
Compile thumb  : proj <= pj_pr_list.c
Compile thumb  : proj <= PJ_putp2.c
Compile thumb  : proj <= PJ_putp3.c
Compile thumb  : proj <= PJ_putp4p.c
Compile thumb  : proj <= PJ_putp5.c
Compile thumb  : proj <= PJ_putp6.c
Compile thumb  : proj <= pj_qsfn.c
Compile thumb  : proj <= pj_release.c
Compile thumb  : proj <= PJ_robin.c
Compile thumb  : proj <= PJ_rpoly.c
Compile thumb  : proj <= PJ_sconics.c
Compile thumb  : proj <= PJ_somerc.c
Compile thumb  : proj <= PJ_sterea.c
Compile thumb  : proj <= PJ_stere.c
Compile thumb  : proj <= pj_strerrno.c
Compile thumb  : proj <= PJ_sts.c
Compile thumb  : proj <= PJ_tcc.c
Compile thumb  : proj <= PJ_tcea.c
Compile thumb  : proj <= PJ_tmerc.c
Compile thumb  : proj <= PJ_tpeqd.c
Compile thumb  : proj <= pj_transform.c
Compile thumb  : proj <= pj_tsfn.c
Compile thumb  : proj <= pj_units.c
Compile thumb  : proj <= PJ_urm5.c
Compile thumb  : proj <= PJ_urmfps.c
Compile thumb  : proj <= pj_utils.c
Compile thumb  : proj <= PJ_vandg2.c
Compile thumb  : proj <= PJ_vandg4.c
Compile thumb  : proj <= PJ_vandg.c
Compile thumb  : proj <= PJ_wag2.c
Compile thumb  : proj <= PJ_wag3.c
Compile thumb  : proj <= PJ_wag7.c
Compile thumb  : proj <= PJ_wink1.c
Compile thumb  : proj <= PJ_wink2.c
Compile thumb  : proj <= pj_zpoly1.c
Compile thumb  : proj <= proj.c
Compile thumb  : proj <= proj_mdist.c
Compile thumb  : proj <= proj_rouss.c
Compile thumb  : proj <= p_series.c
Compile thumb  : proj <= rtodms.c
Compile thumb  : proj <= vector1.c
StaticLibrary  : libproj.a
SharedLibrary  : libspatialite.so
Install        : libspatialite.so => libs/armeabi/libspatialite.so

The resulting library:
$ ls -l ../libs/armeabi/libspatialite.so
-rwxr-xr-x 1 mark mark 1560744 2011-03-13 22:23 ../libs/armeabi/libspatialite.so

Comment: I created a GitHub project to make it a bit easier for others to test this.
https://github.com/mrenouf/android-spatialite
Comment: Wow, thanks for working on this! I've spent the last 48 hours looking into this and got as far as getting libspatialite.so compiled and running in an activity, but it would SIGSEGV whenever I tried to use spatialite functions in sqlite. I'll try this and let you know!
Comment: I've seen references to some "hacks" needed to enable extension loading, but nobody has documented these. AFAIK extension loading is off by default on Android, right?
Comment: Yes. I had to compile my own libsqlite3.so library and jsqlite classes. Can you tell me what environment variables or arguments you gave to ./configure for proj4, iconv, and spatialite?
Comment: None. I suspect that may be the cause of some issues? Though the generated Makefiles are not actually used. All of the CFLAGS and LDFLAGS are specified in Android.mk.
Comment: I added a full Android project structure to my GitHub repo, could you provide the Java side of this and the JNI stubs to build? Also, I was under the impresstion that spatialite now contains a complete standalone sqlite implementation, in addition to being usable as an extension. Is it possible to just link against it, and leave out jsqlite? I'm thinking the library could be used with sources take from AOSP just substituting libspatialite im place of sqlite?
Comment: When I was poking around it looked like ./configure set up some header files that were used in the ndk-build process. I'm wondering if having those generated with your development system (instead of Android) as the target will break it. Will give it a try, though!
Comment: Re: AOSP -- https://github.com/android/platform_frameworks_base/tree/master/core/java/android/database/sqlite AND https://github.com/android/platform_frameworks_base/blob/master/core/jni/android_database_SQLiteDatabase.cpp etc...
Comment: Nevermind, I see now how everything is compiled into one monolithic android_runtime library and loaded before an app is ever started, which makes it impossible to replace the native impl of anything in android.* code.
Comment: FYI, I'm also looking into http://code.google.com/p/sqlite4java/ (home on a sickday so I get some time to hack a bit ;-))
Comment: Looks like I'm getting a SIGSEGV again. See the fork on your github project for the code I added to get it to run in an activity.
Comment: AH! I take that back! I got it running. I had to explicitly import the libspatialite.so as an SQL command.
Comment: Isn't it violate LGPL to link statically one LGPL library (libiconv) to other LGPL library (spatialite) ?
Answer: So I noticed there were some issues with Spatialite 2.3.1 and GEOS 3.1.1. The following query always returned 0.0 for some reason.
select Distance(geomfromtext('point(60 60)', 4326), geomfromtext('point(59 60)', 4326));

Anyways, I retrieved Spatialite 2.4.0 RC4, GEOS 3.2.2, iconv 1.13.1, proj 4.6.1 and applied the code changes to iconv and Spatialite.  I was able to successfully compile and run the code on Android 2.2 with the following Android.mk:
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# ./configure --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
LOCAL_MODULE := iconv
LOCAL_CFLAGS := \
    -Wno-multichar \
    -D_ANDROID \
    -DBUILDING_LIBICONV \
    -DIN_LIBRARY \
    -DLIBDIR="\"/usr/local/android-libs/usr/local/lib\""
LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/libiconv-1.13.1 \
    $(LOCAL_PATH)/libiconv-1.13.1/include \
    $(LOCAL_PATH)/libiconv-1.13.1/lib \
    $(LOCAL_PATH)/libiconv-1.13.1/libcharset/include
LOCAL_SRC_FILES := \
    libiconv-1.13.1/lib/iconv.c \
    libiconv-1.13.1/lib/relocatable.c \
    libiconv-1.13.1/lib/empty.cpp \
    libiconv-1.13.1/libcharset/lib/localcharset.c
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
# ./configure --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
# find proj-4.6.1/ -name "*.c" | grep -Ev "tests|doc" | sort | awk '{ print "\t"$1" \\" }'
LOCAL_MODULE    := proj
LOCAL_C_INCLUDES := $(LOCAL_PATH)/proj-4.6.1/src
LOCAL_LDLIBS := -lm
LOCAL_SRC_FILES := \
    proj-4.6.1/src/empty.cpp \
    proj-4.6.1/src/aasincos.c \
    proj-4.6.1/src/adjlon.c \
    proj-4.6.1/src/bch2bps.c \
    proj-4.6.1/src/bchgen.c \
    proj-4.6.1/src/biveval.c \
    proj-4.6.1/src/dmstor.c \
    proj-4.6.1/src/emess.c \
    proj-4.6.1/src/gen_cheb.c \
    proj-4.6.1/src/geocent.c \
    proj-4.6.1/src/geod_for.c \
    proj-4.6.1/src/geod_inv.c \
    proj-4.6.1/src/geod_set.c \
    proj-4.6.1/src/jniproj.c \
    proj-4.6.1/src/mk_cheby.c \
    proj-4.6.1/src/nad_cvt.c \
    proj-4.6.1/src/nad_init.c \
    proj-4.6.1/src/nad_intr.c \
    proj-4.6.1/src/PJ_aea.c \
    proj-4.6.1/src/PJ_aeqd.c \
    proj-4.6.1/src/PJ_airy.c \
    proj-4.6.1/src/PJ_aitoff.c \
    proj-4.6.1/src/pj_apply_gridshift.c \
    proj-4.6.1/src/PJ_august.c \
    proj-4.6.1/src/pj_auth.c \
    proj-4.6.1/src/PJ_bacon.c \
    proj-4.6.1/src/PJ_bipc.c \
    proj-4.6.1/src/PJ_boggs.c \
    proj-4.6.1/src/PJ_bonne.c \
    proj-4.6.1/src/PJ_cass.c \
    proj-4.6.1/src/PJ_cc.c \
    proj-4.6.1/src/PJ_cea.c \
    proj-4.6.1/src/PJ_chamb.c \
    proj-4.6.1/src/PJ_collg.c \
    proj-4.6.1/src/PJ_crast.c \
    proj-4.6.1/src/pj_datums.c \
    proj-4.6.1/src/pj_datum_set.c \
    proj-4.6.1/src/PJ_denoy.c \
    proj-4.6.1/src/pj_deriv.c \
    proj-4.6.1/src/PJ_eck1.c \
    proj-4.6.1/src/PJ_eck2.c \
    proj-4.6.1/src/PJ_eck3.c \
    proj-4.6.1/src/PJ_eck4.c \
    proj-4.6.1/src/PJ_eck5.c \
    proj-4.6.1/src/pj_ellps.c \
    proj-4.6.1/src/pj_ell_set.c \
    proj-4.6.1/src/PJ_eqc.c \
    proj-4.6.1/src/PJ_eqdc.c \
    proj-4.6.1/src/pj_errno.c \
    proj-4.6.1/src/pj_factors.c \
    proj-4.6.1/src/PJ_fahey.c \
    proj-4.6.1/src/PJ_fouc_s.c \
    proj-4.6.1/src/pj_fwd.c \
    proj-4.6.1/src/PJ_gall.c \
    proj-4.6.1/src/pj_gauss.c \
    proj-4.6.1/src/pj_geocent.c \
    proj-4.6.1/src/PJ_geos.c \
    proj-4.6.1/src/PJ_gins8.c \
    proj-4.6.1/src/PJ_gnom.c \
    proj-4.6.1/src/PJ_gn_sinu.c \
    proj-4.6.1/src/PJ_goode.c \
    proj-4.6.1/src/pj_gridinfo.c \
    proj-4.6.1/src/pj_gridlist.c \
    proj-4.6.1/src/PJ_gstmerc.c \
    proj-4.6.1/src/PJ_hammer.c \
    proj-4.6.1/src/PJ_hatano.c \
    proj-4.6.1/src/PJ_imw_p.c \
    proj-4.6.1/src/pj_init.c \
    proj-4.6.1/src/pj_inv.c \
    proj-4.6.1/src/PJ_krovak.c \
    proj-4.6.1/src/PJ_labrd.c \
    proj-4.6.1/src/PJ_laea.c \
    proj-4.6.1/src/PJ_lagrng.c \
    proj-4.6.1/src/PJ_larr.c \
    proj-4.6.1/src/PJ_lask.c \
    proj-4.6.1/src/pj_latlong.c \
    proj-4.6.1/src/PJ_lcca.c \
    proj-4.6.1/src/PJ_lcc.c \
    proj-4.6.1/src/pj_list.c \
    proj-4.6.1/src/PJ_loxim.c \
    proj-4.6.1/src/PJ_lsat.c \
    proj-4.6.1/src/pj_malloc.c \
    proj-4.6.1/src/PJ_mbtfpp.c \
    proj-4.6.1/src/PJ_mbtfpq.c \
    proj-4.6.1/src/PJ_mbt_fps.c \
    proj-4.6.1/src/PJ_merc.c \
    proj-4.6.1/src/PJ_mill.c \
    proj-4.6.1/src/pj_mlfn.c \
    proj-4.6.1/src/PJ_mod_ster.c \
    proj-4.6.1/src/PJ_moll.c \
    proj-4.6.1/src/pj_msfn.c \
    proj-4.6.1/src/PJ_nell.c \
    proj-4.6.1/src/PJ_nell_h.c \
    proj-4.6.1/src/PJ_nocol.c \
    proj-4.6.1/src/PJ_nsper.c \
    proj-4.6.1/src/PJ_nzmg.c \
    proj-4.6.1/src/PJ_ob_tran.c \
    proj-4.6.1/src/PJ_ocea.c \
    proj-4.6.1/src/PJ_oea.c \
    proj-4.6.1/src/PJ_omerc.c \
    proj-4.6.1/src/pj_open_lib.c \
    proj-4.6.1/src/PJ_ortho.c \
    proj-4.6.1/src/pj_param.c \
    proj-4.6.1/src/pj_phi2.c \
    proj-4.6.1/src/PJ_poly.c \
    proj-4.6.1/src/pj_pr_list.c \
    proj-4.6.1/src/PJ_putp2.c \
    proj-4.6.1/src/PJ_putp3.c \
    proj-4.6.1/src/PJ_putp4p.c \
    proj-4.6.1/src/PJ_putp5.c \
    proj-4.6.1/src/PJ_putp6.c \
    proj-4.6.1/src/pj_qsfn.c \
    proj-4.6.1/src/pj_release.c \
    proj-4.6.1/src/PJ_robin.c \
    proj-4.6.1/src/PJ_rpoly.c \
    proj-4.6.1/src/PJ_sconics.c \
    proj-4.6.1/src/PJ_somerc.c \
    proj-4.6.1/src/PJ_sterea.c \
    proj-4.6.1/src/PJ_stere.c \
    proj-4.6.1/src/pj_strerrno.c \
    proj-4.6.1/src/PJ_sts.c \
    proj-4.6.1/src/PJ_tcc.c \
    proj-4.6.1/src/PJ_tcea.c \
    proj-4.6.1/src/PJ_tmerc.c \
    proj-4.6.1/src/PJ_tpeqd.c \
    proj-4.6.1/src/pj_transform.c \
    proj-4.6.1/src/pj_tsfn.c \
    proj-4.6.1/src/pj_units.c \
    proj-4.6.1/src/PJ_urm5.c \
    proj-4.6.1/src/PJ_urmfps.c \
    proj-4.6.1/src/pj_utils.c \
    proj-4.6.1/src/PJ_vandg2.c \
    proj-4.6.1/src/PJ_vandg4.c \
    proj-4.6.1/src/PJ_vandg.c \
    proj-4.6.1/src/PJ_wag2.c \
    proj-4.6.1/src/PJ_wag3.c \
    proj-4.6.1/src/PJ_wag7.c \
    proj-4.6.1/src/PJ_wink1.c \
    proj-4.6.1/src/PJ_wink2.c \
    proj-4.6.1/src/pj_zpoly1.c \
    proj-4.6.1/src/proj.c \
    proj-4.6.1/src/proj_mdist.c \
    proj-4.6.1/src/proj_rouss.c \
    proj-4.6.1/src/p_series.c \
    proj-4.6.1/src/rtodms.c \
    proj-4.6.1/src/vector1.c
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
# ./configure --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
# find geos-3.2.2/ -name "*.cpp" | grep -Ev "tests|doc" | sort | awk '{ print "\t"$1" \\" }'
LOCAL_MODULE := geos
LOCAL_C_INCLUDES := $(LOCAL_PATH)/geos-3.2.2/source/headers
LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%)
LOCAL_SRC_FILES := \
    geos-3.2.2/capi/geos_c.cpp \
    geos-3.2.2/capi/geos_ts_c.cpp \
    geos-3.2.2/source/algorithm/Angle.cpp \
    geos-3.2.2/source/algorithm/BoundaryNodeRule.cpp \
    geos-3.2.2/source/algorithm/CentroidArea.cpp \
    geos-3.2.2/source/algorithm/CentroidLine.cpp \
    geos-3.2.2/source/algorithm/CentroidPoint.cpp \
    geos-3.2.2/source/algorithm/CGAlgorithms.cpp \
    geos-3.2.2/source/algorithm/ConvexHull.cpp \
    geos-3.2.2/source/algorithm/distance/DiscreteHausdorffDistance.cpp \
    geos-3.2.2/source/algorithm/distance/DistanceToPoint.cpp \
    geos-3.2.2/source/algorithm/HCoordinate.cpp \
    geos-3.2.2/source/algorithm/InteriorPointArea.cpp \
    geos-3.2.2/source/algorithm/InteriorPointLine.cpp \
    geos-3.2.2/source/algorithm/InteriorPointPoint.cpp \
    geos-3.2.2/source/algorithm/LineIntersector.cpp \
    geos-3.2.2/source/algorithm/locate/IndexedPointInAreaLocator.cpp \
    geos-3.2.2/source/algorithm/locate/PointOnGeometryLocator.cpp \
    geos-3.2.2/source/algorithm/locate/SimplePointInAreaLocator.cpp \
    geos-3.2.2/source/algorithm/MCPointInRing.cpp \
    geos-3.2.2/source/algorithm/MinimumDiameter.cpp \
    geos-3.2.2/source/algorithm/NotRepresentableException.cpp \
    geos-3.2.2/source/algorithm/PointLocator.cpp \
    geos-3.2.2/source/algorithm/RayCrossingCounter.cpp \
    geos-3.2.2/source/algorithm/RobustDeterminant.cpp \
    geos-3.2.2/source/algorithm/SimplePointInRing.cpp \
    geos-3.2.2/source/algorithm/SIRtreePointInRing.cpp \
    geos-3.2.2/source/geom/CoordinateArraySequence.cpp \
    geos-3.2.2/source/geom/CoordinateArraySequenceFactory.cpp \
    geos-3.2.2/source/geom/Coordinate.cpp \
    geos-3.2.2/source/geom/CoordinateSequence.cpp \
    geos-3.2.2/source/geom/CoordinateSequenceFactory.cpp \
    geos-3.2.2/source/geom/Dimension.cpp \
    geos-3.2.2/source/geom/Envelope.cpp \
    geos-3.2.2/source/geom/GeometryCollection.cpp \
    geos-3.2.2/source/geom/GeometryComponentFilter.cpp \
    geos-3.2.2/source/geom/Geometry.cpp \
    geos-3.2.2/source/geom/GeometryFactory.cpp \
    geos-3.2.2/source/geom/GeometryList.cpp \
    geos-3.2.2/source/geomgraph/Depth.cpp \
    geos-3.2.2/source/geomgraph/DirectedEdge.cpp \
    geos-3.2.2/source/geomgraph/DirectedEdgeStar.cpp \
    geos-3.2.2/source/geomgraph/Edge.cpp \
    geos-3.2.2/source/geomgraph/EdgeEnd.cpp \
    geos-3.2.2/source/geomgraph/EdgeEndStar.cpp \
    geos-3.2.2/source/geomgraph/EdgeIntersection.cpp \
    geos-3.2.2/source/geomgraph/EdgeIntersectionList.cpp \
    geos-3.2.2/source/geomgraph/EdgeList.cpp \
    geos-3.2.2/source/geomgraph/EdgeNodingValidator.cpp \
    geos-3.2.2/source/geomgraph/EdgeRing.cpp \
    geos-3.2.2/source/geomgraph/GeometryGraph.cpp \
    geos-3.2.2/source/geomgraph/GraphComponent.cpp \
    geos-3.2.2/source/geomgraph/index/MonotoneChainEdge.cpp \
    geos-3.2.2/source/geomgraph/index/MonotoneChainIndexer.cpp \
    geos-3.2.2/source/geomgraph/index/SegmentIntersector.cpp \
    geos-3.2.2/source/geomgraph/index/SimpleEdgeSetIntersector.cpp \
    geos-3.2.2/source/geomgraph/index/SimpleMCSweepLineIntersector.cpp \
    geos-3.2.2/source/geomgraph/index/SimpleSweepLineIntersector.cpp \
    geos-3.2.2/source/geomgraph/index/SweepLineEvent.cpp \
    geos-3.2.2/source/geomgraph/index/SweepLineSegment.cpp \
    geos-3.2.2/source/geomgraph/Label.cpp \
    geos-3.2.2/source/geomgraph/Node.cpp \
    geos-3.2.2/source/geomgraph/NodeFactory.cpp \
    geos-3.2.2/source/geomgraph/NodeMap.cpp \
    geos-3.2.2/source/geomgraph/PlanarGraph.cpp \
    geos-3.2.2/source/geomgraph/Position.cpp \
    geos-3.2.2/source/geomgraph/Quadrant.cpp \
    geos-3.2.2/source/geomgraph/TopologyLocation.cpp \
    geos-3.2.2/source/geom/IntersectionMatrix.cpp \
    geos-3.2.2/source/geom/LinearRing.cpp \
    geos-3.2.2/source/geom/LineSegment.cpp \
    geos-3.2.2/source/geom/LineString.cpp \
    geos-3.2.2/source/geom/Location.cpp \
    geos-3.2.2/source/geom/MultiLineString.cpp \
    geos-3.2.2/source/geom/MultiPoint.cpp \
    geos-3.2.2/source/geom/MultiPolygon.cpp \
    geos-3.2.2/source/geom/Point.cpp \
    geos-3.2.2/source/geom/Polygon.cpp \
    geos-3.2.2/source/geom/PrecisionModel.cpp \
    geos-3.2.2/source/geom/prep/AbstractPreparedPolygonContains.cpp \
    geos-3.2.2/source/geom/prep/BasicPreparedGeometry.cpp \
    geos-3.2.2/source/geom/prep/PreparedGeometry.cpp \
    geos-3.2.2/source/geom/prep/PreparedGeometryFactory.cpp \
    geos-3.2.2/source/geom/prep/PreparedLineString.cpp \
    geos-3.2.2/source/geom/prep/PreparedLineStringIntersects.cpp \
    geos-3.2.2/source/geom/prep/PreparedPoint.cpp \
    geos-3.2.2/source/geom/prep/PreparedPolygonContains.cpp \
    geos-3.2.2/source/geom/prep/PreparedPolygonContainsProperly.cpp \
    geos-3.2.2/source/geom/prep/PreparedPolygonCovers.cpp \
    geos-3.2.2/source/geom/prep/PreparedPolygon.cpp \
    geos-3.2.2/source/geom/prep/PreparedPolygonIntersects.cpp \
    geos-3.2.2/source/geom/prep/PreparedPolygonPredicate.cpp \
    geos-3.2.2/source/geom/Triangle.cpp \
    geos-3.2.2/source/geom/util/ComponentCoordinateExtracter.cpp \
    geos-3.2.2/source/geom/util/CoordinateOperation.cpp \
    geos-3.2.2/source/geom/util/GeometryCombiner.cpp \
    geos-3.2.2/source/geom/util/GeometryEditor.cpp \
    geos-3.2.2/source/geom/util/GeometryTransformer.cpp \
    geos-3.2.2/source/geom/util/ShortCircuitedGeometryVisitor.cpp \
    geos-3.2.2/source/index/bintree/Bintree.cpp \
    geos-3.2.2/source/index/bintree/Interval.cpp \
    geos-3.2.2/source/index/bintree/Key.cpp \
    geos-3.2.2/source/index/bintree/NodeBase.cpp \
    geos-3.2.2/source/index/bintree/Node.cpp \
    geos-3.2.2/source/index/bintree/Root.cpp \
    geos-3.2.2/source/index/chain/MonotoneChainBuilder.cpp \
    geos-3.2.2/source/index/chain/MonotoneChain.cpp \
    geos-3.2.2/source/index/chain/MonotoneChainOverlapAction.cpp \
    geos-3.2.2/source/index/chain/MonotoneChainSelectAction.cpp \
    geos-3.2.2/source/index/intervalrtree/IntervalRTreeBranchNode.cpp \
    geos-3.2.2/source/index/intervalrtree/IntervalRTreeLeafNode.cpp \
    geos-3.2.2/source/index/intervalrtree/IntervalRTreeNode.cpp \
    geos-3.2.2/source/index/intervalrtree/SortedPackedIntervalRTree.cpp \
    geos-3.2.2/source/index/quadtree/DoubleBits.cpp \
    geos-3.2.2/source/index/quadtree/IntervalSize.cpp \
    geos-3.2.2/source/index/quadtree/Key.cpp \
    geos-3.2.2/source/index/quadtree/NodeBase.cpp \
    geos-3.2.2/source/index/quadtree/Node.cpp \
    geos-3.2.2/source/index/quadtree/Quadtree.cpp \
    geos-3.2.2/source/index/quadtree/Root.cpp \
    geos-3.2.2/source/index/strtree/AbstractNode.cpp \
    geos-3.2.2/source/index/strtree/AbstractSTRtree.cpp \
    geos-3.2.2/source/index/strtree/Interval.cpp \
    geos-3.2.2/source/index/strtree/ItemBoundable.cpp \
    geos-3.2.2/source/index/strtree/SIRtree.cpp \
    geos-3.2.2/source/index/strtree/STRtree.cpp \
    geos-3.2.2/source/index/sweepline/SweepLineEvent.cpp \
    geos-3.2.2/source/index/sweepline/SweepLineIndex.cpp \
    geos-3.2.2/source/index/sweepline/SweepLineInterval.cpp \
    geos-3.2.2/source/inlines.cpp \
    geos-3.2.2/source/io/ByteOrderDataInStream.cpp \
    geos-3.2.2/source/io/ByteOrderValues.cpp \
    geos-3.2.2/source/io/CLocalizer.cpp \
    geos-3.2.2/source/io/ParseException.cpp \
    geos-3.2.2/source/io/StringTokenizer.cpp \
    geos-3.2.2/source/io/Unload.cpp \
    geos-3.2.2/source/io/WKBReader.cpp \
    geos-3.2.2/source/io/WKBWriter.cpp \
    geos-3.2.2/source/io/WKTReader.cpp \
    geos-3.2.2/source/io/WKTWriter.cpp \
    geos-3.2.2/source/io/Writer.cpp \
    geos-3.2.2/source/linearref/ExtractLineByLocation.cpp \
    geos-3.2.2/source/linearref/LengthIndexedLine.cpp \
    geos-3.2.2/source/linearref/LengthIndexOfPoint.cpp \
    geos-3.2.2/source/linearref/LengthLocationMap.cpp \
    geos-3.2.2/source/linearref/LinearGeometryBuilder.cpp \
    geos-3.2.2/source/linearref/LinearIterator.cpp \
    geos-3.2.2/source/linearref/LinearLocation.cpp \
    geos-3.2.2/source/linearref/LocationIndexOfLine.cpp \
    geos-3.2.2/source/linearref/LocationIndexOfPoint.cpp \
    geos-3.2.2/source/noding/BasicSegmentString.cpp \
    geos-3.2.2/source/noding/FastNodingValidator.cpp \
    geos-3.2.2/source/noding/FastSegmentSetIntersectionFinder.cpp \
    geos-3.2.2/source/noding/IntersectionAdder.cpp \
    geos-3.2.2/source/noding/IntersectionFinderAdder.cpp \
    geos-3.2.2/source/noding/IteratedNoder.cpp \
    geos-3.2.2/source/noding/MCIndexNoder.cpp \
    geos-3.2.2/source/noding/MCIndexSegmentSetMutualIntersector.cpp \
    geos-3.2.2/source/noding/NodedSegmentString.cpp \
    geos-3.2.2/source/noding/NodingValidator.cpp \
    geos-3.2.2/source/noding/Octant.cpp \
    geos-3.2.2/source/noding/OrientedCoordinateArray.cpp \
    geos-3.2.2/source/noding/ScaledNoder.cpp \
    geos-3.2.2/source/noding/SegmentIntersectionDetector.cpp \
    geos-3.2.2/source/noding/SegmentNode.cpp \
    geos-3.2.2/source/noding/SegmentNodeList.cpp \
    geos-3.2.2/source/noding/SegmentString.cpp \
    geos-3.2.2/source/noding/SegmentStringUtil.cpp \
    geos-3.2.2/source/noding/SimpleNoder.cpp \
    geos-3.2.2/source/noding/SingleInteriorIntersectionFinder.cpp \
    geos-3.2.2/source/noding/snapround/HotPixel.cpp \
    geos-3.2.2/source/noding/snapround/MCIndexPointSnapper.cpp \
    geos-3.2.2/source/noding/snapround/MCIndexSnapRounder.cpp \
    geos-3.2.2/source/noding/snapround/SimpleSnapRounder.cpp \
    geos-3.2.2/source/operation/buffer/BufferBuilder.cpp \
    geos-3.2.2/source/operation/buffer/BufferInputLineSimplifier.cpp \
    geos-3.2.2/source/operation/buffer/BufferOp.cpp \
    geos-3.2.2/source/operation/buffer/BufferParameters.cpp \
    geos-3.2.2/source/operation/buffer/BufferSubgraph.cpp \
    geos-3.2.2/source/operation/buffer/OffsetCurveBuilder.cpp \
    geos-3.2.2/source/operation/buffer/OffsetCurveSetBuilder.cpp \
    geos-3.2.2/source/operation/buffer/RightmostEdgeFinder.cpp \
    geos-3.2.2/source/operation/buffer/SubgraphDepthLocater.cpp \
    geos-3.2.2/source/operation/distance/ConnectedElementLocationFilter.cpp \
    geos-3.2.2/source/operation/distance/ConnectedElementPointFilter.cpp \
    geos-3.2.2/source/operation/distance/DistanceOp.cpp \
    geos-3.2.2/source/operation/distance/GeometryLocation.cpp \
    geos-3.2.2/source/operation/GeometryGraphOperation.cpp \
    geos-3.2.2/source/operation/IsSimpleOp.cpp \
    geos-3.2.2/source/operation/linemerge/EdgeString.cpp \
    geos-3.2.2/source/operation/linemerge/LineMergeDirectedEdge.cpp \
    geos-3.2.2/source/operation/linemerge/LineMergeEdge.cpp \
    geos-3.2.2/source/operation/linemerge/LineMergeGraph.cpp \
    geos-3.2.2/source/operation/linemerge/LineMerger.cpp \
    geos-3.2.2/source/operation/linemerge/LineSequencer.cpp \
    geos-3.2.2/source/operation/overlay/EdgeSetNoder.cpp \
    geos-3.2.2/source/operation/overlay/ElevationMatrixCell.cpp \
    geos-3.2.2/source/operation/overlay/ElevationMatrix.cpp \
    geos-3.2.2/source/operation/overlay/LineBuilder.cpp \
    geos-3.2.2/source/operation/overlay/MaximalEdgeRing.cpp \
    geos-3.2.2/source/operation/overlay/MinimalEdgeRing.cpp \
    geos-3.2.2/source/operation/overlay/OverlayNodeFactory.cpp \
    geos-3.2.2/source/operation/overlay/OverlayOp.cpp \
    geos-3.2.2/source/operation/overlay/PointBuilder.cpp \
    geos-3.2.2/source/operation/overlay/PolygonBuilder.cpp \
    geos-3.2.2/source/operation/overlay/snap/GeometrySnapper.cpp \
    geos-3.2.2/source/operation/overlay/snap/LineStringSnapper.cpp \
    geos-3.2.2/source/operation/overlay/snap/SnapIfNeededOverlayOp.cpp \
    geos-3.2.2/source/operation/overlay/snap/SnapOverlayOp.cpp \
    geos-3.2.2/source/operation/overlay/validate/FuzzyPointLocator.cpp \
    geos-3.2.2/source/operation/overlay/validate/OffsetPointGenerator.cpp \
    geos-3.2.2/source/operation/overlay/validate/OverlayResultValidator.cpp \
    geos-3.2.2/source/operation/polygonize/EdgeRing.cpp \
    geos-3.2.2/source/operation/polygonize/PolygonizeDirectedEdge.cpp \
    geos-3.2.2/source/operation/polygonize/PolygonizeEdge.cpp \
    geos-3.2.2/source/operation/polygonize/PolygonizeGraph.cpp \
    geos-3.2.2/source/operation/polygonize/Polygonizer.cpp \
    geos-3.2.2/source/operation/predicate/RectangleContains.cpp \
    geos-3.2.2/source/operation/predicate/RectangleIntersects.cpp \
    geos-3.2.2/source/operation/predicate/SegmentIntersectionTester.cpp \
    geos-3.2.2/source/operation/relate/EdgeEndBuilder.cpp \
    geos-3.2.2/source/operation/relate/EdgeEndBundle.cpp \
    geos-3.2.2/source/operation/relate/EdgeEndBundleStar.cpp \
    geos-3.2.2/source/operation/relate/RelateComputer.cpp \
    geos-3.2.2/source/operation/relate/RelateNode.cpp \
    geos-3.2.2/source/operation/relate/RelateNodeFactory.cpp \
    geos-3.2.2/source/operation/relate/RelateNodeGraph.cpp \
    geos-3.2.2/source/operation/relate/RelateOp.cpp \
    geos-3.2.2/source/operation/union/CascadedPolygonUnion.cpp \
    geos-3.2.2/source/operation/valid/ConnectedInteriorTester.cpp \
    geos-3.2.2/source/operation/valid/ConsistentAreaTester.cpp \
    geos-3.2.2/source/operation/valid/IndexedNestedRingTester.cpp \
    geos-3.2.2/source/operation/valid/IsValidOp.cpp \
    geos-3.2.2/source/operation/valid/QuadtreeNestedRingTester.cpp \
    geos-3.2.2/source/operation/valid/RepeatedPointTester.cpp \
    geos-3.2.2/source/operation/valid/SimpleNestedRingTester.cpp \
    geos-3.2.2/source/operation/valid/SweeplineNestedRingTester.cpp \
    geos-3.2.2/source/operation/valid/TopologyValidationError.cpp \
    geos-3.2.2/source/planargraph/algorithm/ConnectedSubgraphFinder.cpp \
    geos-3.2.2/source/planargraph/DirectedEdge.cpp \
    geos-3.2.2/source/planargraph/DirectedEdgeStar.cpp \
    geos-3.2.2/source/planargraph/Edge.cpp \
    geos-3.2.2/source/planargraph/Node.cpp \
    geos-3.2.2/source/planargraph/NodeMap.cpp \
    geos-3.2.2/source/planargraph/PlanarGraph.cpp \
    geos-3.2.2/source/planargraph/Subgraph.cpp \
    geos-3.2.2/source/precision/CommonBits.cpp \
    geos-3.2.2/source/precision/CommonBitsOp.cpp \
    geos-3.2.2/source/precision/CommonBitsRemover.cpp \
    geos-3.2.2/source/precision/EnhancedPrecisionOp.cpp \
    geos-3.2.2/source/precision/SimpleGeometryPrecisionReducer.cpp \
    geos-3.2.2/source/simplify/DouglasPeuckerLineSimplifier.cpp \
    geos-3.2.2/source/simplify/DouglasPeuckerSimplifier.cpp \
    geos-3.2.2/source/simplify/LineSegmentIndex.cpp \
    geos-3.2.2/source/simplify/TaggedLineSegment.cpp \
    geos-3.2.2/source/simplify/TaggedLinesSimplifier.cpp \
    geos-3.2.2/source/simplify/TaggedLineString.cpp \
    geos-3.2.2/source/simplify/TaggedLineStringSimplifier.cpp \
    geos-3.2.2/source/simplify/TopologyPreservingSimplifier.cpp \
    geos-3.2.2/source/util/Assert.cpp \
    geos-3.2.2/source/util/GeometricShapeFactory.cpp \
    geos-3.2.2/source/util/math.cpp \
    geos-3.2.2/source/util/Profiler.cpp
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
# -DOMIT_GEOS=0
# ./configure --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
#LOCAL_MODULE    := spatialite
#LOCAL_CFLAGS    := -D__ANDROID__ -Dfdatasync=fsync
#LOCAL_LDLIBS   := -llog
#LOCAL_C_INCLUDES := \
    libiconv-1.13.1/include \
    libiconv-1.13.1/libcharset/include \
    geos-3.1.1/source/headers \
    geos-3.1.1/capi \
    proj-4.6.1/src
#LOCAL_SRC_FILES := \
    ./libspatialite-amalgamation-2.3.1/spatialite.c \
    ./libspatialite-amalgamation-2.3.1/empty.cpp \
    ./libspatialite-amalgamation-2.3.1/sqlite3.c
#LOCAL_STATIC_LIBRARIES := iconv proj geos
#include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
# -DOMIT_GEOS=0
# ./configure --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
LOCAL_MODULE    := spatialite
LOCAL_CFLAGS    := -D__ANDROID__ -Dfdatasync=fsync -DOMIT_GEOCALLBACKS
LOCAL_LDLIBS    := -llog
LOCAL_C_INCLUDES := \
    libiconv-1.13.1/include \
    libiconv-1.13.1/libcharset/include \
    geos-3.2.2/source/headers \
    geos-3.2.2/capi \
    proj-4.6.1/src
LOCAL_SRC_FILES := \
    ./libspatialite-amalgamation-2.4.0/spatialite.c \
    ./libspatialite-amalgamation-2.4.0/empty.cpp \
    ./libspatialite-amalgamation-2.4.0/sqlite3.c
LOCAL_STATIC_LIBRARIES := iconv proj geos
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := jsqlite
LOCAL_CFLAGS    := -D__ANDROID__ \
    -DHAVE_SQLITE3=1 \
    -DHAVE_SQLITE3_LOAD_EXTENSION=1 \
    -DCANT_PASS_VALIST_AS_CHARPTR=1 \
    -Dfdatasync=fsync
LOCAL_LDLIBS    := -llog
LOCAL_C_INCLUDES := \
    $(LOCAL_PATH)/libspatialite-amalgamation-2.4.0/headers/spatialite \
    $(LOCAL_PATH)/javasqlite-20110106/native/
LOCAL_SRC_FILES := \
    javasqlite-20110106/native/sqlite_jni.c \
    javasqlite-20110106/native/empty.cpp \
    libspatialite-amalgamation-2.4.0/sqlite3.c
LOCAL_STATIC_LIBRARIES := spatialite iconv proj geos
include $(BUILD_SHARED_LIBRARY)

Application.mk:
APP_STL := gnustl_static
APP_CPPFLAGS += -frtti
APP_CPPFLAGS += -fexceptions

Comment: I also had a issue with linking C and C++ libs. I followed the suggestion in this post and added a empty.cpp to each of the c libs as a workaround...

http://code.google.com/p/android/issues/detail?id=16627
Comment: I'd love to have you submit a patch to the project here: https://github.com/mrenouf/android-spatialite
Comment: I know Git is the new "hotness", but I am pretty clueless when it comes to GitHub. I did create a project at Google Code http://code.google.com/p/spatialite-android/
Answer: I have also one working project with Spatialite (3.0 beta) on Android: https://bitbucket.org/nutiteq/android-map-samples . You can also get prebuilt binaries from the downloads over there.
Answer: For a Chinese post of compiling successfully under windows and cygwin, please ref this post:
http://blog.newnaw.com/?p=1012

Android NDK build of spatialite?


Issue running Unreal Engine 5.0.3 - No usable version of libssl was found

Question: I just installed Unreal Engine 5.0.3 in Ubuntu 22.04 and had the error

No usable version of libssl was found

when trying to run the template with C++
Comment: This [thread for unity](https://stackoverflow.com/questions/72108697/when-i-open-unity-and-make-something-project-then-the-error-is-coming-that-no) also shows solutions
Answer: I could solve the issue by running sudo apt install libssl-dev
or
$ wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb
$ sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb


Adding a maven (distribution) repository on the command line

Question: I think this should be possible, but I have not found anything related to it, as all I have found relates to dependency repositories.
What I would like to do is define the repository where maven (deploy, or release plugin for example) pushes the artifacts. How can I define it on the command line? I assume it is -Dsomething
UPDATE: When I read a jenkins error output carefully, it hints about using:
-DaltDeploymentRepository=id::layout::url
What Is the format for using this? What is the layout parameter?
Answer: The simplest thing is to read the documentation about the maven-deploy-plugin which describes the format:
mvn -DaltDeploymentRepository=repositoryId::default::http://WhatEverURL

In the distributionManagement you usually give things like:
 <distributionManagement>
    <repository>
      <id>internal.repo</id>
      <name>MyCo Internal Repository</name>
      <url>Host to Company Repository</url>
    </repository>
  </distributionManagement>

If you like to use a different URL in this case you need to give:
mvn -DaltDeploymentRepository=internal.repo::default::http://WhatEverURL

The default in this case is the default for the maven repository layout.
Comment: I already figured this out after I found the name of the right parameter, but Thanks!
Comment: Just a correction on the command line. According to the documentation should look like:  "mvn -daltDeploymentRepository=internal.repo::default::http://WhatEverURL"
Comment: Updated answer accordingly. Thanks for the hint.
Comment: The value `internal.repo` is a reference to the login information to use to access the repo listed as the third part of this syntax.  It was confusing to me until I learned that `internal.repo` doesn't define the URL for the repo, but instead the login information to use to access the repo specified.
Answer: In your pom.xml you should add distributionManagement configuration to where to deploy.
In the following example I have used file system as the locations.
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
.........
   <distributionManagement>
       <repository>
         <id>internal.repo</id>
         <name>Internal repo</name>
         <url>file:///home/thara/testesb/in</url>
       </repository>
   </distributionManagement>
............
</project>

The same thing can be done by following command:
mvn deploy -DaltDeploymentRepository=internal.repo::default::file:///home/thara/testesb/in

Comment: How does your answer differ from @khmarbaise?


How to show longer traces in Rails TestCases

Question: Is there a config variable to set, or some other way to get Rails ActiveSupport::TestCase to show more than one trace line? It is really hard to debug otherwise.
Example:
ERROR test_something (0.73s)
      SystemStackError: stack level too deep
      /Users/mario/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:153

Comment: Can you show an example?
Comment: I hate begging for bounties, but if you do not award it _(to anyone, not necessarily me)_ it will be wasted. It would be sad, wouldn't it? ;-)
Comment: Changed to minitest in meantime, where defining $DEBUG does the magic. No tested with UnitTest though.
Answer: See whether you haven't a file config/initializers/backtrace_silencers.rb
It says:
# You can also remove all the silencers if you're trying to debug
# a problem that might stem from framework code.
Rails.backtrace_cleaner.remove_silencers!

You can also call remove_filters! if the first was not enough, but filters only make the paths shorter, while silencers do remove some lines from the backtrace.
You may find the source code in railties/lib/rails/backtrace_cleaner.rb and activesupport/lib/active_support/backtrace_cleaner.rb useful.
Comment: Wow, seems to be the solution! Totally forgot this initializer.
Answer: You can customize Minitest stack traces like this for example:
class MyBacktraceFilter
  def filter bt
    bt.dup.reject{|x| not x.to_s =~ /#{::Rails.root.to_s}/}
  end
end
MiniTest.backtrace_filter = MyBacktraceFilter.new

The filter method accepts the full stack trace in the bt parameter as an array and returns the filtered array. If you want the entire stack to show simply pass the input:
class MyBacktraceFilter
  def filter bt
    bt
  end
end
MiniTest.backtrace_filter = MyBacktraceFilter.new

Answer: You could try to wrap failing code with:
begin
  # failing code
rescue Exception => e
  puts e.message
  puts e.backtrace
end

Another way is debugging your application with ruby-debug.
Answer: You could try setting global variable $DEBUG to non-nil value. If that's minitest who filters your backtrace, setting $DEBUG = true would ensure that the entire backtrace is printed out.


Onboard ethernet stopped working after CPU/memory upgrade

Question: After CPU and memory upgrade Ubuntu 12.04 would not connect to router. It is a dual boot system and the win/xp sys Ethernet still works. I tried upgrading to 14.04, but still no Ethernet. The system sees the card (eth0) in the network connections tool, and reports 'last used' at xx minutes ago. That time being at boot up. There is an antenna icon at the top menu bar that is repeatedly cycling indicating it is searching for a connection like a wireless card will do. After a minute a message box pops up saying 'no network connection'. There is no wireless card installed in this desktop system. The network card also did not work during a liveCD session. I have also flashed the latest bios. I went from an AMD quad core to an 8 core processor and from DDR2 800 TO DDR3 1600 memory. No other hardware change.
Any ideas out there??
Answer: Another day of searching for an answer has been successful. The following thread provided a fix. You may have to look through some of the comments at the end to find the correct location for the script to be added based on what version OS install you have. I have no clue why the CPU/memory upgrade triggered this, again everything was ok before.
http://ubuntuforums.org/archive/index.php/t-2020571.html


Difference between portable class library and shared class library in Xamarin cross platform

Question: Can any one explain the difference between portable class library and shared class library in Xamarin cross platform
Comment: http://developer.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/
Answer: Just my understanding about them.
shared class library works as static library (shared source code) and portable library likes a dynamic library.
Comment: Coming from a C++ app building background, this clears things up for me.
Answer: A portable library is a compiled piece of code that is referenced by other projects; the result of compilation is an assembly that is loaded by the referencing app at runtime. A shared project is not compiled into a stand-alone assembly; instead, all of the code in the project is included in the compilation of the referencing project as if you had added the files that are in the shared project directly to the referencing project. There are pros and cons to both approaches, but it seems that the community is gravitating towards PCLs. There are cases where the use of Shared Projects is still necessary, though (OpenTK being one such example).
Comment: "but it seems that the community is gravitating towards PCLs". This is very important. When I wanted to try out Xamarin.Forms I thought that shared projects are what I want. The problem is that really most samples and examples are PCL, making it a lot harder to jump in for not-so seasoned developers (like me). Thats why I switched to PCL and would now recommend the same for other people like me.


How to set properly GridView?

Question: How to set GridView perfectly under Toolbar. I want the margin to be "0dp" on the all devices. How to do this?
I was tried set marginTop but on the devices with the large screen GridView cover the Toolbar. It looks different on individual devices.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background"
    tools:context="MainActivity">

    <android.support.v7.widget.Toolbar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/toolbar"
        android:background="#000000"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:title="Application"/>

    <GridView
        android:id="@+id/gridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/toolbar"
        android:layout_marginTop="56dp"
        android:horizontalSpacing="8dp"
        android:numColumns="2"
        android:verticalSpacing="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.0"></GridView>

</android.support.constraint.ConstraintLayout>

Comment: Oh, sorry for wrong tag.
Answer: You can use a relative layout.
Inside the relative layout, you place your toolbar and your GridView.
Inside the GridView, write this line :
android:layout_below="@id/toolbar"

it will put the GridView below the toolbar.
Like this :
 <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

<android.support.v7.widget.Toolbar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/toolbar"
    android:background="#000000"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:title="Application"/>

<GridView
    android:id="@+id/gridview"
    android:layout_width="match_parent"
    android:layout_below="@id/toolbar"
    android:layout_height="match_parent"
    android:layout_below="@id/toolbar"
    android:horizontalSpacing="8dp"
    android:numColumns="2"
    android:verticalSpacing="8dp"></GridView>

        </RelativeLayout>

You have 2 options :
1) You can simply post this code inside your constraint layout and type the command you want (that concern the constraintlayout) in the RelativeLayout
2) Directly replace the ConstraintLayout with the RelativeLayout (I recommend you this method in this case, this is much easier to code)

How to set properly GridView?


Spark SQL: Extract String before a certain character

Question: I have a string in a column in a table where I want to extract all the characters before the first dot(.). Here is the input:
Place
Chicago.City.XXXX
Denver.City.XXX.YYY
Dallas.City.FFF.DDD.GGGG

Expected output:
City
CHICAGO
DENVER
DALLAS

I am trying this:
select left(upper(Place), charindex('.', upper(Place))-1) as City from Table

But I am getting the error

Message : AnalysisException: "Undefined function: 'charindex'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'
Answer: In Spark SQL there's substring_index
select substring_index(upper(Place), '.', 1) as City from Table

Answer: SparkSQL does not support charindex().
This should work:
select upper(split_part(Place, '.', 1)) as City from Table

Comment: It gives below error. Undefined function: 'split_part'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.
Comment: How are you querying the table?