Skip to content

Create master

Andy edited this page Jul 20, 2016 · 3 revisions

If you wish to submit a pull request you'll need to merge this repo into an existing Cordova Project and then make changes to the source files.

Here are the steps to create a local master copy of this repo:

cordova create cordova-geo com.esri.cordova.geolocation AdvancedGeolocation
cd cordova-geo/
cordova platform add android
cd platforms/android/
git clone https://github.com/andygup/cordova-plugin-advanced-geolocation.git temp
mv temp/.gitignore .
mv temp/.git .
rm -rf temp
git reset --hard HEAD # git will think you deleted all the important files
git status # most likely there will be a MainActivity.java untracked

# Do a test build 

bash cordova_create2.sh

# Go and modify config.xml. Change content element to <content src="sample-map.html" />

Add the following wrapper to AdvancedGeolocation.js

	cordova.define("cordova-plugin-advanced-geolocation.AdvancedGeolocation", function(require, exports, module) { ... });

Add the following to config.xml

    <feature name="AdvancedGeolocation">
        <param name="android-package" value="com.esri.cordova.geolocation.AdvancedGeolocation" />
    </feature>

Add the following to cordova_plugins.js

module.exports = [

    {
        "file": "plugins/cordova-plugin-advanced-geolocation/www/AdvancedGeolocation.js",
        "id": "cordova-plugin-advanced-geolocation.AdvancedGeolocation",
        "clobbers": [
            "AdvancedGeolocation"
        ]
    }
];

Add the following to AndroidManifest.xml

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />