Eclipse plugin for automatic generation of Android code from XML layout extended

Attention!

There is new plugin available, please see Android Code Generator Plugin for Eclipse

Description

    Eclipse Plugin for automatic android code generation has been extended, the release version is 1.2.0. Repository(Mercurial) with this project to clone is available on http://code.google.com/p/android-code-generator-plugin/, you can download the plugin directly from /downloads/list.
    There are two versions of plugin available: .zip and .jar, with instruction how to used them.

 
Development

    From the development point of view project structure has changed.

  • pom.xml file was edited so plugin could be generated independent of any IDE, just by running mvn package.
  • Project is now split into two modules:
    <modules>
    	<module>com.morcinek.android.codegenerator.plugin</module>
    	<module>com.morcinek.android.codegenerator.plugin-test</module>
    </modules>
    

    One module is responsible for plugin, the other for unit tests.

  • Utit test has been written to test most important part of the system.

 
New features

    1. Allowing plugin to be executed only on .xml files(do not show menu option otherwise)
    2. Allowing plugin to be invoked on multiple files
    3. Logging operations during plugin execution (could be seen in eclipse ‚Error Log’ – Windows -> Show View -> Error Log)
    4. Adding new property ‚Allow automatic type recognition’, that could be set in plugin preferences.
        This option allows automatic type recognition during selected resource parsing e.g.:

        ...
        	<android.support.v4.view.ViewPager
        		android:id="@+id/pager"
        		android:background="#20FF0000"
        		android:layout_width="wrap_content"
        		android:layout_height="wrap_content"
        	/>
        ...
        

        In this case type android.support.v4.view.ViewPager will be recognized and following class will be generated:

        ...
        import android.support.v4.view.android.support.v4.view.ViewPager;
        ...
        private ViewPager pager;
        ...
        	@Override
        	public void onCreate(Bundle savedInstanceState) {
        		super.onCreate(savedInstanceState);
        		setContentView(R.layout.specific);
        
        		pager = (ViewPager) findViewById(R.id.pager);
        ...
        
    5. Simplifying parsing of file types.xml
      • Now also following entries are accepted:

        	<type name="ListView" package="android.widget" />
        	<type name="android.widget.Button" />
        

        As you can see, package attribute is no longer required.

 
More
More on the project you can see on google.code, and also in my previous post: Eclipse plugin for automatic generation of Android code from XML layout file.

Reklamy

Skomentuj

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

Logo WordPress.com

Komentujesz korzystając z konta WordPress.com. Wyloguj / Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Wyloguj / Zmień )

Facebook photo

Komentujesz korzystając z konta Facebook. Wyloguj / Zmień )

Google+ photo

Komentujesz korzystając z konta Google+. Wyloguj / Zmień )

Connecting to %s