I want to know the difference between java 6 and java 7 while creating android app.
As i have seen a question here. and here. Which should we use and what are the other issue which can occur while using them.
In general Java 7 is on Android not supported. So you have to use Java 6 on Android.
Java 7 is supported from Android API 19 (KitKat 4.4), but it will fail on any other version below.
Related
This question already has answers here:
All com.android.support libraries must use the exact same version specification
(54 answers)
Closed 5 years ago.
I'm learning app development using android studio.
On build.gradle page i got stuck with one error i.e
"compile'com.android.support:appcompat-v7:25.2.0'"
under dependencies.
Do what it says... You need to use 25.2.0, not 23.0.0
This is especially needed because your compileSdk 25 should be using version 25 support library.
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 have some big projects running on Java 6. But I plan to start building them in Java 8 since a lot of build tools have moved away from Java 6.
Is it safe for me to simply compile them with Java 8 and then deploy them in a web container running Java 8? If not, what are the considerations?
FYI, they don't have a proper automated test suite in place.
The problems can be related to:
deprecated methods that are removed in java 8 and you used in the old java 6 code
different behaviour for some methods:
There are aspects of the platform's behavior that are intentionally unspecified and the underlying implementation may change in a platform release.
configuration of web container that can be different from a version supporting java 6 and the version supporting java 8
external libraries that changed during the passage from java 6 to java 8 removing old methods so that your code can't compile
So yes it is possible that the passage from java 6 to java 8 can broke your code.
But if the code compile it is quite sure that the behaviour of the code is the same, because generally (but not always) a retro compatibility is granted. You can be sure of that only running a complete set of unit tests both on java 6 and java 8 versions.
Here some example of not compatibility between java 6 and java 7:
JDK-6527962 : Retire the non-standard package com.sun.image.codec.jpeg. If your code use this package the it doesn't compile on java 8
JDK-6563734 : Path2D.Float and Path2D.Double should have final getPathIterator methods If your code ovewrite the methods declared final the code will not compile passing to java 8
Here a complete official list of incompatibilities between java 6 and java 7
Here a complete official list of incompatibilities between java 7 and java 8
It usually should be, since most of the features are backward compatible. However, there are no guarantees. Please do follow the proper process and do testing before rolling out to production.
For web container , with jdk, version would also have changed. This may cause some problems depending upon the software vendor and what all services you are using from the container ( JNDI, connection pooling etc).I once had a problem in migrating application to higher version of JDK. We also upgraded Websphere. We were using JSF, and higher version of WAS had JSF jars included, which was clashing with our application jars.
Your apps may be using a lot of 3rd party library which may be impacted. Again, mostly you should be Ok, but there can be small issues. Without knowing your applications, I can only suggest migrate and test to confirm.
You need to test things very thoroughly. If there are bugs, then it is imperative to find them and fix them before you move on to the next version. If you have a sunny day scenario and do not have bugs coming from the upgrade, then at least you know that for sure after the testing.
However, you need to know what to focus on. You need to read about changes applied on version 7 and on version 8.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Java 6 is a stable version of this programming language. But I would like to upgrade to the current version java 7. At this time, is recommended to use java 7 in production? Where I can find updated information about the possible problems that I can get if I upgrade to java 7?
Why use or not use java 7 to make JAVA EE applications
This was added later. The main reason not to use Java 7 is that your web server might not support Java 7. e.g. some very expensive EE servers haven't got round to migrating to Java 7 in the 2.5 years since it was available for testing. IMHO this is pretty poor given the money they charge.
At this time, is recommended to use java 7 in production?
AFAIK, Java 7 is more recommended than Java 6, give it is not supported for free any more.
Java 7 is a requirement for the G1 collector, Java Mission Control and JavaFX 2.
Note: with Java 8 coming out soon with many new/powerful features, I expect many developers will be using it by the middle of 2014.
Where I can find updated information about the possible problems that I can get if I upgrade to java 7?
Most of the problems have been around client applet security.
https://blogs.oracle.com/henrik/entry/migrating_from_java_se_6
http://docs.oracle.com/javase/7/docs/webnotes/adoptionGuide/
http://www.slideshare.net/myfear/practical-migration-to-java-7
http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.was_v7/was/7.0/Architecture/WASv7_JavaCompatibility/player.html (note this has audio)
You should use a supported Java version. Have a look at the Oracle Java SE Support Roadmap. Java 6 has reached "END OF PUBLIC UPDATES" - so it is not supported anymore.
At least you should run your Java 6 code on a Java 7 VM.
Aside from the convenient improvements to the language in 7 and the fact that 6 is no longer supported, there were some very serious security issues with 1.6 that caused Apple (amongst others) to drop default support for Java.
Those issues were fixed with 1.7 and for that reason alone, you should update.
Two blogs detailing the controversy below;
http://www.intego.com/mac-security-blog/apple-drops-java-in-latest-os-x-security-release/
http://www.darkreading.com/vulnerability/apple-removes-default-java-support-in-br/240009305
it is dependent, if you are going to make an application for android you may use Java 6, but if your creating a application for desktop it is recommended to use Java 7.
Java 7 have some improvement of course, specially on file io, which is .nio package.
I couldn't find this question asked, so I gotta ask: how closely does Android tie it's OS updates to Java's updates? I am currently developing on the latest version of Java (sometimes I'll work out the Java side and then stick it into Android) and I don't want to worry about Android's JVM.
The Android SDK requires Java 6 JDK. That alone should say that it doesn't use 7 (yet). http://developer.android.com/sdk/index.html
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Scala on Android: java.lang.NoSuchMethodError: java.lang.String.isEmpty
I've just released a new app on Android
I've optimized and obfuscated the code with proguard and tested extensively on my Android 2.3.3 phone. It works all right.
However, I keep getting really strange crash reports in the developer console, such as
java.lang.NoSuchMethodError: java.lang.String.isEmpty
Isn't String.isEmpty() a framework function on all Android devices?
There is TextUtils.isEmpty("your_String");, but haven't seen about your_string.isEmpty()
I found that your_string.isEmpty() works after 2.2 as it was added in 2.3 GingerBread. But, before that you can use TextUtils.isEmpty()