How should I add images using PhoneGap and Windows Phone 7? - windows-phone-7

I am new to using PhoneGap for windows phone 7.
I'm not entirely sure what the problem is - when I try to add an existing image, it's not added to the CordovaSourceDictionary.xml file, but if I manually add the image to CordovaSourceDictionary.xml, it is deleted when I build. How should I fix this problem?

Here is a tutorial by Daniel Egan. Also I have some other links for you
Tutorial: how to create HTML5 applications on Windows Phone thanks to PhoneGap.
Getting Started with Windows Phone.
Getting Started with Windows 8.
Apache Cordova Documentation.
Hope this will help you.

Check image Build Action property (Solution explorer, item Properties view). It must be set to Content, (when you add image, by default this property value is Resource)

CordovaSourceDictionary.xml is updated by the build process which relies on the way Visual Studio works. You need to trigger a file update, you know, like Right click on the Solution > Add > Add new folder / Existing item etc.
What I do is drag the file from Windows Explorer into the Visual Studio project and drop it in the images folder. NOW Visual Studio knows you have add a new file and when you run the project CordovaSourceDictionary.xml gets automagically updated with your changes.
Keep up the good fight!

This probably isn't what is breaking your system, but the JS framework I use adds a url query to each image when in a debugging mode (in order to force browsers to reload image, instead of using cached). So, my image "image/background.jpg" would be accessed as "image/background.jpg?d=34342233". But, when running on phoneGAP for Windows Phone, it won't recognize the image, and thus it shows up as broken. So, I had to turn off debugging for the framework I use, and suddenly the images showed up. Don't forget to set the Build Action to "Content" as mentioned earlier.

Related

Trying to publish ASP.NET Core React app with Electron.NET

So my understanding from the documentation to perform a publish is I need to call 'electronize build /target win'. This builds the project. However, there are some issues I'm unsure how to address.
The content path when I try to run it says the content root is C:\Windows\system32 instead of the actual working directory where the .exe resides. That isn't correct. Any ideas why? I think some of the other issues are caused by this.
Edit: I found out #1 uses the correct directory if it is ran as administrator. Unsure why.
How does one hide the command menu that comes up? all i want is the electron window to show on publish.
I see an electron window come up like when i run 'electronize start' but not after publishing. Any ideas?
Please try the latest version of Electron.NET. During development, a development menu is displayed. A standard behavior of Electron if you not have your own menu. With a build, the development menu is hidden again.

Remove Temporary key C# Windows 8 App

How do I Remove a Temporary key in a C# Windows 8 App? I downloaded a template that has one and got the error it expired. Do I need to put in a key of my own? I'm sure the author wont care its just the C# Windows Store Grid App XAML) Template that visual studios ultimate 2013 provides. The author just added a background image to show people how to do that. I removed his image and put in my own.
I'm a total noob at coding this is my first time using visual studios. All I understand atm is web design and adding snippets and changing values of code as well as compiling it.
I like to open, open source code to learn from it and see how it works.
Within your solution, double-click on the "Package.appxmanifest" file. This should open up the "App Manifest Designer". Go to the Packaging tab. Click on the button labeled "Choose Certificate..." and choose a new certificate. Chances are you want "Create test certificate...". You don't need a password. Hit OK and you should be good to go.
If you're looking to sideload the app onto other machines at your workplace or upload the app to the app store, you've got quite a bit of other work to do -- but that is I think outside the scope of this question.

phonegap windows phone copy existing www over?

I have created a phonegap windows phone project, did the install and setup. It runs fine with the demo/default code when I run the emulator.
I have an existing android project. I drag my www folder to the windows project and nothing works.
The manifestprocessor.js does not build any of the new files in the xml. When I right click my new files I do not have an option to select a build action. I do not get any errors on the build. I want to also note that my default htnl file should load login.html (I updated the CordovaView.xaml.cs file) and the cordova.js files is inside the "js" folder in www, not on the root like the default setup.
Anyone have any ideas? I have never developed using visual studio, I am guessing I need to get my new files to be recognize so I can assign build actions I guess but since it won't let me I am not sure what to do, or even if that is the problem.
Thanks for your time and suggestions.

Source files added as links do not open in Windows 8 App project if they have been added to another project as well

I'm trying to share code over several platforms by adding the source as a link into each project. If, for example, I add the same source file as a link in a Windows 8 Store App project and a Windows Phone 8 project, no matter which link I click (in either project) the file will open in the Windows Phone project, so the IntelliSense will only suggest the relevant Phone namespaces. If the linked file has only been added to the Windows 8 project it works just fine.
Is there any workaround for this?
I actually found the answer as I was typing this. The problem was with VSCommands, disabling Smart Linked File Navigation under IDE Enhancements->Solution Explorer in the VSCommands options page fixed it. Just thought I'd post this in case someone else ran into the same issue.

WP7 app could not start for debugging

I have to create around 200 WP7 apps that are very similar. They differ only in the content, icons and name. So manually create them isn't a good idea so let's I've written a little tool, which does the following:
Copy the created template project
Copy the content files from a source directory to the copied template.
Change the app name, tile name and app id in the WMAppManifest.xml
Add the copied content files in the .csproj-file.
This works and the generated project opens error-free in Visual Studio 2010 and compiles without errors. The xap-file can be deployed on device and emulator.
The problems:
If I want to debug the app by pressing F5 in Visual Studio I get "The application could not be launched for debugging. Ensure that the target device screen is unlocked and that application is installed", both for device (which is unlocked and connected with Zune/WPConnect) and the emulator.
If I try to start the app on the emulator it closes immediatle after start. BUT if I start the app on my device it works like a charm. Crazy stuff.
The curious stuff: If I do the things which my little tool does manuelly I can debug the project from Visual Studio.
This only occures with my generated projects. Every other WP7 project (existing or newly created within VS) works and debugs error-free.
I tried to PCs: Win7 x64 with VS2010 Ultimate and an other one Win7 x64/VS2010 Pro and on both maschines I have the problem.
Maybe someone has an idea which causes the problem. Thanks for the help!
Edit: I've seen something new: The AssemblyInfo.cs file is located in the properties folder and correctly included in the csproj-file. But if I try to open the Assembly Information from the project properties all fields are empty and if I try to set them I get an error ("value is not in the expected range" or something like this).
I've got similar problem with some sample programs.
It turned out that I have to set in a Solution properties:
Active config => Debug|Windows Phone
it works for me
If they only differ in content, icons, and name, would it be simpler to make one complete app, copy it 199 times, and then just put the appropriate files into the correct directories?(if you made a tool to make templated projects, i'm sure you could do this with code too)
Plus that way if you ever need to change the program you can just recopy with that code again, but not copy the content, thus updating all of your individual 200 apps.

Resources