PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
[WM 26] Android 11 access to device photo album
[WM 26] Android 11 access to device photo album
Started by Claire, Apr., 21 2022 7:32 PM - No answer
Connect yourself…
Claire
#1
Registered member
48 messages
Posted on April, 21 2022 - 7:32 PM
I have a button in my app that is supposed to open up the device photo album so that you can select an image from your photos. With Android 11, it seems like AlbumPicker doesn't work? I've tried a few methods listed like adding in a notification and what not but I can't seem to find anything that works. All I need is for the button to open up the photo album on the device and allow you to select a photo. Then the rest of the code creates a copy of the image and adds it in the app. It's worked just fine up until now (Android 11)
Below is my original code...
s
TempPhoto is string
s
ReducedSizePhoto is string
s
Thumb is string
s
TempPhoto
=
""
s
TempPhoto
=
AlbumPicker
(
)
IF
s
TempPhoto
=
""
THEN
Error
(
ErrorInfo
(
)
)
RETURN
E
ND
HourGlass
(
True
)
ProcessPhoto
(
s
TempPhoto
)
E
XPRESS_WIN_REPORT.IMG_TMP
=
s
TempPhoto
s
ReducedSizePhoto
=
gs
TempDir
+
"r500kb_"
+
DateSys
(
) +
"_"
+
TimeSys
(
) +
".jpg"
IF
fSize
(
s
TempPhoto
) >
500000
THEN
//bytes
IF
dSaveImageJPEG
(
E
XPRESS_WIN_REPORT.IMG_TMP
,
s
ReducedSizePhoto
,
50
) =
False
THEN
Error
(
ErrorInfo
(
)
)
E
ND
E
LSE
fCopyFile
(
s
TempPhoto
,
s
ReducedSizePhoto
)
E
ND
//fDelete(sTempPhoto)
s
Thumb
=
E
XPRESS_WIN_REPORT.GiveMiniatureName
(
s
ReducedSizePhoto
)
CreateMiniature
(
s
ReducedSizePhoto
,
s
Thumb
)
IF
gn
CurrentObsPicturesTaken
=
0
THEN
gs
TempPhoto1
=
s
ReducedSizePhoto
E
XPRESS_WIN_REPORT.IMG_Photo1
=
s
Thumb
E
LSE
gs
TempPhoto2
=
s
ReducedSizePhoto
E
XPRESS_WIN_REPORT.IMG_Photo2
=
s
Thumb
E
ND
HourGlass
(
False
)
gn
TotalPicturesTaken
=
gn
TotalPicturesTaken
+
1
gn
CurrentObsPicturesTaken
=
gn
CurrentObsPicturesTaken
+
1
E
XPRESS_WIN_REPORT.STC_Photo_Counter
=
"# Saved photos: "
+
gn
TotalPicturesTaken
+
" Max allowed: 20"
Close
(
WIN_
PHOTO_SOURCE
)
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text