Android Question Which element for clicking a value

Shelby

Well-Known Member
Licensed User
Longtime User
In my SQLite app, I want to be able to click a value in a column to bring up an image in a new panel/window, etc. Eventually, I want to encrypt the entire app, so which library and, or filetype shall I learn about to find the code to perform this function of displaying? I'm not sure if I should have my stored images in an internal or external repository; can you address that also? I have 3 columns for now and 433 images.
Thanks
 
Last edited:

Shelby

Well-Known Member
Licensed User
Longtime User
Do I need to edit all my images to be the exact same size? (Photoshop)
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Do I need to edit all my images to be the exact same size?
No.
But I have seen that the R702.4.2.png has quite some free space around the real image, I do not know if this has an incidence on the file size.
Did you try the project I sent you?
If yes, does it work?
You can add your files in the folder I mentioned and it should work.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
When I run the new project, it gives a message that it is a new version and may not display properly. However, it did display properly. Looks like you have completely fulfilled my display of images Christmas wish.
Thank you again, as always.
Shelb
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
But I have seen that the R702.4.2.png has quite some free space around the real image, I do not know if this has an incidence on the file size.
The image size may not be a problem for my app. I was able to easily expand or shrink the image when it was displayed on my phone. I'll try some other images when I get them placed in the folder you mentioned.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
Will I need to write all of my images into the following line in the Starter Module?
If File.Exists(ImagesDir, "R702.4.2.png") = False Then
File.Copy(File.DirAssets, "R702.4.2.png", ImagesDir, "R702.4.2.png")
End If

Or a new line for each image?

For example:
If File.Exists(ImagesDir, "R403.3(2).png") = False Then
File.Copy(File.DirAssets, "R403.3(2).png", ImagesDir, "R403.3(2).png")
End If
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
No, not necessarily.
You can copy the files directly to the phone with Windows explorer.
This is what I did first, then I added one file to File.DirAssets to make sure that the project works for you without the need of first copy any file.
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
OK,
I don't want any users to be able to edit anything. Also, I'll be using encryption eventually. Does adding images or anything else with Windows Explorer only pertain to the developer, even after publishing? That's what I want. I realize I'll have to update with Google Play once published.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Does adding images or anything else with Windows Explorer only pertain to the developer, even after publishing?
No problem, I tested it.

Maybe you could first try with the file in the Files.DirAssets folder and see what happens.
The problem would be when you want to add new images, then you would need to provide a new project.
Or use the suggestion above.

Attached you find your project as a B4XPages cross-platform project. It works on all three platforms.
Most of the code is the same, the big difference is that I replaced the Table class by a new class xTableLight.
This is a 'light' version, not yet published, of the Table class, but cross-platform.

I modified the R702.4.2.png image removing the useless white areas.
The new file size is 92 KBytes, the old one is 97 KBytes, not a big gain but useful and the display is better.
 

Attachments

  • SS2021B4X.zip
    467.8 KB · Views: 191
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
Last edited:
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
No problem, I tested it.

Maybe you could first try with the file in the Files.DirAssets folder and see what happens.
The problem would be when you want to add new images, then you would need to provide a new project.
Or use the suggestion above.

Attached you find your project as a B4XPages cross-platform project. It works on all three platforms.
Most of the code is the same, the big difference is that I replaced the Table class by a new class xTableLight.
This is a 'light' version, not yet published, of the Table class, but cross-platform.

I modified the R702.4.2.png image removing the useless white areas.
The new file size is 92 KBytes, the old one is 97 KBytes, not a big gain but useful and the display is better.
Thank you Klaus,
Do you use photoshop or something similar to cut out the white space. I guess I might tackle that time consuming process soon. Also is there something difficult for me to know to use the Windows Explorer as you said you did to add images?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I use acdsee Photo Studio to modify images or photographs.
Maybe the name I give is not the exact name.
I wrote Windows Explorer, but I meant the 'standard' Windows File Explorer.
When I open the File Explorer I see my device when connected via a USB cable.

1638885641645.png


S10 de Klaus is my Samsung Galaxy S10.
You can open it as any other memory device.

1638885612011.png


And this is the folder where the images are saved.
In the logs you get this:
/storage/emulated/0/Android/data/b4a.SS2021B4X/files/Images/
/storage/emulated/0 is equivalent to S10 de Klaus/Phone
/storage/emulated/0/Android/data/b4a.SS2021B4X/files
is what you get with rp.GetSafeDirDefaultExternal("") in the code.
 
Upvote 0
Top