load a icon from web

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Helo,

how can i load a Icon in the Notification from web?

this code doesn't working

B4X:
Notification1.Icon = "http://www.xxxxxx.com/download/picture/1.png"

can someone help me?

greet
sinan
 

madSac

Active Member
Licensed User
Longtime User
Helo,

how can i load a Icon in the Notification from web?

this code doesn't working

B4X:
Notification1.Icon = "http://www.xxxxxx.com/download/picture/1.png"

can someone help me?

greet
sinan

You cannot use an image directly.You will have to first download it locally then use it .
 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Helo,

i have download the Picture with DownloadService Modul in this directory
B4X:
File.DirRootExternal & "/images"

and call so..

B4X:
Notification1.Icon = LoadBitmapSample(File.DirRootExternal & "/images", ayir2(0) & "de.png", 100%x, 100%y)

but doesn't work

can someone help me?
 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Helo,

this code

B4X:
Notification1.Icon = File.OpenInput(File.DirRootExternal & "/images", ayir2(0) & "de.png")

doesn't work too
 
Upvote 0

socialnetis

Active Member
Licensed User
Longtime User
Are you debugging this with the phone connected to the computer? Because, if that is the case, the DirRootExternal wont be available.

Also, I suggest using File.Combine instead of "File.DirRootExternal & /images"
 
Upvote 0

madSac

Active Member
Licensed User
Longtime User
Are you debugging this with the phone connected to the computer? Because, if that is the case, the DirRootExternal wont be available.

Also, I suggest using File.Combine instead of "File.DirRootExternal & /images"
it is not in every case if you have turned on storage only then it will not be available.
 
Upvote 0

madSac

Active Member
Licensed User
Longtime User
Helo,

this code

B4X:
Notification1.Icon = File.OpenInput(File.DirRootExternal & "/images", ayir2(0) & "de.png")

doesn't work too
Can you post log of
B4X:
File.DirRootExternal & "/images" & " File= " & ayir2(0) & "de.png"
And file list of File.DirRootExternal & "/images"
 
Upvote 0

Sinan Tuzcu

Well-Known Member
Licensed User
Longtime User
Hi Erel,

how it works in WhatsApp?
it also appears in the Notification the image from the sender.
 
Upvote 0
Top