Problem with my Extension


#1

I created Extension aix to measure text width and height
I used : import java.awt.Font;
and create object fnt from class Font:
Font fnt = new Font(FontName, Font.BOLD, FontSize);

My code sure correct and run in java compiler and my Extension was build successful
But when i am using my extension in ai2 or AppyBuilder … error message appears

Runtime Error
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Font;

what is the problem ?


#2

#3

What are you useing this for?
Could you get away with just measuring the View?


#4

I created this extension to improve responsive controls in any app


#5

Could you get away with just measuring the View?


#6

measuring the view ? what are your mean ?


#7

You can measure the width and height of the View(TextView, EditText, etc…)


#8

Ken … I need to measure text width and height as feature to any one not only for controls… may be there is another usage for this feature


#9

Is there is another class can use fonts compatible with extension which is using with ai2 or others same platforms


#10

I don’t understand what you are trying to do.

That being said maybe this will help, or maybe not.

https://proandroiddev.com/android-and-typography-101-5f06722dd611


#11

this link not working


#12


#13

you asked me what is the benefit of this feature… for example if i want create rectangle in canvas in ai2
and put in the rectangle changeable text so rectangle must expand to contain the text


#14

#15

I am not sure but i will try to make some tests with android classes… thanks Ken