• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Web / Android

 
Jacqueline Steremberg
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello! I am really new to JAVA, and I wanted to know if I could use java classes meant originally for a web application, for an Android App.
Thank you in advance!
 
fred rosenberger
lowercase baba
Bartender
Posts: 12266
36
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe Android uses the MicroEdition (or whatever it is called). This doesn't have all the same classes/tools that the full blown Java has. So depending on what is in it, the answer is "maybe".
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As fred says, it depends. If the class is just one that's independent of the web environment, and has no other dependencies on environments that won;t exist on Android, then you might be able to.

Classes specifically requiring the web environment (anything in the servlets packages, for example) would not be.
 
Jacqueline Steremberg
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know where I can find documentation on which classes to use than I can then reuse on the Android app?
Thank you very much!
 
fred rosenberger
lowercase baba
Bartender
Posts: 12266
36
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did this class come from? Is it part of the standard JRE, or is it one that you/your company/someone you know wrote?

If you are looking at Oracle written classes, I think you want this - the Java ME API.

Otherwise, you're going to have to either a) ask the person who wrote it, b) examine the code, or c) try it and see.
 
Jacqueline Steremberg
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nono, the code is not written yet. I am going to code some classes for a web application and I want it them to be reusable in the future when i develop the Android App.
Thank you very much!
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe Android uses the MicroEdition

Actually, it does not, so the Java ME API is not available. Android consists basically of the Java SE 5 class libraries, minus anything to do with AWT and Swing, plus some stuff from Java 6, plus a bunch of extra classes mostly to do with the mobile environment and GUI. The full javadocs can be found at http://developer.android.com/reference/packages.html. Note that what is available *exactly* depends on which Android API level you're targeting, as each new Android version adds additional classes and methods. On the upper left is an "API level" menu - if you select "15" (a reasonable level for a new app, corresponding to Android 4.0.3 and newer), then you'll see only those classes that are available on that level.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic