Code example for DocumentBuilder

Methods: parse

0
            return; 
        } 
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        try { 
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document manifestDocument = db.parse(androidManifestFile);
 
            packageName = getTagAttributeText(manifestDocument, "manifest", "package");
            rClassName = packageName + ".R";
            applicationName = getTagAttributeText(manifestDocument, "application", "android:name");
            minSdkVersion = getTagAttributeIntValue(manifestDocument, "uses-sdk", "android:minSdkVersion");
            targetSdkVersion = getTagAttributeIntValue(manifestDocument, "uses-sdk", "android:targetSdkVersion");
            processName = getTagAttributeText(manifestDocument, "application", "android:process");
            if (processName == null) {
                processName = packageName;
            } 
 
            parseApplicationFlags(manifestDocument);
            parseReceivers(manifestDocument, packageName);
        } catch (Exception ignored) {
Contextual code suggestions in your IDE  Get Codota for Java