Starchild Active Member Licensed User Longtime User Nov 6, 2015 #1 I want to use my own icon with the NOTIFY. I need to place my own image file into res/drawable folder. This folder is read only at runtime so I can not copy (from an asset file) into this folder. How do I get my image file into the res/drawable folder on the device so I can referance it with NOTIFY.
I want to use my own icon with the NOTIFY. I need to place my own image file into res/drawable folder. This folder is read only at runtime so I can not copy (from an asset file) into this folder. How do I get my image file into the res/drawable folder on the device so I can referance it with NOTIFY.
eurojam Well-Known Member Licensed User Longtime User Nov 6, 2015 #2 Put your icon in the res/drawable folder (for ex. myicon.png), make it read only an then load it Code: Copy .... Dim AndroidResources1 As AndroidResources Dim Mydrawable1 As BitmapDrawable Mydrawable1=AndroidResources1.GetApplicationDrawable("myicon") 'without the file extension! .... Upvote 0
Put your icon in the res/drawable folder (for ex. myicon.png), make it read only an then load it Code: Copy .... Dim AndroidResources1 As AndroidResources Dim Mydrawable1 As BitmapDrawable Mydrawable1=AndroidResources1.GetApplicationDrawable("myicon") 'without the file extension! ....
Starchild Active Member Licensed User Longtime User Nov 8, 2015 #3 eurojam said: Put your icon in the res/drawable folder (for ex. myicon.png), make it read only an then load it Code: Copy .... Dim AndroidResources1 As AndroidResources Dim Mydrawable1 As BitmapDrawable Mydrawable1=AndroidResources1.GetApplicationDrawable("myicon") 'without the file extension! .... Click to expand... Again, I ask, HOW do I get an image file into the res/drawable folder ? I have read everything I can find. Everywhere they tell you how to split up resources and how to access them. Ecliple say COPY/PASTE in to the res folder. But this just gets deleted at compile time for b4a. So, I know now I am missing something very basic here. Please explain the method of adding recources (image file) to my project? I don't mean asset files. I'm OK with this. Upvote 0
eurojam said: Put your icon in the res/drawable folder (for ex. myicon.png), make it read only an then load it Code: Copy .... Dim AndroidResources1 As AndroidResources Dim Mydrawable1 As BitmapDrawable Mydrawable1=AndroidResources1.GetApplicationDrawable("myicon") 'without the file extension! .... Click to expand... Again, I ask, HOW do I get an image file into the res/drawable folder ? I have read everything I can find. Everywhere they tell you how to split up resources and how to access them. Ecliple say COPY/PASTE in to the res folder. But this just gets deleted at compile time for b4a. So, I know now I am missing something very basic here. Please explain the method of adding recources (image file) to my project? I don't mean asset files. I'm OK with this.
mangojack Expert Licensed User Longtime User Nov 8, 2015 #4 as @eurojam stated ... Put your icon in the res\drawable folder (for ex. myicon.png), make it read only an then load it Click to expand... So manually copy your icon to MyApp\Objects\res\drawable folder and change its file attribute to READ ONLY ! (this will stop it getting deleted) then Code: Copy Notif.Icon = "myicon" 'no need for extension .. Last edited: Nov 8, 2015 Upvote 0
as @eurojam stated ... Put your icon in the res\drawable folder (for ex. myicon.png), make it read only an then load it Click to expand... So manually copy your icon to MyApp\Objects\res\drawable folder and change its file attribute to READ ONLY ! (this will stop it getting deleted) then Code: Copy Notif.Icon = "myicon" 'no need for extension ..
Starchild Active Member Licensed User Longtime User Nov 8, 2015 #5 mangojack said: as @eurojam stated ... So manually copy your icon to MyApp\Objects\res\drawable folder and change its file attribute to READ ONLY ! (this will stop it getting deleted) then Code: Copy Notif.Icon = "myicon" 'no need for extension .. Click to expand... Thankyou very much. It now shows my new icon in the notification panel. Although, if I file explore the folder on my phone at sdcard/android/data/myapp/files/virtual_assets/objects/res/drawable I can not find my icon file here. So I am still not sure what mechanism is taking place to access myicon. I thought it would be held as a file in this folder for myapp on my phone. Do you have any further info regarding this. I would like to better understand. Thanks again. Upvote 0
mangojack said: as @eurojam stated ... So manually copy your icon to MyApp\Objects\res\drawable folder and change its file attribute to READ ONLY ! (this will stop it getting deleted) then Code: Copy Notif.Icon = "myicon" 'no need for extension .. Click to expand... Thankyou very much. It now shows my new icon in the notification panel. Although, if I file explore the folder on my phone at sdcard/android/data/myapp/files/virtual_assets/objects/res/drawable I can not find my icon file here. So I am still not sure what mechanism is taking place to access myicon. I thought it would be held as a file in this folder for myapp on my phone. Do you have any further info regarding this. I would like to better understand. Thanks again.
mangojack Expert Licensed User Longtime User Nov 8, 2015 #6 Starchild said: So I am still not sure what mechanism is taking place to access myicon. I thought it would be held as a file in this folder for myapp on my phone. Do you have any further info regarding this. I would like to better understand. Thanks again. Click to expand... Maybe someone with more neurons will be able to help there .. Upvote 0
Starchild said: So I am still not sure what mechanism is taking place to access myicon. I thought it would be held as a file in this folder for myapp on my phone. Do you have any further info regarding this. I would like to better understand. Thanks again. Click to expand... Maybe someone with more neurons will be able to help there ..
C catster Member Licensed User Longtime User Apr 1, 2022 #7 eurojam said: Put your icon in the res/drawable folder (for ex. myicon.png), make it read only an then load it Code: Copy .... Dim AndroidResources1 As AndroidResources Dim Mydrawable1 As BitmapDrawable Mydrawable1=AndroidResources1.GetApplicationDrawable("myicon") 'without the file extension! .... Click to expand... Why B4A delete files in resource folder? This is inconvenience that have to mark it readonly after checkout project from source control. Upvote 0
eurojam said: Put your icon in the res/drawable folder (for ex. myicon.png), make it read only an then load it Code: Copy .... Dim AndroidResources1 As AndroidResources Dim Mydrawable1 As BitmapDrawable Mydrawable1=AndroidResources1.GetApplicationDrawable("myicon") 'without the file extension! .... Click to expand... Why B4A delete files in resource folder? This is inconvenience that have to mark it readonly after checkout project from source control.
DonManfred Expert Licensed User Longtime User Apr 1, 2022 #8 prizemart said: Why B4A delete files in resource folder? This is inconvenience that have to mark it readonly after checkout project from source control. Click to expand... Posting to an old thread is a mistake. You should always create a new thread for your issues. You can use additionalres directive and put the files into this folder (in correct subfolder). B4X: Copy #additionalres: ..\Resource Resource is a folder in the Projectfolder beside Files-Folder. Files in Resource will not be deleted at compiletime. Upvote 0
prizemart said: Why B4A delete files in resource folder? This is inconvenience that have to mark it readonly after checkout project from source control. Click to expand... Posting to an old thread is a mistake. You should always create a new thread for your issues. You can use additionalres directive and put the files into this folder (in correct subfolder). B4X: Copy #additionalres: ..\Resource Resource is a folder in the Projectfolder beside Files-Folder. Files in Resource will not be deleted at compiletime.