开发者

Porting Java to Android regarding views

开发者 https://www.devze.com 2023-03-18 09:32 出处:网络
I have a java application (that I\'m wanting to bring over to Android) that relies heavily on java.awt and I\'m wondering what some alternatives could be to the following:

I have a java application (that I'm wanting to bring over to Android) that relies heavily on java.awt and I'm wondering what some alternatives could be to the following:

  • java.awt.BasicStroke
  • java.awt.Cursor
  • java.awt.Graphics
  • java.awt.Graphics2D
  • 开发者_高级运维
  • java.awt.geom.Line2D
  • java.awt.geom.Rectangle2D

Are there Android equivalents for some of these? I am very new to Android development and wanted to know what to expect. All comments and suggestions are welcome


Take a look at the graphics package


This packages wont work here. You have to design the UI in XML. You can develop the UI in android using two basic approach i.e procedural(java code) and declarative(XML code). Try to write a code following this two approaches and try to write in respect to what your awt packages are doing in your java code.

0

精彩评论

暂无评论...
验证码 换一张
取 消