0

I have an application that is the basis for many applications, it is only necessary to change a value in string.xml and add images in the drawable folder.

Whenever I create a new application I have to always do the following steps:

  • Open the app base.
  • Change the value in string.xml
  • Add the images in drawable
  • Compile everything and give the apk.

I wonder if I can do it all through a single script, taking as parameters the value of string.xml that has to be changed and the images have to be added in the drawable. Is this possible?

4
  • of course it's possible - ruby, groovy, bash... Commented Feb 22, 2012 at 11:32
  • and how is it? the question is this Commented Feb 22, 2012 at 11:33
  • 1
    answering to the 'how' part: you pickup a programming language with scripting capabilities, you define what you want to achieve, you read the quickstart guide, than you research how to achieve every step you need to do...do you expect someone to code a complete script for you? Commented Feb 22, 2012 at 11:36
  • check [enter link description here][1] and [enter link description here][2] [1]: stackoverflow.com/questions/2069671/… [2]: stackoverflow.com/questions/6936800/… Commented Feb 22, 2012 at 11:42

1 Answer 1

0

yes. you can use ant to build the project from command line. Also you can use batch files to copy the new images to drawable folder before the build. For the string changes, you can write a simple C/C++ program that can take string inputs and replace it in a the strings.xml to generate a new strings.xml You can execute this program though your batch file. A sample batch file will look like:

str_replace.exe %1 %2
copy a.png <folder>/drawable
ant 

the u will need to create the str_replace program using simlple C/C++ that takes two command line arguments(source and target strings)

For ant see: http://developer.android.com/guide/developing/building/building-cmdline.html

Search Google for commandline arguments in batch files.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.