I'm a beginner and building android apps and I was wondering, do i have to use XML to build a successful android app?
how does it affect how to user uses the application?
Without XML, is it less secure?, especially if the application requires log in credentials?
I was not able to find any examples online referring to other methods of building an android app than with XML.
Sorry if my question feels stupid, but i would really appreciate a response. Thank you.
do i have to use XML to build a successful android app?
No. You can make your entire layout in Java, and have it look exactly the same (apart from a couple of themeing options that can only be applied through XML).
However, you must have some XML files, like AndroidManifest.xml, and your widget XMLs if you have a homescreen widget.
how does it affect how to user uses the application?
In 99% of the cases, they won't notice.
Without XML, is it less secure?
This question makes no sense.
especially if the application requires log in credentials?
Again, this makes no sense.
How you build your UI is unrelated to security.
Do i have to use XML to build a successful android app?
Well, you need XML to create a native Android app at all since you need an Android Manifest, which happens to be a XML file. It's also a good practice to use String resources and not to use hardcoded strings throughout the app. But I'm sure you are asking weather you need to build your layout in XML, or not right?
In this case you don't have to use XML, but I would recommend you to since building your entire layout dynamically can be a lot more difficult than building it in XML(my personal opinion). But it's possible of course.
how does it affect how to user uses the application?
If you do everything right then a XML build layout can be the same as a dynamically-build one. (There are even a few API advantages building the layout with java than with XML)
Without XML, is it less secure?
No.
Related
What I'm Trying to Do
I'm trying to create something that will allow customers to customize how our android application will be set up. This should be a UI editor that sits on our web server and, upon save, will communicate with our android project so that it can set itself up.
What I've Done So Far
I've been looking into something like a Business Project Management tool that can export itself as an XML (or equivalent). For example : https://demo.bpmn.io/new ... The file that even a simple diagram produces (BPMN) seems far more complicated than what we need, though.
What I Need
We can create something on our own or customize an open source project like this to better fit our needs, but I'm not sure if BPMN is the best approach and I've been having trouble finding sources to learn more about it. Is there a better approach I can take?
My project is still in its very early stages and I would like to make sure I'm at least starting off on a good path.
I'm looking to build an android web app for a website I'm currently coding so I need to know what technologies I'll need to get started. An example of the project I mean is the "stack exchange" android app. Thanks in advance
Well you need the Android SDK first of all ;)
Than you can build a simple Activity with a WebView pointing to the URL of your website. And remember to add permissions for accessing to the Internet on your manifest. This is a very simple Activity but it's a starting point. After that you can add a Toolbar on the top of the Activity and the Navigation drawer on the left side. This is the method I would use :)
Unless there is some specific reason that you only want an app for Android, I would recommend something like Phonegap, which allows you to build the app for every conceivable platform for marginally more effort. Particularly if this is a commmercial app, there are few good reasons to specialize to only one platform.
In order to do this, you need some skills in Javascript/HTML5. Additionally, you should choose some type of structured framework (such as backbone.js, knockout.js, etc.) to organize your app.
Expose your data of your web application through a REST api (There are other methods) and write a native android application.
Or you can just make the web application mobile friendly.
I have a single android app with a custom logo, some custom json service endpoints, occasional custom text, and possibly a custom color scheme.
For my client this particular app will need to be rebranded and distributed as an entirely different app about 5-10 times over. So I'm looking for way to reuse the most amount of code - the activities and services will be identical except for the custom things I mentioned.
First off, how can I share projects in the sense that one project will hold all code (including activities), and the others just modify a few values. I can't think of a smart way to share both service code and activity code with the occasional value thrown in via properties.
Do android layout/string resource files have the ability to pull from properties? Can activities be bundled inside a jar and shared with other projects?
You can use Android library project to share the common code. Start by reading this article
You do not have to have different java namespaces, they can be common for all projects. All you need is to replace resources and modify manifest to contain different namespace for each application. There is no problem with several applications having the same name of classes inside. Unless you want to rebrand it all the way user could not find it is actually the same code, of course.
I am new to android.
As I know, an android app used xml to construct the gui.
Is there a tool to create the gui xml from a visual drag & drop editor?
Have a go with Google App Inventor.
App Inventor only output .apk file. Is there a way to output the XML layout?
DroidDraw you give some help. But not quite easy to use. It can only produce some basic structure.
Well, there's the gui builder in eclipse, which is useful in a few cases. Although, your better of just making the XML yourself, and doing the fine tweaking in the gui editor.
There is droid draw, but from my experience with relative layouts it fails to properly build the xml.
There is also app inventor, but I haven't tried it though so I don't know how well it works.
If your looking for something that is as nice as the iPhone's gui builder, from my experience anyway, your out of luck. Roll up your sleeves and start hacking out xml. (Or java code if you want to write 10x as much). Sorry to have to tell you that.
I would like to add two versions of my app to the Android Market, one for a few cents, and one free version, with ads. That's a very common practice.
I'm currently building AdMod into my app, and it seems I'll have to change quite a few files, so it seems best to make a separate version of my app for this.
How do you achieve that? A branch? A different repository? Has anyone found a way to keep both apps in the same repository in a reasonable manner?
The title is not misspelled, I do mean "realise", i.e. how people manage the two versions, not how they add them to the Market.
This kind of thing is a complete nightmare - unfortunately the Android build system doesn't really support it in any good way.
We do it by having 99% of the code of our application in a library project. We then create one application project for each different version of the app, each of which use that library.
Where we need different versions of the app to behave differently, we currently achieve that by having different resources that are queried at runtime. We are in the process of moving to using Dependency Injection via RoboGuice, however.
There are elements of this that work reasonably well, and others that don't. It's necessary, for example, to duplicate the AndroidManifest.xml file, which can be error-prone (it's easy, for example, to add a new activity to one manifest and forget to do so in the others). It's a mess, unfortunately, but the least-bad solution we've found.
Personally speaking, I would strongly advise against using branches to achieve this effect. They can work well initially, but will rapidly become a maintenance nightmare.
One side benefit of using a library is that we've found that it makes testing considerably easier. For an example of how to set this up, see:
http://www.paulbutcher.com/2010/09/android-library-project-with-tests-step-by-step/
People usually upload them twice(like two different programs) and just modify the title for adding something like Ad-Free, Donate and things like that. And on the free version just add the Free label and also put on the description that it's Ad-Supported.
Here is an example with the SMS Popup application:
For the Android Market, they are considered different programs, but for us it's the same, but one is Ad-Supported and the other isn't.