In a codenameone project - How can I get images programmatically from the project resources folder? - codenameone

CodenameOne changed the project structure after the maven dependence manager passed to be used as the new standard for dependence management.
Now exists a new folder called resources at the same level as the java folder. (in project structure)
I put my images inside the /resources/images.
How can I get these images programmatically?
I tried some java common approaches without success.

Don't put the images in a folder under resources. Put them directly in common/src/main/resources then access them using /imagename.png as you always have.

Related

How do I include the resources from a qooxdoo library

I have created a custom library with resources. It is an editor component that uses the ace editor. So I created the library/app and it works fine. However, when I try to use it in another app by adding a "libraries" entry to the config.json file of the app, it doesn't include the ace files in the resources folder from the custom library. How do I get those files included?
I think you just need to add an #asset hint to your application class, pointing to an asset in the library.
So, for example, if your library's namespace is mycustomlib, you have to add #asset(mycustomlib/*) in your application class.

Automate compilation process for Windows Phone application and multiple variations

I am developing multiple Windows Phone applications that vary only by the content of several files. Applications share the same logic therefore I created a project and multiple folders, one for each app variation with variant's assets and files and moved them to separate location. To compile project I copy over files and follow a standard compilation process with Visual Studio.
Now there are only 5 application variations and for now it is suiting solution, but the number is expected to grow to 50 and more. I would like to automate the process and my current idea is to write a batch script to copy files from variation folder, overwrite project files, compile app with a script and to copy xap package to another location.
My two questions are:
Is my idea good resolution of the problem or is there a more graceful way to do this I am not aware of? (manage and develop multiple app variations)
How would I compile windows phone app from cmd?
I think your problem is valid. I ran into a similar requirement in the past (only that it was for Windows 8 Store Apps), and what I did was the following:
Create a "core" project and moved all the shared logic to that project. I then created a sample app project, referenced the core project and made sure the sample app worked the way I wanted it to.
Finally, I converted the sample app into a Visual Studio template. What this basically does is take the project code and create a Visual Studio template you can reuse.
Read more about it here.
Some work needed to be done within the template source code in order to get some of the dynamic parts like app name into specific locations within the code. For example, you can change a class namespace to be the project's namespace by applying the following code in tour class:
namespace $safeprojectname$
You can read more about template parameters here.
Hope it helps.
To compile windows phone applications or any .NET app from command line you should use
msbuild.exe
. You can find more information and samples here.

Updating DotNetNuke image library

Have written simple file picker control for my dotnetnuke site, because the one that ships with dnn doesn't really do what I need. The file picker uses System.IO for collecting directory information and uploading files to the portals root and subfolders. These images can then be inserted where ever I need them. The problem is images uploaded in this manner don't seem appear appear in the file manager or image manager used by the html/text module.
Is there anyway I can register these files with dnn when I upload them so they will also appear in the html/text image manager?
What would be even better is if there is a way to use the image manager that is built in the html module, outside the module although am not looking to buy a pre-made module.
Any thoughts?
You would want to use the DNN API for uploading files.
As for using the built in Image Manager that you find in the HTML module, that is part of the Telerik Rad Editor. You might be able to dig through the source for the Rad Editor Provider and figure out how to include just that portion into an outside module, though that might technically require a valid Telerik license to do.

.NET 4 ClickOnce where are images stored after deployment

I have a .NET 4 WPF app deployed via ClickOnce.
The app itself is located in this folder:
C:\Users\User\AppData\Local\Apps\2.0\20M1K3QV.1J5\YBVR1JRD.ZCH\mana..tion_94f2a286b90217ab_0001.0000_92543ff193690b91
In my solution images used by the app are located in a subfolder named Images, in a deployed app folder, however, there is no subfolder Images and I did a full search of the drive and was not able to find a specific image by name anywhere but in the original solution Images folder...
Anyway, my question is where are the images stored after ClickOnce deployement? Are they embedded into the app executable?
In your case the images are embedded in the .exe file, which is correct and recommended. If you want something else you should check the Build action and Copy to Output Directory settings in the Properties tool window for each image.
To add to what JaredPar already mentioned if they are set to copy they should create another folder the way you are expecting in your original post.
Most likely they are embedded in your EXE.
Check this Social.MSDN Link

WPF - Copying resources on publishing

I'm developing an WPF application that has an reference of a C# Class Library.
That C# Class Library has a few XML files that i'm copying to output as embed resources.
When i debug the WPF application, those XML are copied to debug folder of WPF and the app runs properly.
But when i publish the application i get errors because the application isn't finding the resources.
I must admit i'm just now introducing to WPF, so i haven't understand yet the process of publishing and installing the application.
Those XML files should be published by VS in "Aplication Files" folder of the published folder? If yes, what i'm i doing wrong?
By the way, i'm accessing those files in my code (of C# Class Library) from AppDomain.CurrentDomain.BaseDirectory
Thanks
Are you using click once for publishing? you can define what dependencies you need and for each one where place must have.

Resources