S ShadTech Member Licensed User Aug 1, 2022 #1 cant load image from sub folder in assetsdir and the folder is there when i checked it it rises error b4xpagepg2_clv1_visiblerangechanged (java line: 300) java.io.FileNotFoundException: AssetsDir/Modern/Modern/Commercial/Hall/Hall Meating/fefa34a6a15f0644d07d80de030a5907.jpg: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:456) at java.io.FileInputStream.<init>(FileInputStream.java:76) at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:214) at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.initializeSampleImpl(CanvasWrapper.java:601) at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.InitializeResize(CanvasWrapper.java:548) at anywheresoftware.b4a.keywords.Common.LoadBitmapResize(Common.java:1370) at anywheresoftware.b4a.objects.B4XViewWrapper$XUI.LoadBitmapResize(B4XViewWrapper.java:699) at com.AQ_Design.b4xpagepg2._clv1_visiblerangechanged(b4xpagepg2.java:300) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213) at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1178) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Posix.open(Native Method) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) at libcore.io.IoBridge.open(IoBridge.java:442) ... 19 more Click to expand... any help << Code: img.Bitmap = xui.LoadBitmapResize(File.DirAssets,"Modern/Modern/Commercial/Hall/Hall Meating/fefa34a6a15f0644d07d80de030a5907.jpg", p.Width / 2, p.Height+200, True)
cant load image from sub folder in assetsdir and the folder is there when i checked it it rises error b4xpagepg2_clv1_visiblerangechanged (java line: 300) java.io.FileNotFoundException: AssetsDir/Modern/Modern/Commercial/Hall/Hall Meating/fefa34a6a15f0644d07d80de030a5907.jpg: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:456) at java.io.FileInputStream.<init>(FileInputStream.java:76) at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:214) at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.initializeSampleImpl(CanvasWrapper.java:601) at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.InitializeResize(CanvasWrapper.java:548) at anywheresoftware.b4a.keywords.Common.LoadBitmapResize(Common.java:1370) at anywheresoftware.b4a.objects.B4XViewWrapper$XUI.LoadBitmapResize(B4XViewWrapper.java:699) at com.AQ_Design.b4xpagepg2._clv1_visiblerangechanged(b4xpagepg2.java:300) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213) at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1178) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Posix.open(Native Method) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) at libcore.io.IoBridge.open(IoBridge.java:442) ... 19 more Click to expand... any help << Code: img.Bitmap = xui.LoadBitmapResize(File.DirAssets,"Modern/Modern/Commercial/Hall/Hall Meating/fefa34a6a15f0644d07d80de030a5907.jpg", p.Width / 2, p.Height+200, True)
Erel B4X founder Staff member Licensed User Longtime User Aug 1, 2022 #2 Don't use subfolders inside the assets folder. It will only make things more difficult. Upvote 0
S ShadTech Member Licensed User Aug 1, 2022 #3 Erel said: Don't use subfolders inside the assets folder. It will only make things more difficult. Click to expand... can i use it in Dirinternal or cashDirinternal? Upvote 0
Erel said: Don't use subfolders inside the assets folder. It will only make things more difficult. Click to expand... can i use it in Dirinternal or cashDirinternal?
MicroDrie Well-Known Member Licensed User Longtime User Aug 1, 2022 #4 Don't mix up directories and filenames. A filename is only a filename. A directory name included all sub directories. Code: Dim DirStr As String = $"${File.DirDefaultExternal}/Modern/Modern/Commercial/Hall/Hall Meating"$ Upvote 0
Don't mix up directories and filenames. A filename is only a filename. A directory name included all sub directories. Code: Dim DirStr As String = $"${File.DirDefaultExternal}/Modern/Modern/Commercial/Hall/Hall Meating"$
LucaMs Expert Licensed User Longtime User Aug 1, 2022 #5 Erel said: Don't use subfolders inside the assets folder. It will only make things more difficult. Click to expand... I agree. You can (should?) create groups in the tab "Files manager": Upvote 0
Erel said: Don't use subfolders inside the assets folder. It will only make things more difficult. Click to expand... I agree. You can (should?) create groups in the tab "Files manager":
S ShadTech Member Licensed User Aug 2, 2022 #6 LucaMs said: I agree. You can (should?) create groups in the tab "Files manager": View attachment 132001 Click to expand... can i load image from file manager using AssetDir or there is another way??? Upvote 0
LucaMs said: I agree. You can (should?) create groups in the tab "Files manager": View attachment 132001 Click to expand... can i load image from file manager using AssetDir or there is another way???
LucaMs Expert Licensed User Longtime User Aug 2, 2022 #7 ShadTech said: can i load image from file manager using AssetDir or there is another way??? Click to expand... You must load files from File.DirAssets. However, even if you create some groups as I showed you in my previous post, the files will still be in the only directory on PC: B4A/Files/. Let's say that groups can be considered virtual directories. Note that those files can only be used for reading; so, for example, if you were to put a SQLite DB file in it, you could not work on that file directly, you would have to copy it (usually to the File.DirInternal) and work on that copy. Upvote 0
ShadTech said: can i load image from file manager using AssetDir or there is another way??? Click to expand... You must load files from File.DirAssets. However, even if you create some groups as I showed you in my previous post, the files will still be in the only directory on PC: B4A/Files/. Let's say that groups can be considered virtual directories. Note that those files can only be used for reading; so, for example, if you were to put a SQLite DB file in it, you could not work on that file directly, you would have to copy it (usually to the File.DirInternal) and work on that copy.
ilan Expert Licensed User Longtime User Aug 2, 2022 #8 ShadTech said: can i use it in Dirinternal or cashDirinternal? Click to expand... yes in DirInternal there should not be any problem Upvote 0
ShadTech said: can i use it in Dirinternal or cashDirinternal? Click to expand... yes in DirInternal there should not be any problem