Android Question Solved:Encryption Initialization Creation

Shelby

Well-Known Member
Licensed User
Longtime User
My problem is that my project will no longer compile now that I have attempted to use SQLCipher invented by Zetetic.net.

On a tutorial by Erel,(https://www.b4x.com/android/forum/t...ryption-with-sqlcipher-library.14965/#content), Erel tells me to use the following line to initialize the SQLCipher method.

SQL1.Initialize(File.DirRootExternal, "1.db", True, DB_PASSWORD, ""):

Unfortunately, the IDE slips me the note; Undeclared variable 'SQL1' is used before it was assigned any value.

In actuality I don't have a variable SQL1 anyway, so how shall I change the wording to make it work for my project. I'll attach a screenshot of when the compilation goes haywire.... Whoops, the image was too large. Here's the wetransfer.com link:
https://we.tl/t-vXVH78nqBw

Of course my project is an SQLite one. It has 712 records
 
Solution
Your Additional Libraries path is this (see red border)
微信图片_20240630020631.png

but you put android-database-sqlcipher-4.5.4.aar into project folder not Additional folder
微信图片_20240630020722.png

You should put the android-database-sqlcipher-4.5.4.aar into folder C:\Users\HP\Desktop\Projects\Additional Libraries\B4A

微信图片_20240630021452.png

aeric

Expert
Licensed User
Longtime User
View attachment 155018
layout file mainpage.bal is not used. Are you missing a call to Activity.LoadLayout? (warning #16)

That's the squiggly line hovered message.
That is just a warning or reminder that you may forgot to load the layout file. Your app may show a blank screen.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage") ' <--
End Sub
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
That is just a warning or reminder that you may forgot to load the layout file. Your app may show a blank screen.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage") ' <--
End Sub
The apps have been displaying ok; so I don't think the warning is affecting anything.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Your Additional Libraries path is this (see red border)
微信图片_20240630020631.png

but you put android-database-sqlcipher-4.5.4.aar into project folder not Additional folder
微信图片_20240630020722.png

You should put the android-database-sqlcipher-4.5.4.aar into folder C:\Users\HP\Desktop\Projects\Additional Libraries\B4A

微信图片_20240630021452.png
 
Last edited:
Upvote 0
Solution

Shelby

Well-Known Member
Licensed User
Longtime User
This following from my configuration paths; I'll check your wording above.
C:\Users\HP\Desktop\Projects\Additional Libraries
OH! I put that .aar file in any B4a folder I saw earlier
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
It's compiling ok but the display is a problem. You guys have given me so much time and joy. As usual, this forum is a miracle for some of us.
Thanks,
I'm off for a 100 mile drive for a dinner by Los Angles in the next hour so I'll get back to you tomorrow.
Later,
Shelbinator
 
Last edited:
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
Yeah, the display has stopped. I'll tackle it tomorrow after we return or Monday.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Even though I have no experience with SQLCipher, I read that it is not straight forward like using normal SQL library.
I have no success encrypting a SQL database using DB Browser (SQLCipher).
It seems not easy. I suggest you read that entire thread to learn more.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
Upvote 0
Top