Programming for Windows Phone / Windows 10 Mobile | Questions and answers

Rep: (195)
Attached Image

1.Question: And who can explain how to work with the memory of the phone? For example, open and save files, create folders, etc.?
Answer: Work with a piece of phone memory which is a sandbox for the program.

2.Question: But do not tell me how to get the source code of the site page?
Answer: Normal GET request.

3.Question: By the way, who knows what about the native code? Something said before about the possibility of using COM.
Answer: Only OEMs can interact with unmanaged code.

4.Question: How to register (or whatever) the settings page so that you can see in Settings in Application Settings?
Answer: At the moment, no, use a separate page in your application.

5.Question: Tell me, how can a XNA application add a text file or a file with parameters to the resources (not the application settings), and then read it in the program?
Answer: I use Application.GetResourceStream in my project. This method returns a StreamResourceInfo, from there you can pull the stream through the Stream property. But I'm afraid that with XNA this will not work, although for both of them Application is a static class, but it's worth a try. And yes, the main thing in the properties of the file itself is to put Build Mode on Content.
Here is an example of use:
var stream = Application.GetResourceStream (new Uri (path_to_file_of_relative_package, UriKind.Relative)). Stream;

6.Question: How do I make a block with large text? A simple TextBlock displays only one line.
Answer: Just set the TextWrap property = Wrap

7.Question: Is there something like a device name or owner name in WP7? By analogy with WM 6.5 (CurrentUser \ ControlPanel \ Owner Name key)
Answer: Not a name, but a unique identifier, moreover, an anonymous one (not according to Senka's head, a simple developer knows the name of the user)
string id = UserExtendedProperties.GetValue ("ANID") as string;
string realid = id.Substring (2, 32); // otherwise it will be non-unique

8.Question: How easy is it to break WP7 application (* .xap)? Applications written in .net, for example, are edited in a notebook, a separate software, you can view the source code.
Answer: Relatively easy to install on unlocked device

9.Question: Are there any ways to protect the code? By analogs with obfuskatsii in C #.
Answer: The same obfuscation works on WP7. Preemptive Dofuscator from version 4.9 can obfustsirovat whole XAP.

10.Question: Where and how best to store the application settings? On WM 6.5 I used a ready-made class for working with ini files, the configuration file was stored in the program folder.
Answer: IsolatedStorageSettings or Isolated Storage. The first option is preferable for small data, because serialized to XML.

11.Question: Is it possible to realize the sale of applications without AppHub? I would like to start selling "locally" first, say, based on linking the serial number to any PDA parameter
Answer: The non-advanced user (and most of them) will send the forest. "I have to 'unlock' the device with a perverted method, it's unclear to download, which is not clear from where, and it is also not clear where to pay ?????"

12.Question: Why when using WebClient my application hangs, even on a separate thread.
Answer: The current implementation of the WebClient runs in the application's UI thread. Use HttpWebRequest.

Open source software
IE Search Switcher - Fast switching search engines

useful links

Post has been editedKoteiko - 06.12.15, 13:04
Reason for editing: Topic name

Rep: (44)
Links, examples? )))

Rep: (82)
NightShock @ 05/18/2011, 06:57*
Is there any record storage provided by microsoft?
For example, I scored 20 points in a game. I would like this figure to be shown in some general statistics of all players from all parts of the world. It seems like through win live should somehow be implemented or do you need to code the server?

Of course hosting
NightShock @ 05/18/2011, 06:57*
And what is needed for writing the simplest network toy?

Again, hosting and the ability to make HTTP requests. But it was even obvious in both cases.

Rep: (0)
Good afternoon, I am a novice programmer, do not swear if that
I have this question,
Is it possible to connect to the phone application files that are not part of the application itself, bypassing the marketplace (such as additional levels),
On WM 6.X, this is done without problems, but on the phone I can not imagine how it is isolated storage

Rep: (82)
Honestly I absolutely did not understand what was said. Do you want to download a file from the Internet and save it to isolated storage? If so, use HttpWebRequest (in the current version, WebClient works in the UI stream).

Rep: (1082)
Useless guy @ 05/19/2011, 19:31*
Do you want to download a file from the Internet and save it to isolated storage?

as I understand -Vitamin50 spoke not about it ...

Rep: (482)
Vitamin50 @ 05/19/2011, 18:52*
files that are not part of the application itself bypassing the marketplace (type of additional levels )

if these are additional levels for the game, additional maps for the navigation application, etc. that
Useless guy already answered.

if these are files containing executable code, then this is hardly possible.

Rep: (82)
S_K @ 05/20/2011, 11:55*
if these are files containing executable code, then this is hardly possible.

If this is possible, then it will be possible to download only assemblies signed for the current application. As an option - expressions.

Rep: (1)
Tell me how to connect the phone to the application on your computer?
namespace sockets is, and there is no class socket).

Rep: (82)
Socket support will only be in Mango

Rep: (1082)
Useless guy
Well, you can do as I know now, the main thing is to install the latest versionWindows Phone Developer Tools. But the sense of 0, because the devices Mango before the fall will not.

Post has been editedalex - 28.05.11, 20:36

Rep: (1)
I found on xda self-made, implementing socket.
But I have a little problem).

When starting, an error occurs in the line

ComBridge.RegisterComDll ("Network.dll", new Guid ("A3EABD8D-6578-4BB8-8228-9D20C45EE1D6"));

Attempt to access the method failed: System.IO.FileInfo..ctor (System.String)

Not sure how to fix it?

Rep: (82)
Why do all this when the SocketsApi is bundled? Just change the visibility of this class to public and call SocketsApi.Initialize () before using it.

Rep: (1)
Useless guy

Can be more. Is it necessary to change the SDK?

Post has been editedHOMPAIN - 29.05.11, 14:05

Rep: (82)
What does the SDK have to do with it? I'm talking about the assembly.

Rep: (1082)
Perhaps you can add this link to the header -Windows Phone 7 Development Center

Post has been editedalex - 12.06.11, 10:01

Rep: (1082)
More than 20 demo projects for Windows Phone 7.1 -

Rep: (40)
How to add to HAPPhone VS? The normal version of HAP does not integrate, and HAPPhone does not start. I just can't figure out how to use this library, although everything works for everyone ... except for me.

Rep: (82)
Maxim Droy,
I took with SVN, there were no problems.

Rep: (40)
Useless guy @ 06/19/2011, 10:41 PM*
Maxim Droy, Took with SVN, there were no problems.

Yes, that's all turns out. I can not.
You htmlagilitypack-77494 took?

If it is not hard, can you briefly describe the actions of integration? Maybe I missed something. And how about the wall of peas.

Post has been editedMaxim droy - 19.06.11, 22:33

Rep: (82)
Maxim Droy @ 06/19/2011, 11:30 PM*
Yes, that's all turns out. I can not.
You htmlagilitypack-77494 took?

If it is not hard, can you briefly describe the actions of integration? Maybe I missed something. And how about the wall of peas.

Last build 85383. I tried it now - it works fine.

Post has been editedUseless guy - 20.06.11, 08:35

Full version    

Help     rules

Now: 08/03/19, 04:33