简体   繁体   中英

how to create an android project programmatically?

I'm working on an eclipse plugin that needs to offer the option of creating a new Android Project from a given apk. I basically want to use the information from the AndroidManifest.xml in the apk to do the project setup.

Basically the steps I want to follow are:

  1. unpack the apk using apktool
  2. create Android project using some information from the unpacked apk.

I have done this successfully doing both steps manually (as idicated in http://codebangers.com/?p=584 )

However, now I'd like to automate the process and do it programmatically. I was able to do step 1. programmatically.

Regarding step 2. I know the eclipse ADT plugin provides a NewProjectCreator class, however it seems I should not use this class to create the project since the class helps says:

  /**
   * The actual project creator invoked from the New Project Wizard
   * <p/>
   * Note: this class is public so that it can be accessed from unit tests.
   * It is however an internal class. Its API may change without notice.
   * It should semantically be considered as a private final class.
   */

Does anybody know what is the correct way of programmatically creating an Android project?

Not sure if that is possible for security seasons, however you could change the extension of the apk towards a zip file. If you open the zip file you could see the application code/resources

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM