Android - Create app with pure Java and no XML?

前端 未结 6 933
清酒与你
清酒与你 2020-12-08 14:38

I\'m wondering if it is possible to create an Android app with only Java. No XML, no other things.

In Eclipse, when I create a new Android Project, the Manifest xml-

6条回答
  •  情话喂你
    2020-12-08 15:31

    I fully agree Van Coding. If you have the proper programming language, you can write much more concise layout definitions than with AXML. A C# example how to replace AXML layouts

    ViewGroup Layout(ViewGroup layout, IList contents) {
        if (contents != null)
            foreach (View v in contents)
                layout.AddView(v);
    
        return layout;
    }
    

提交回复
热议问题