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-file and the main layout xml-file is automatically generated. Can I delete those files and replace them by a Java-file?
Ofcourse you can,most android apps are made of java. Import applet or java swing and you can make what you want.
We need to implement and define the tags in XML. XML tags define the data and used to store and organize data. It's easily scalable and simple to develop. In Android, the XML is used to implement UI-related data, and it's a lightweight markup language that doesn't make layout heavy.
Every app project must have an AndroidManifest. xml file (with precisely that name) at the root of the project source set. The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.
eXtensible Markup Language, or XML: A markup language created as a standard way to encode data in internet-based applications. Android applications use XML to create layout files. Unlike HTML, XML is case-sensitive, requires each tag be closed, and preserves whitespace.
For the layouts you have two options
Declare UI elements in XML. Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts.
Instantiate layout elements at runtime. Your application can create View and ViewGroup objects (and manipulate their properties) programmatically.
So for the first question - yes - you can delete xml layout files (if you must).
I think you cannot get rid of the manifest.xml..Quoting:
Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With