Java program porting to android

Source: Internet
Author: User

Someone has a Java applet to be transplanted to android for running. It is said that android is Java.

However, after setting up the environment and importing the code, we found that a large number of drawing code on awt could not be compiled.

The first thought is to modify the code and use android. graphics to replace those calls of awt. This is a mechanical thing.

Then I came up with an idea. Why do I not use android. graphics in android to implement the basic functions of awt? This greatly simplifies the porting.

The following class needs to be implemented:

Color Font FontMetrics Graphics Rectangle

However, with the attempt, we found that the following class also needs to be implemented:

BasicStroke Graphics2D Stroke GradientPaint RoundRectangle2D MenuItem PopupMenu

Things are getting more and more complex. Is this a feasible path? The study is in progress. If you are familiar with porting Java to android, please kindly advise.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.