Change android theme from cordova config.xml












3














At my company we are using Ionic Framework and Cordova to create our mobile app, and upon starting the design of the app, we encountered an issue with the Android theme and how to set it without touching the AndroidManifest generated by Ionic build command.



Everywhere I look it is recommended to implement any customization from the config.xml file and never touch the AndroidManifest, but I cant seem to find any methods regarding the Android theme.



My question to you now: Is there a way to set the android theme for the application, for example Holo Theme, from the Config.xml without changing the AndroidManifest.xml generated?










share|improve this question



























    3














    At my company we are using Ionic Framework and Cordova to create our mobile app, and upon starting the design of the app, we encountered an issue with the Android theme and how to set it without touching the AndroidManifest generated by Ionic build command.



    Everywhere I look it is recommended to implement any customization from the config.xml file and never touch the AndroidManifest, but I cant seem to find any methods regarding the Android theme.



    My question to you now: Is there a way to set the android theme for the application, for example Holo Theme, from the Config.xml without changing the AndroidManifest.xml generated?










    share|improve this question

























      3












      3








      3


      3





      At my company we are using Ionic Framework and Cordova to create our mobile app, and upon starting the design of the app, we encountered an issue with the Android theme and how to set it without touching the AndroidManifest generated by Ionic build command.



      Everywhere I look it is recommended to implement any customization from the config.xml file and never touch the AndroidManifest, but I cant seem to find any methods regarding the Android theme.



      My question to you now: Is there a way to set the android theme for the application, for example Holo Theme, from the Config.xml without changing the AndroidManifest.xml generated?










      share|improve this question













      At my company we are using Ionic Framework and Cordova to create our mobile app, and upon starting the design of the app, we encountered an issue with the Android theme and how to set it without touching the AndroidManifest generated by Ionic build command.



      Everywhere I look it is recommended to implement any customization from the config.xml file and never touch the AndroidManifest, but I cant seem to find any methods regarding the Android theme.



      My question to you now: Is there a way to set the android theme for the application, for example Holo Theme, from the Config.xml without changing the AndroidManifest.xml generated?







      android xml cordova ionic






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 7 '15 at 11:51









      Jad Salhani

      105127




      105127
























          3 Answers
          3






          active

          oldest

          votes


















          4














          To avoid touching the platforms directory, you could use a cordova hook. I am pretty terrible at node, but here is something that should do the trick. First npm install elementtree then create a sub folder after_prepare in the hooks folder. From there stick this code into a javascript file and change YourTheme.



          Honestly, this is some pretty gross code, but should give you the idea.



          #!/usr/bin/env node
          var fs = require( "fs" );
          var et = require('elementtree');
          var rootdir = process.argv[2];
          console.log(rootdir);
          fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'r+',
          function (err, fd) {
          if (err) {
          exitError(err);
          }
          fs.stat(rootdir + '/platforms/android/AndroidManifest.xml', getStats);

          function getStats(error, stats) {
          if (error) {
          exitError(error);
          }
          var buffer = new Buffer(stats.size);
          fs.read(fd, buffer, 0, buffer.length, null, fileRead);
          }

          function fileRead(error, bytes, buf) {
          var data = buf.toString("utf8", 0, buf.length);
          var androidXML = et.parse(data);
          var root = androidXML.getroot();
          var activityTag = root.find("application/activity");
          activityTag.attrib["android:theme"] = "@style/YourTheme";
          var outputBuffer = new Buffer(et.tostring(root), "utf-8");
          console.log(outputBuffer.toString());
          fs.closeSync(fd);
          fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'w', writeFile);
          function writeFile(error, fd) {
          if (error) {
          exitError(error);
          }
          fs.write(fd, outputBuffer, 0, outputBuffer.length, 0, function( errw, written, str) {
          if (errw) {
          exitError(errw);
          }
          console.log('file written');
          fs.close(fd);
          });
          }

          }
          });

          function exitError(error) {
          console.log(error);
          process.exit(0);
          }





          share|improve this answer

















          • 1




            I thought about using a hook, but shouldn't there be something we can add to the config.xml file to change things like this? Considering the fact that phonegap build had a feature to write custom xml that would be merged with the AndroidManifest.xml
            – Jad Salhani
            Apr 8 '15 at 11:49






          • 1




            Again, this can be done via hooks. After poking around a bit more, it seems like this file adds some nice features (including themes): github.com/djett41/generator-ionic/blob/master/templates/hooks/…
            – laughingpine
            Apr 8 '15 at 13:51






          • 1




            Oh very nice, i poked around a bit with the generator but didn't see these hooks. It opens doors to new configuration possibilities. Thanks for the help !
            – Jad Salhani
            Apr 9 '15 at 8:43






          • 1




            For anyone using @laughingpine's linked hook. It works well, but make sure you check to make sure that the Activity name in preferenceMappingData actually matches up against the activity listed in the node: manifest>application>activity in AndroidManifest.xml. Ours was called MainActivity so we needed to change 4 of the preferenceMappingData xpath expressions to match up.
            – JimTheDev
            May 18 '15 at 19:15



















          5














          I know I'm late, but cordova-custom-config plugin made just to "update platform configuration files based on preferences and config-file data defined in config.xml."



          for example:




          1. install the cordova-custom-config plugin: cordova plugin add cordova-custom-config --save


          2. Config.xml: <preference name="android-manifest/application/activity/@android:theme" value="@android:style/Theme.Holo"/>



          This will add the attribute "android:theme" to your AndroidManfiset --> application --> activity with the value: @android:style/Theme.Holo.






          share|improve this answer





























            0














            You can do this now without any third party plugin since 6.3.0. Just add this to the config.xml



            <platform name="android">
            <edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:label='@string/activity_name']" mode="merge">
            <activity android:theme="@android:style/Theme.Translucent"></activity>
            </edit-config>
            </platform>


            and for me it was also neccessary to add 'xmlns:android="http://schemas.android.com/apk/res/android" ' to the widget tag



            <widget id="de.bestellkind.restaurant" version="1.0.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">





            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29490925%2fchange-android-theme-from-cordova-config-xml%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4














              To avoid touching the platforms directory, you could use a cordova hook. I am pretty terrible at node, but here is something that should do the trick. First npm install elementtree then create a sub folder after_prepare in the hooks folder. From there stick this code into a javascript file and change YourTheme.



              Honestly, this is some pretty gross code, but should give you the idea.



              #!/usr/bin/env node
              var fs = require( "fs" );
              var et = require('elementtree');
              var rootdir = process.argv[2];
              console.log(rootdir);
              fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'r+',
              function (err, fd) {
              if (err) {
              exitError(err);
              }
              fs.stat(rootdir + '/platforms/android/AndroidManifest.xml', getStats);

              function getStats(error, stats) {
              if (error) {
              exitError(error);
              }
              var buffer = new Buffer(stats.size);
              fs.read(fd, buffer, 0, buffer.length, null, fileRead);
              }

              function fileRead(error, bytes, buf) {
              var data = buf.toString("utf8", 0, buf.length);
              var androidXML = et.parse(data);
              var root = androidXML.getroot();
              var activityTag = root.find("application/activity");
              activityTag.attrib["android:theme"] = "@style/YourTheme";
              var outputBuffer = new Buffer(et.tostring(root), "utf-8");
              console.log(outputBuffer.toString());
              fs.closeSync(fd);
              fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'w', writeFile);
              function writeFile(error, fd) {
              if (error) {
              exitError(error);
              }
              fs.write(fd, outputBuffer, 0, outputBuffer.length, 0, function( errw, written, str) {
              if (errw) {
              exitError(errw);
              }
              console.log('file written');
              fs.close(fd);
              });
              }

              }
              });

              function exitError(error) {
              console.log(error);
              process.exit(0);
              }





              share|improve this answer

















              • 1




                I thought about using a hook, but shouldn't there be something we can add to the config.xml file to change things like this? Considering the fact that phonegap build had a feature to write custom xml that would be merged with the AndroidManifest.xml
                – Jad Salhani
                Apr 8 '15 at 11:49






              • 1




                Again, this can be done via hooks. After poking around a bit more, it seems like this file adds some nice features (including themes): github.com/djett41/generator-ionic/blob/master/templates/hooks/…
                – laughingpine
                Apr 8 '15 at 13:51






              • 1




                Oh very nice, i poked around a bit with the generator but didn't see these hooks. It opens doors to new configuration possibilities. Thanks for the help !
                – Jad Salhani
                Apr 9 '15 at 8:43






              • 1




                For anyone using @laughingpine's linked hook. It works well, but make sure you check to make sure that the Activity name in preferenceMappingData actually matches up against the activity listed in the node: manifest>application>activity in AndroidManifest.xml. Ours was called MainActivity so we needed to change 4 of the preferenceMappingData xpath expressions to match up.
                – JimTheDev
                May 18 '15 at 19:15
















              4














              To avoid touching the platforms directory, you could use a cordova hook. I am pretty terrible at node, but here is something that should do the trick. First npm install elementtree then create a sub folder after_prepare in the hooks folder. From there stick this code into a javascript file and change YourTheme.



              Honestly, this is some pretty gross code, but should give you the idea.



              #!/usr/bin/env node
              var fs = require( "fs" );
              var et = require('elementtree');
              var rootdir = process.argv[2];
              console.log(rootdir);
              fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'r+',
              function (err, fd) {
              if (err) {
              exitError(err);
              }
              fs.stat(rootdir + '/platforms/android/AndroidManifest.xml', getStats);

              function getStats(error, stats) {
              if (error) {
              exitError(error);
              }
              var buffer = new Buffer(stats.size);
              fs.read(fd, buffer, 0, buffer.length, null, fileRead);
              }

              function fileRead(error, bytes, buf) {
              var data = buf.toString("utf8", 0, buf.length);
              var androidXML = et.parse(data);
              var root = androidXML.getroot();
              var activityTag = root.find("application/activity");
              activityTag.attrib["android:theme"] = "@style/YourTheme";
              var outputBuffer = new Buffer(et.tostring(root), "utf-8");
              console.log(outputBuffer.toString());
              fs.closeSync(fd);
              fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'w', writeFile);
              function writeFile(error, fd) {
              if (error) {
              exitError(error);
              }
              fs.write(fd, outputBuffer, 0, outputBuffer.length, 0, function( errw, written, str) {
              if (errw) {
              exitError(errw);
              }
              console.log('file written');
              fs.close(fd);
              });
              }

              }
              });

              function exitError(error) {
              console.log(error);
              process.exit(0);
              }





              share|improve this answer

















              • 1




                I thought about using a hook, but shouldn't there be something we can add to the config.xml file to change things like this? Considering the fact that phonegap build had a feature to write custom xml that would be merged with the AndroidManifest.xml
                – Jad Salhani
                Apr 8 '15 at 11:49






              • 1




                Again, this can be done via hooks. After poking around a bit more, it seems like this file adds some nice features (including themes): github.com/djett41/generator-ionic/blob/master/templates/hooks/…
                – laughingpine
                Apr 8 '15 at 13:51






              • 1




                Oh very nice, i poked around a bit with the generator but didn't see these hooks. It opens doors to new configuration possibilities. Thanks for the help !
                – Jad Salhani
                Apr 9 '15 at 8:43






              • 1




                For anyone using @laughingpine's linked hook. It works well, but make sure you check to make sure that the Activity name in preferenceMappingData actually matches up against the activity listed in the node: manifest>application>activity in AndroidManifest.xml. Ours was called MainActivity so we needed to change 4 of the preferenceMappingData xpath expressions to match up.
                – JimTheDev
                May 18 '15 at 19:15














              4












              4








              4






              To avoid touching the platforms directory, you could use a cordova hook. I am pretty terrible at node, but here is something that should do the trick. First npm install elementtree then create a sub folder after_prepare in the hooks folder. From there stick this code into a javascript file and change YourTheme.



              Honestly, this is some pretty gross code, but should give you the idea.



              #!/usr/bin/env node
              var fs = require( "fs" );
              var et = require('elementtree');
              var rootdir = process.argv[2];
              console.log(rootdir);
              fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'r+',
              function (err, fd) {
              if (err) {
              exitError(err);
              }
              fs.stat(rootdir + '/platforms/android/AndroidManifest.xml', getStats);

              function getStats(error, stats) {
              if (error) {
              exitError(error);
              }
              var buffer = new Buffer(stats.size);
              fs.read(fd, buffer, 0, buffer.length, null, fileRead);
              }

              function fileRead(error, bytes, buf) {
              var data = buf.toString("utf8", 0, buf.length);
              var androidXML = et.parse(data);
              var root = androidXML.getroot();
              var activityTag = root.find("application/activity");
              activityTag.attrib["android:theme"] = "@style/YourTheme";
              var outputBuffer = new Buffer(et.tostring(root), "utf-8");
              console.log(outputBuffer.toString());
              fs.closeSync(fd);
              fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'w', writeFile);
              function writeFile(error, fd) {
              if (error) {
              exitError(error);
              }
              fs.write(fd, outputBuffer, 0, outputBuffer.length, 0, function( errw, written, str) {
              if (errw) {
              exitError(errw);
              }
              console.log('file written');
              fs.close(fd);
              });
              }

              }
              });

              function exitError(error) {
              console.log(error);
              process.exit(0);
              }





              share|improve this answer












              To avoid touching the platforms directory, you could use a cordova hook. I am pretty terrible at node, but here is something that should do the trick. First npm install elementtree then create a sub folder after_prepare in the hooks folder. From there stick this code into a javascript file and change YourTheme.



              Honestly, this is some pretty gross code, but should give you the idea.



              #!/usr/bin/env node
              var fs = require( "fs" );
              var et = require('elementtree');
              var rootdir = process.argv[2];
              console.log(rootdir);
              fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'r+',
              function (err, fd) {
              if (err) {
              exitError(err);
              }
              fs.stat(rootdir + '/platforms/android/AndroidManifest.xml', getStats);

              function getStats(error, stats) {
              if (error) {
              exitError(error);
              }
              var buffer = new Buffer(stats.size);
              fs.read(fd, buffer, 0, buffer.length, null, fileRead);
              }

              function fileRead(error, bytes, buf) {
              var data = buf.toString("utf8", 0, buf.length);
              var androidXML = et.parse(data);
              var root = androidXML.getroot();
              var activityTag = root.find("application/activity");
              activityTag.attrib["android:theme"] = "@style/YourTheme";
              var outputBuffer = new Buffer(et.tostring(root), "utf-8");
              console.log(outputBuffer.toString());
              fs.closeSync(fd);
              fs.open(rootdir + '/platforms/android/AndroidManifest.xml', 'w', writeFile);
              function writeFile(error, fd) {
              if (error) {
              exitError(error);
              }
              fs.write(fd, outputBuffer, 0, outputBuffer.length, 0, function( errw, written, str) {
              if (errw) {
              exitError(errw);
              }
              console.log('file written');
              fs.close(fd);
              });
              }

              }
              });

              function exitError(error) {
              console.log(error);
              process.exit(0);
              }






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 7 '15 at 15:42









              laughingpine

              8991218




              8991218








              • 1




                I thought about using a hook, but shouldn't there be something we can add to the config.xml file to change things like this? Considering the fact that phonegap build had a feature to write custom xml that would be merged with the AndroidManifest.xml
                – Jad Salhani
                Apr 8 '15 at 11:49






              • 1




                Again, this can be done via hooks. After poking around a bit more, it seems like this file adds some nice features (including themes): github.com/djett41/generator-ionic/blob/master/templates/hooks/…
                – laughingpine
                Apr 8 '15 at 13:51






              • 1




                Oh very nice, i poked around a bit with the generator but didn't see these hooks. It opens doors to new configuration possibilities. Thanks for the help !
                – Jad Salhani
                Apr 9 '15 at 8:43






              • 1




                For anyone using @laughingpine's linked hook. It works well, but make sure you check to make sure that the Activity name in preferenceMappingData actually matches up against the activity listed in the node: manifest>application>activity in AndroidManifest.xml. Ours was called MainActivity so we needed to change 4 of the preferenceMappingData xpath expressions to match up.
                – JimTheDev
                May 18 '15 at 19:15














              • 1




                I thought about using a hook, but shouldn't there be something we can add to the config.xml file to change things like this? Considering the fact that phonegap build had a feature to write custom xml that would be merged with the AndroidManifest.xml
                – Jad Salhani
                Apr 8 '15 at 11:49






              • 1




                Again, this can be done via hooks. After poking around a bit more, it seems like this file adds some nice features (including themes): github.com/djett41/generator-ionic/blob/master/templates/hooks/…
                – laughingpine
                Apr 8 '15 at 13:51






              • 1




                Oh very nice, i poked around a bit with the generator but didn't see these hooks. It opens doors to new configuration possibilities. Thanks for the help !
                – Jad Salhani
                Apr 9 '15 at 8:43






              • 1




                For anyone using @laughingpine's linked hook. It works well, but make sure you check to make sure that the Activity name in preferenceMappingData actually matches up against the activity listed in the node: manifest>application>activity in AndroidManifest.xml. Ours was called MainActivity so we needed to change 4 of the preferenceMappingData xpath expressions to match up.
                – JimTheDev
                May 18 '15 at 19:15








              1




              1




              I thought about using a hook, but shouldn't there be something we can add to the config.xml file to change things like this? Considering the fact that phonegap build had a feature to write custom xml that would be merged with the AndroidManifest.xml
              – Jad Salhani
              Apr 8 '15 at 11:49




              I thought about using a hook, but shouldn't there be something we can add to the config.xml file to change things like this? Considering the fact that phonegap build had a feature to write custom xml that would be merged with the AndroidManifest.xml
              – Jad Salhani
              Apr 8 '15 at 11:49




              1




              1




              Again, this can be done via hooks. After poking around a bit more, it seems like this file adds some nice features (including themes): github.com/djett41/generator-ionic/blob/master/templates/hooks/…
              – laughingpine
              Apr 8 '15 at 13:51




              Again, this can be done via hooks. After poking around a bit more, it seems like this file adds some nice features (including themes): github.com/djett41/generator-ionic/blob/master/templates/hooks/…
              – laughingpine
              Apr 8 '15 at 13:51




              1




              1




              Oh very nice, i poked around a bit with the generator but didn't see these hooks. It opens doors to new configuration possibilities. Thanks for the help !
              – Jad Salhani
              Apr 9 '15 at 8:43




              Oh very nice, i poked around a bit with the generator but didn't see these hooks. It opens doors to new configuration possibilities. Thanks for the help !
              – Jad Salhani
              Apr 9 '15 at 8:43




              1




              1




              For anyone using @laughingpine's linked hook. It works well, but make sure you check to make sure that the Activity name in preferenceMappingData actually matches up against the activity listed in the node: manifest>application>activity in AndroidManifest.xml. Ours was called MainActivity so we needed to change 4 of the preferenceMappingData xpath expressions to match up.
              – JimTheDev
              May 18 '15 at 19:15




              For anyone using @laughingpine's linked hook. It works well, but make sure you check to make sure that the Activity name in preferenceMappingData actually matches up against the activity listed in the node: manifest>application>activity in AndroidManifest.xml. Ours was called MainActivity so we needed to change 4 of the preferenceMappingData xpath expressions to match up.
              – JimTheDev
              May 18 '15 at 19:15













              5














              I know I'm late, but cordova-custom-config plugin made just to "update platform configuration files based on preferences and config-file data defined in config.xml."



              for example:




              1. install the cordova-custom-config plugin: cordova plugin add cordova-custom-config --save


              2. Config.xml: <preference name="android-manifest/application/activity/@android:theme" value="@android:style/Theme.Holo"/>



              This will add the attribute "android:theme" to your AndroidManfiset --> application --> activity with the value: @android:style/Theme.Holo.






              share|improve this answer


























                5














                I know I'm late, but cordova-custom-config plugin made just to "update platform configuration files based on preferences and config-file data defined in config.xml."



                for example:




                1. install the cordova-custom-config plugin: cordova plugin add cordova-custom-config --save


                2. Config.xml: <preference name="android-manifest/application/activity/@android:theme" value="@android:style/Theme.Holo"/>



                This will add the attribute "android:theme" to your AndroidManfiset --> application --> activity with the value: @android:style/Theme.Holo.






                share|improve this answer
























                  5












                  5








                  5






                  I know I'm late, but cordova-custom-config plugin made just to "update platform configuration files based on preferences and config-file data defined in config.xml."



                  for example:




                  1. install the cordova-custom-config plugin: cordova plugin add cordova-custom-config --save


                  2. Config.xml: <preference name="android-manifest/application/activity/@android:theme" value="@android:style/Theme.Holo"/>



                  This will add the attribute "android:theme" to your AndroidManfiset --> application --> activity with the value: @android:style/Theme.Holo.






                  share|improve this answer












                  I know I'm late, but cordova-custom-config plugin made just to "update platform configuration files based on preferences and config-file data defined in config.xml."



                  for example:




                  1. install the cordova-custom-config plugin: cordova plugin add cordova-custom-config --save


                  2. Config.xml: <preference name="android-manifest/application/activity/@android:theme" value="@android:style/Theme.Holo"/>



                  This will add the attribute "android:theme" to your AndroidManfiset --> application --> activity with the value: @android:style/Theme.Holo.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 9 '16 at 14:41









                  kutomer

                  531412




                  531412























                      0














                      You can do this now without any third party plugin since 6.3.0. Just add this to the config.xml



                      <platform name="android">
                      <edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:label='@string/activity_name']" mode="merge">
                      <activity android:theme="@android:style/Theme.Translucent"></activity>
                      </edit-config>
                      </platform>


                      and for me it was also neccessary to add 'xmlns:android="http://schemas.android.com/apk/res/android" ' to the widget tag



                      <widget id="de.bestellkind.restaurant" version="1.0.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">





                      share|improve this answer


























                        0














                        You can do this now without any third party plugin since 6.3.0. Just add this to the config.xml



                        <platform name="android">
                        <edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:label='@string/activity_name']" mode="merge">
                        <activity android:theme="@android:style/Theme.Translucent"></activity>
                        </edit-config>
                        </platform>


                        and for me it was also neccessary to add 'xmlns:android="http://schemas.android.com/apk/res/android" ' to the widget tag



                        <widget id="de.bestellkind.restaurant" version="1.0.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">





                        share|improve this answer
























                          0












                          0








                          0






                          You can do this now without any third party plugin since 6.3.0. Just add this to the config.xml



                          <platform name="android">
                          <edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:label='@string/activity_name']" mode="merge">
                          <activity android:theme="@android:style/Theme.Translucent"></activity>
                          </edit-config>
                          </platform>


                          and for me it was also neccessary to add 'xmlns:android="http://schemas.android.com/apk/res/android" ' to the widget tag



                          <widget id="de.bestellkind.restaurant" version="1.0.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">





                          share|improve this answer












                          You can do this now without any third party plugin since 6.3.0. Just add this to the config.xml



                          <platform name="android">
                          <edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:label='@string/activity_name']" mode="merge">
                          <activity android:theme="@android:style/Theme.Translucent"></activity>
                          </edit-config>
                          </platform>


                          and for me it was also neccessary to add 'xmlns:android="http://schemas.android.com/apk/res/android" ' to the widget tag



                          <widget id="de.bestellkind.restaurant" version="1.0.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 2 days ago









                          Simon Ludwig

                          645714




                          645714






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29490925%2fchange-android-theme-from-cordova-config-xml%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Monofisismo

                              Angular Downloading a file using contenturl with Basic Authentication

                              Olmecas