2

I have got an idea to get rid of some coding when we do initializion of views. When we create an xml layout in android. At that movement same name class is created with UpperCase Letters with a dialogue with permission. And as i created views with ids. It should create Views and initialize them automatically.

for e.g

close.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

 <Button
   android:id="@+id/closeBtn"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:background="@drawable/close_img" />

 <TextView
   android:id="@+id/closeText"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:text="Testing Text" />
</LinearLayout>

And automatically generated java code should be.

public class Close extends Activity
{

  TextView CloseText;

  Button CloseBtn;

   @Override
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
    
        setContentView(R.layout.activity_main);

        CloseText = (TextView)findViewById(R.id.closeText);

        CloseBtn = (Button)findViewById(R.id.closeBtn);
     }
}

I can read xml and do the other stuff as I explained. But how could i add this module to eclipse and How could i create a service which work in Background all the time in eclipse.

Suggest me how to add this module(Plugin) to eclipse and i am going to use JAXB to generate Java Objects from XML document. Is there any better option.

3
  • 1.off-topic as Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow 2. already answered(i'm pretty sure that I saw similar question in last week) ... 3. there is plenty annotation based library for this Commented Feb 3, 2015 at 8:59
  • So why don't you share one @Selvin. It means if you have no answer then downVote it. And where i have asked to recommend a book,software etc. Commented Feb 3, 2015 at 10:27
  • stackoverflow.com/questions/2020088/… This can help you ! Commented Mar 27, 2015 at 15:45

1 Answer 1

2

Here in this website i find that just paste the xml and you will get your java code ready for activity class. i had attached the link

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

1 Comment

Note that link-only answers are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference.

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.