• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to develop Android applications based on Java code

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody!

I just studied Java and I want to develop Android Applications based on Java code. My question is how to do it?
I made a little search on the internert and I found out that a part of the code should be written in XML. Must I study XML in order to make Android application?
What is the easiest way to convert Java code to an Android application?

 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The XML is used for configuration and for the view. The first thing you will need to do is read look at the Android Developer's Network to see what is what: http://developer.android.com/index.html. It has tutorials, design principals, guides, and the all important API.

Next is to make sure your View is separate from your application logic. Android doesn't use Swing or AWT, so you will be re-building your GUI. This is a lot easier if you have a good separation of view from other parts of the application.

Next is to analyze your application for other bits which may need swapping out. Look at the Android API and compare it to the Java API your application actually uses. Not all of the core Java libraries are available, so double check that the classes you use will be available. Similarly examine the third party libraries your application uses and check them for Android compatibility. If you find anything that isn't Android compatible you will need to look up alternatives.

Finally, examine how your application interacts with resources - does it use the file system, does it use a database, the internet, etc... You will probably need to modify these resource-connections to Android compatible alternatives.

It is really hard to take your full application and plop it on Android and get it to work. Often you need to modularize it so you have little independent pieces that you can hook together. You make each module a different library project, and then you make an Android application project which takes the modules that are android compatible and writes android versions of modules which aren't. Similarly, you make a desktop application which takes the modules from the library it can use and builds desktop versions of the other modules to make it work on desktop. Hopefully, the core of your application can be in the modules in the library, and things like database interaction, file system interaction, and GUI are what is left for the platform dependent projects to implement.
 
reply
    Bookmark Topic Watch Topic
  • New Topic