agraham Expert Licensed User Longtime User Jul 31, 2021 #1 I want to play with an androidx component, androidx.window I've installed it using SDK Manager and it is there in extras\b4a_remote\androidx\window\1.0.0-alpha09\window-1.0.0-alpha09.aar and referenced in extras\b4a_remote\installed-components.txt as androidx.window\:window=1.0.0-alpha09 Owing to my utter ignorance of all things androidx I can't work out if it is possible to reference it using JavaObject. I would like to start with something simple like B4X: Copy Dim jo As JavaObject Dim t, b, l, r As Int t = 10 b = 0 l = 0 r = 100 jo.InitializeNewInstance("androidx.window.Bounds", Array As Object(l,t,r,b)) Log(jo.RunMethod("getTop", Null)) But at runtime I get java.lang.ClassNotFoundException: androidx$window$Bounds and I can't work out how to reference it or if I need to do something to include it in the apk. What stupidity am I suffering from?
I want to play with an androidx component, androidx.window I've installed it using SDK Manager and it is there in extras\b4a_remote\androidx\window\1.0.0-alpha09\window-1.0.0-alpha09.aar and referenced in extras\b4a_remote\installed-components.txt as androidx.window\:window=1.0.0-alpha09 Owing to my utter ignorance of all things androidx I can't work out if it is possible to reference it using JavaObject. I would like to start with something simple like B4X: Copy Dim jo As JavaObject Dim t, b, l, r As Int t = 10 b = 0 l = 0 r = 100 jo.InitializeNewInstance("androidx.window.Bounds", Array As Object(l,t,r,b)) Log(jo.RunMethod("getTop", Null)) But at runtime I get java.lang.ClassNotFoundException: androidx$window$Bounds and I can't work out how to reference it or if I need to do something to include it in the apk. What stupidity am I suffering from?
DonManfred Expert Licensed User Longtime User Jul 31, 2021 #2 Did you reference it with #additionaljar? Tried #additionaljar: androidx.window:window Click to expand... ? Upvote 0
Did you reference it with #additionaljar? Tried #additionaljar: androidx.window:window Click to expand... ?
agraham Expert Licensed User Longtime User Jul 31, 2021 #3 Many thanks - that works, I did try #additionaljar, but I obviously got the syntax wrong by referring to the aar file name. Out of interest how does your successful syntax break down and where did you find out how to do it? Upvote 0
Many thanks - that works, I did try #additionaljar, but I obviously got the syntax wrong by referring to the aar file name. Out of interest how does your successful syntax break down and where did you find out how to do it?
DonManfred Expert Licensed User Longtime User Jul 31, 2021 #4 agraham said: where did you find out how to do it? Click to expand... based on playing in the past with different SDKs. All this is based on Examples posted by @Erel ☺ agraham said: Out of interest how does your successful syntax break down Click to expand... It is based on the "path" in the installed-components.txt androidx.window\:window=1.0.0-alpha09 Click to expand... -> androidx.window:window Upvote 0
agraham said: where did you find out how to do it? Click to expand... based on playing in the past with different SDKs. All this is based on Examples posted by @Erel ☺ agraham said: Out of interest how does your successful syntax break down Click to expand... It is based on the "path" in the installed-components.txt androidx.window\:window=1.0.0-alpha09 Click to expand... -> androidx.window:window