Android Question Using a file in a java lib

kepler

Active Member
Licensed User
Longtime User
Hi,

Good evening.
I've done a Java Lib to be used in B4A as an help accessory.
Now, my problem is this: the java lib must read a set of files. I can pass, I think, the path to the lib through B4A.
But where do I place the files? Is it in the Files Folder inside the B4A project? Will they be added to the project when compiled?
And, in that case, what is the correct path to provide to the lib?
Is it:

File.DirDefaultExternal & "/Files/"

or just

File.DirDefaultExternal

or other

?

I'm a little mixed up here...Sorry.

Kind regards,

Kepler
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi,

I've just made a test....
I putted a file in the Files folder of my project, Test.txt, and compiled it.
In the code, I placed the code:


B4X:
Dim fname As String = File.DirDefaultExternal
   
    Msgbox(fname,"Info")
   
    If File.Exists(fname, "Test.txt") Then
    Msgbox("It's there!!!","Info")
    End If

I don't receive the message "It's here!!!" - just the different paths. I've tryed also DirRootExternal without luck...

Now, can someone tell me where's my file? Was it included in my project?

Kind regards,

Kepler
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi Don,

Well, the file is there. But I can't get it - the message box tells nothing.
Maybe the file isn't being packed and installed with my program?

Kepler
 
Upvote 0
Top