P pdmccann Member Licensed User Longtime User Nov 1, 2012 #1 I am brand new to B4A. I have an Android library that seems to work and a plain old Java library. I would like to create a library that works for a customer that uses B4A as their development platform. To see if my library can work I also have written a test harness to use the library. My library takes an android.content.Context for initialization. I have seen reference to BA and context but cannot seem to create or reference these objects in my B4A code. I have looked for a while and am still puzzled as to how to set this in my library object that I create in my test harness. Any help would be greatly appreciated. Doug
I am brand new to B4A. I have an Android library that seems to work and a plain old Java library. I would like to create a library that works for a customer that uses B4A as their development platform. To see if my library can work I also have written a test harness to use the library. My library takes an android.content.Context for initialization. I have seen reference to BA and context but cannot seem to create or reference these objects in my B4A code. I have looked for a while and am still puzzled as to how to set this in my library object that I create in my test harness. Any help would be greatly appreciated. Doug
barx Well-Known Member Licensed User Longtime User Nov 1, 2012 #2 Try adding BA as a parameter. i.e. Code: public void MyMethod(BA ba, [I]any other parameters[/I]) And then in the code for the method use Code: ba.context p.s. I'm no pro at this so I may be wrong.
Try adding BA as a parameter. i.e. Code: public void MyMethod(BA ba, [I]any other parameters[/I]) And then in the code for the method use Code: ba.context p.s. I'm no pro at this so I may be wrong.
P pdmccann Member Licensed User Longtime User Nov 1, 2012 #3 Context question was not clear Thanks for your response. I can find BA in the Eclipse/Java project with auto complete. I was wondering how to pass it from the Basic4Android project. Something like Dim xyz As ClientAction then xyz.Initialize([Context reference])
Context question was not clear Thanks for your response. I can find BA in the Eclipse/Java project with auto complete. I was wondering how to pass it from the Basic4Android project. Something like Dim xyz As ClientAction then xyz.Initialize([Context reference])
barx Well-Known Member Licensed User Longtime User Nov 1, 2012 #4 You don't have to. The BA object is passed automatically.
P pdmccann Member Licensed User Longtime User Nov 1, 2012 #5 Puzzling passage IN the Creating libraries tutorial, I found this: BA - BA is a special object that you can use to raise events and to get access to the user activity, application context and other resources. The compiler is responsible for passing this object. The IDE doesn't expose it. Does this mean I use it in the java program and would simply omit it when I call a library method?
Puzzling passage IN the Creating libraries tutorial, I found this: BA - BA is a special object that you can use to raise events and to get access to the user activity, application context and other resources. The compiler is responsible for passing this object. The IDE doesn't expose it. Does this mean I use it in the java program and would simply omit it when I call a library method?