Generates Java source for activity declarations in the XML layout.
An Android activity XML would contain following view decelaration:
<EditText android:id="@+id/userUnique" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:padding="20sp" android:inputType="text" /> <Button android:id="@+id/loginOk" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:layout_below="@id/password" android:padding="20sp" /> In order to map the layout with the Java source we would be writing following code everytime:
private EditText userUnique; private Button loginOk; userUnique = (EditText) findViewById(R.id.userUnique); loginOk = (Button) findViewById(R.id.loginOk); loginOkListener = new OnClickListener(){@Override public void onClick(View v){/* Write your code here */ } }; loginOk.setOnClickListener(loginOkListener); This project aimed to generate the mapping source of xml.
Unzip the QuickAndroid folder into your android project root folder
Verify the Views in "ViewList.txt" file and add few tags which are required for your project.
Specify eSprinkle tags as below in your xml file inside the comments as below:
""
""
""
""
There tags can be anywhere inside the layout file but they should exists.
Run the sources "QuickAndroidMain" by opening "Run" batch file and provide the xml file name.
Your activity class will be generated for the respective xml file
eSprinkle-quickAndroid:package => denotes under which package the class should be placed. => exclude this tag for default package
eSprinkle-quickAndroid:class
=> denotes the class name
eSprinkle-quickAndroid:is_new
=> it is mandatory tag and for now it should be set as true, => We are building the next version in which 'false' specifies the class is already created and need to create mappings only for the missing.
eSprinkle-quickAndroid:sync_enabled
=> As soon as you save your changes in xml file, => The mappings will be reflected in java file, (currently not available)
- Able to map the view for existing classes.
- Realtime sync with layout file.
- Would be available as an eclipse plugin
=========== eSprinkle Open Source
