Android Tutorial Library compilation - Compile your project to a library

luke2012

Well-Known Member
Licensed User
Longtime User
Outstanding feature!

Only a question.

How to use ExcludeFromLibrary for esclude modules?
 

Julio Ochoa

Member
Licensed User
Longtime User
I question... I can compile a library built in Basic4Android and call it from Javascript (with Html5) ... I would like to to this:
1. Create a library apk using some funcionality of BasicAndroid (i.e call the QR Bar code)
2. Create an apk using html and javascript (i.e phone gap)
3. Invoke the library built in BasicAndroid from the app apk built in phone gap

is this possible?
 

DonManfred

Expert
Licensed User
Longtime User
What you can do is making a simple wrapper-app using webview (incl extras; see tutorials about webview here).

Inside this webview you can show up your html5-website giving it a special parameter that it is called from within this webview (your app)

OR

You also can check if the b4a-object (see infos in warwounds posts and examples) is available from within you html5-page's javascript.
If it is avaiable then your html5-file seems to called from within you app resp. the webview with javascriptinterface in your app

You then can call subs from your app using javascript-calls (see link i posted above)
To make things like getting a barcode happen you have to deal with the javascriptinterface. As i think getting a barcode is handled like "effecting the ui when a sub is called which want a returnanswer. I think the way could be

To get an barcode you have to call a app-sub which dont give an result. In this sub you call whatever it needs to get the barcode... If you got the barcode as a string you then call a pieces of javascript from within your app (see here for more info) to give the barcode back to your website using javascript.

Hope it helps
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
Dim the other view as Private within your class.
 

LucaMs

Expert
Licensed User
Longtime User
Damn, maybe I have not explained well

I have a class: "ClassA". It uses another class: "ClassB", which should not be exposed from the library.

Private objA as ClassA

ObjA.ClassB <--- should not be visible (available)
 

stevel05

Expert
Licensed User
Longtime User
You must have a Dim for ClassB within ClassA, this should be
B4X:
Private ObjB As ClassB
 

stevel05

Expert
Licensed User
Longtime User
I've just tested it here and it works as expected, can you post your code?
 

stevel05

Expert
Licensed User
Longtime User
If I type "ObjA." I don't see ObjB in the list.
 

stevel05

Expert
Licensed User
Longtime User
No Problem
 

stevel05

Expert
Licensed User
Longtime User
Yes I can see both under these circumstances, I'm not sure you can hide it. One for Erel I think.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…