function updateProjectAccordingTo (platformConfig, locations) {
    updateProjectStrings(platformConfig, locations);
    updateProjectTheme(platformConfig, locations);

    const name = platformConfig.name();

    // Update app name for gradle project
    fs.writeFileSync(path.join(locations.root, 'cdv-gradle-name.gradle'),
        '// GENERATED FILE - DO NOT EDIT\n' +
        'rootProject.name = "' + name.replace(/[/\\:<>"?*|]/g, '_') + '"\n');

    // Java packages cannot support dashes
    const androidPkgName = (platformConfig.android_packageName() || platformConfig.packageName()).replace(/-/g, '_');

    // updating cdv-gradle-config with new androidPkgName.
    const cdvGradleConfig = CordovaGradleConfigParserFactory.create(locations.root);
    cdvGradleConfig.setPackageName(androidPkgName)
        .write();

    const manifest = new AndroidManifest(locations.manifest);
    manifest.getActivity()
        .setOrientation(platformConfig.getPreference('orientation'))
        .setLaunchMode(findAndroidLaunchModePreference(platformConfig));

    manifest.setVersionName(platformConfig.version())
        .setVersionCode(platformConfig.android_versionCode() || default_versionCode(platformConfig.version()))
        .write();

    // Java file paths shouldn't be hard coded
    const javaDirectory = path.join(locations.javaSrc, androidPkgName.replace(/\./g, '/'));
    const java_files = glob.sync('**/*.java', { cwd: javaDirectory, absolute: true }).filter(f => {
        const contents = fs.readFileSync(f, 'utf-8');
        return /extends\s+CordovaActivity/.test(contents);
    });

    if (java_files.length === 0) {
        throw new CordovaError('No Java files found that extend CordovaActivity.');
    } else if (java_files.length > 1) {
        events.emit('log', 'Multiple candidate Java files that extend CordovaActivity found. Guessing at the first one, ' + java_files[0]);
    }

    const destFile = path.normalize(java_files[0]);

    // if package name has changed, path to MainActivity.java has to track it
    const newDestFile = path.join(locations.root, 'app', 'src', 'main', 'java', androidPkgName.replace(/\./g, '/'), path.basename(destFile));
    if (newDestFile.toLowerCase() !== destFile.toLowerCase()) {
        // If package was name changed we need to create new java with main activity in path matching new package name
        fs.mkdirSync(path.dirname(newDestFile), { recursive: true });
        events.emit('verbose', `copy ${destFile} to ${newDestFile}`);
        fs.cpSync(destFile, newDestFile);
        utils.replaceFileContents(newDestFile, /package [\w.]*;/, 'package ' + androidPkgName + ';');
        events.emit('verbose', 'Wrote out Android package name "' + androidPkgName + '" to ' + newDestFile);
        // If package was name changed we need to remove old java with main activity
        events.emit('verbose', `remove ${destFile}`);
        fs.rmSync(destFile);
        // remove any empty directories
        let currentDir = path.dirname(destFile);
        const sourcesRoot = path.resolve(locations.root, 'src');
        while (currentDir !== sourcesRoot) {
            if (fs.existsSync(currentDir) && fs.readdirSync(currentDir).length === 0) {
                fs.rmdirSync(currentDir);
                currentDir = path.resolve(currentDir, '..');
            } else {
                break;
            }
        }
    }
}
Updates project structure and AndroidManifest according to project's configuration.

@param   {ConfigParser}  platformConfig  A project's configuration that will
  be used to update project
@param   {Object}  locations       A map of locations for this platform