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



Rep: (195)
Attached Image


FAQ
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.
http://blog.zwezdin.com/ru/201

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: (767)
HOMPAIN,
She's like .NET? Then you add and search in Program.Resources.



Rep: (1)
-Wolf-,
I'm just asking how to open the file itself?

I could load a string from XML.
Can I put a value table or an object of my class in it?



Rep: (82)
HOMPAIN,
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_for_package, UriKind.Relative)). Stream;
And then read StreamReader'om.



Rep: (1)
At first, I didn’t start the emulator on my laptop due to the small amount of RAM and I started running Windows with an application automatically created by the compiler.

And so I bought the RAM and the emulator started :), but it turned out that the function Convert.ToDouble (str); in a Windows application, it recognizes a number with a comma, and an emulator with a dot.)

Can I fix this somehow without changing all the commas to periods?



Rep: (767)
HOMPAIN,
For sure. You need regional standards. For example, on dotnet there is just float.Parse (string), and there is an overloaded one with a choice from regional standards. Emulator then stopud American :)



Rep: (1)
Found a function with a choice of format. But then I have to forward all the code.

Can I somehow change this in the project settings so that the standard function is taken the same?



Rep: (482)
HOMPAIN @ 10.29.2010, 01:04*
Can I somehow change this in the project settings so that the standard function is taken the same?

that is, whatever the regional settings in your program would be considered a "correct" point?
It is understood that all potential users of the program will always have the same regional settings, and if not, are they to blame?



Rep: (482)
updated my postProgramming for Windows Phone 7 (Post # 5132084) :
- Petzold finished his book
- link to the article on the pitfalls and optimization



Rep: (767)
HOMPAIN,
Try to force the program to set the "standard" regional settings.



Rep: (0)
The question is, and in the emulator in general, how to check the multitouch (or at least the touch), does it work or not?
And the accelerometer is certainly not implemented there, in the emulator?



Rep: (767)
Antonlipetsk48,
Well, it responds to mouse clicks.



Rep: (0)
To do MouseButtonEventArgs instead of TouchEventArgs?



Rep: (767)
: wallbash:
No, just in the emulator mouse clicks are regarded as clicks.



Rep: (482)
Antonlipetsk48 @ 10.29.2010, 22:42*
The question is, and in the emulator in general, how to check multitouch

If the emulator is running on a touch screen PC. I also heard rumors about connecting two mice with homemade drivers.



Rep: (0)
When will they translate into Russian a book? Or already have?



Rep: (44)
A couple of stupid questions)))
Where exactly to take soap?
Will applications on nfc 3.5 work there?
Is it possible to fill them in the store?

And what is the sequence of actions? Approximately imagine but still)
Where can I see the requirements for applications / games to be placed on a foreign market?
Mozh one thread will write fak: rolleyes:



Rep: (482)
Coracio @ 11/01/2010 22:00*
When will they translate into Russian a book? Or already have?

while I saw only a part of Petzold’s book in Russian



Rep: (482)
S_K @ 02.11.2010, 10:53*
And what is the sequence of actions?


Downloadinghereand set the development tool.

You can write programs and test them on an emulator. Do not put on the device without registration in AppHub.

Registration is also done there.

Enter the necessary information.

A fee is paid (there is an exception for students).
Waiting for a letter with instructions to confirm identity. A passport is scanned and sent by fax. Waiting for a call to a personal phone. By phone confirmed "Yes, I am me." Expected status changes on the panel in the AppHub.

While you wait - you can download and study all sorts of requirements (including for applications).

If you are planning paid applications - you need to fill in the W8BEN form and send it to MS in paper form.

Free applications within the fee can be laid out a limited number.
Toll - unlimited.

Before downloading the application, I highly recommend checking work on a live device - 1. devices work much slower than an emulator, 2. devices try to work somewhat differently than an emulator.

Testing the application after downloading takes from one to three business days.

Post has been editedS_K - 02.11.10, 13:18



Rep: (44)
S_K @ 02.11.2010, 11:04*
If you are planning paid applications - you need to fill in the W8BEN form and send it to MS in paper form.

These are the ones for which I will drip money as I understood)
Addresses where to send a letter there?
If the girl studies in a lobache and my soapbox is bumming me, and I’m going to pass through it with my data, will you not give me a ride?

And about a live device, he would still be with a seven)))))))))))))



Rep: (1)
S_k
You wrote in your blog about protecting code from outsiders. I know the leap, after compilation from the source code only the names of the functions remain, and the code itself is irreversibly transformed into binary. What are you going to protect?


Full version    

Help     rules

Now: 27.06.19, 17:34