Java, XML, or both? [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
For Android app development would it be wise to use only Java, only XML, or a mixture of the two? Which option would you say is easiest or the most efficient? There seems to be more resources for Java so perhaps it would be a better option to use straight Java, but I dunno if I will be losing on out any functionality provided by XML.

I would suggest you to use both. You can completely develop only using java, but I don't think it would be possible only with xml. Because with the help of xml you can define layouts, but you cannot control the functionality of the controls. So, at that point of time java comes into picture. XML provides you a structure based and easy way of implementing UI and java provides the way of controlling and functionality for the application.

You have to use both. XML will be used for structuring the layouts of each screen. Java will pretty much be used for everything else, including ways reference and alter the functionality of the xml files.

You have to use both. Java for controller and almost XML for layout(View, dimen, color, string)
Besides, the advantage of XML is use can easily support multiscreen devices and multi-languages as well.
For support multiscreens: http://developer.android.com/guide/practices/screens_support.html

Related

Building a Charting Library on the JVM from Scratch [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I thought I would ask around here as there are a lot of experienced devs with much more understanding of the Java ecosystem than me.
So, I am looking to build a plotting library for some simulation data I am working on. This will consist of having some subset of matplotlib's functionality. From what I understand I can use the following on the JVM:
JavaFX / Swing
Java2d / java3d
Java OpenGL
Could anyone kindly tell me if any of those are suitable for what I am intending to do, or suggest a better alternative?
I do not want to use an existing plotting library as this is for a project which prevents me from doing so. I can however use a lower level library to build higher level components.
Thanks!
JFreeChart is based on Java2d (AFAICT), so that is definitely an option. You could start by looking at their code, understand their approach and then re-implement the pieces you need. Some will argue that in that case use the library, but as you stated you can't. But there is no shame in using what others have done.

Integration of different parts of code [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am working on a small project on metadata extraction from documents and have run into, eh a dilemma. I have some libraries in Java which work well with document-handling for information retrieval, like Apache Tika, POI etc and some more tools in other languages like Ruby(pdf-extract) and a script in bash to fetch data from a RESTful API using wget.
AFAIK, Code reuse is a good thing, right? But then, if its not possible (natively, I mean) to reuse all this code, What approach has to be taken?
Using Java to run terminal-commands is a solution but I don't think it is good programming practice.
Integrating multiple technologies is something that is very common in real world applications. In order for it to scale properly, you probably want to use some methodology to keep things consistent. To me, the weakest part is probably fetching using wget, but that's my opinion.
In order to integrate and for everything to scale nicely you may want to look at some message passing protocols and have some sort of handling of queues where individual workers run in different programming languages and environments. Look at:
https://www.amqp.org/ (message passing standard)
https://www.rabbitmq.com/ (Java, .NET, Ruby, Python, PHP, JavaScript...

How to maintain database of words in a java dictionary application(other than files) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am developing a java dictionary application...
I used jdbc for maintaining words but i realized that it won't work on other machines since i am making a desktop application...
suggest me a way to maintain words other than files
I don't think there is an alternative to using files if you want to persist your data - it will have to be stored somewhere!
What about the following:
- Use an in memory database that can be persisted to file (h2 for example)
- Use XML persistance - there are plenty of libraries to help.
My suggestion: http://www.manning.com/ingersoll/ :)
And after getting familiar with it, try Solr.
https://lucene.apache.org/solr/
Btw: Please make your question more specific. As this is your first post, I upvoted the question. But think of all the guys around here, who have no knowledge about your problem. Everyone wants to help, but you have to provide more information.
Why not use Embedded Derby?
It's platform independent, uses standard JDBC, and writes files which are accessible across any platform.
http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html
There's no reason why you cannot use JDBC in a standalone java application incidentally. Think of JDBC as a kind of socket you can plug into, but what's behind that socket is entirely implementation specific, and usually can be defined by configuration.
JCR is another good example of this, but this kind of engineering technique is plentiful in the Java universe.

Guidelines for writing Scala API as wrapper over Java API [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have java product with rich set of api. I want to write scala api as a wrapper over those java api. Are there any guidelines for the same. Please share your experience
This is a very vague question as others have noted, but I suppose there are some broad suggestions:
Use JavaConverters to translate Java collections to Scala collections.
Use Scala annotations to represent properties or characteristics represented by other means in Java. Examples of these include #deprecated, #throws, and #BeanProperty. #BeanProperty is especially useful if you want to use a library that specifically demands JavaBeans (i.e conforms to the specification).
If the Java code uses Spring, maybe look into Spring Scala if necessary. Or use more constructor-args. Or asInstanceOf to cast any beans you manually fetch from the context.
Build files. Perhaps you want to replace any Java-specific build mechanism with SBT. Or transform your Java-focused Gradle build file to be more Scala-focused. That kind of thing.
That's all I can think of. Hopefully others will point out other considerations I've missed.

What is the best practice for designing android UI? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am developing an enterprise application in android which has more than 50 screens, so i must look deep into memory management. I am confused about designing it's user iterface in xml or by code. What is the best practice here to have better memory management?
Application which has more than 50 screens.
if you have 50 screens then I suggest to use Reuse UI Components In android..
But
I am confused about designing it's user iterface in xml or by code
you can do it both way But when need same view more than one time then add view using programmatically.or sometimes you need add view dynamically then use programmatically.You can use xml layout and programmatically in one application.
What is the best practice here to have better memory management?
both are best practice related to memory management and no one take more memory if you do interface using xml or code.
#raneez,,,,app designing does not depend on the no of screens,it depends on type of layouts you use.Preferred layout is linear.Also images should be properly placed in the drawable folder..For memorty management you have to debug your app.and check if dere is any exception coming or not....Plz let me know if you are facing any issues still.,...Also can u provide some of the screenshots..of the app that you are going to make,.,,,,,

Categories