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.

Community
  • 1
  • 1
Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300
  • 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 – Selvin Feb 03 '15 at 08: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. – Zar E Ahmer Feb 03 '15 at 10:27
  • http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a This can help you ! – Rehman Mar 27 '15 at 15:45

1 Answers1

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

Avinash Ranjan
  • 611
  • 5
  • 14
  • Note that [link-only answers](http://meta.stackoverflow.com/tags/link-only-answers/info) 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. – kleopatra Aug 20 '15 at 10:22