yashsingh1/xdaforums huggingface dataset:
[Windows Phone 7 Software Development] StevieBallz:
I'm using the following Setup with the HttpWebRequest:

in my OnLoad event i have the following code:

but this could go into a Button or any other Handler.

Then I have the AsyncCallback method which handles the result:

Note that the WebRequest is performed asynchronously, which means that I have to sync it to the UI-Thread using the Dispatcher.

For my anonymous method to work I had to declare the Delegate UiCallback as follows:

The GetResponse() method of the Request is not displayed by intelisense nor is it part of the silverlight 4 documentation, so i wonder that that even compiles - maybe it's just hidden through some property, although obviously not implemented.

At least it seems MS prefers things done asynchronously - not the worst idea considering they want all applications to be responsive.

Hope that helps with your problem.

Edit: For information about storing files I suggest googling for Silverlight Isolated Storage. There is lot's of info and some interesting screencasts on that out there and you can use most of the regular Silverlight information for Windows Phone.
[Windows Phone 7 Software Development] LooperNor:
I couldn't get that to work either, suppose I didn't add some required reference or something (I did have System.net though), but I made it work anyways, by just loading an HTML file in the web browser.

I could even possibly just load the text file in the web browser control, but oh well.

Now I'm wondering if you know how I could save a text file to the phone, and read it into a string variable later.

I've tried a bit of googling, but there is so little on Windows Phone atm, so I figured it's easier to ask here.

I'm kinda new at C# you see :o

Anyways, I'd like to know how to generate a random number too, if anyone knows.

Thanks.
[Windows Phone 7 Software Development] StevieBallz:
You won't be able too, as there is no global storage space in Windows Phone 7 series. Each Programm has it's own isolated storage (Namespace System.IO.IsolatedStorage) and can't access data created by another programm e.g. IE.

(There are exceptions on accessing images from the picture hub, for example, but theses won't help in your case).

The Random class generates random floating point numbers between 0.0 and 1.0, you just have to multiply them to get them in a range u want to use.
[Windows Phone 7 Software Development] LooperNor:
But can't I save a text file that would only apply to my own program, so that it can open and read it itself, from the isolated storage?
[Windows Phone 7 Software Development] StevieBallz:
Yes, you can download it yourself and put it in isolated storage of that application. I just meant that downloading using the Internet Explorer would not really help you.

So u would have to get one of the above mentioned methods of getting the Data to a string and then store this to a file in isolated storage (u could omit the string and write directly from one stream (HttpResponseStream) to the other (FileStream to IsolatedStorage).
[Windows Phone 7 Software Development] LooperNor:
I'm not really talking about saving a downloaded file here, I'm talking about writing a string into a text file.

The string is an internal variable, that needs to be saved through sessions.

Maybe there is some other way of doing it that you know of?
[Windows Phone 7 Software Development] StevieBallz:
Sry, my mind was still with the downloading of a text file.

I suggest to take a closer look at the IsolatedStorageSettings class. It allows you to save a string for a given key, like in a HashTable.

That would be the best option if you want to store a simple string or a single object. Directly creating files in my opinion should only be done if u want to save more complex data.

stores the data and

loads it again.

I don't know for sure, but I believe the Emulator does a Hard Reset each time u start it, so u must not shut the emulator down when testing this functionality in between test runs.

Edit: don't know why, but there are 2 Whitespaces in my code that shouldn't be there and aren't in the editor view, but i guess they're easy to fix.
[Windows Phone 7 Software Development] LooperNor:
Thanks, but I still need to check if the setting already exists, and if it doesn't create it.

How would I do that then?

I would normally google it, but there is so little on Windows Phone 7 atm :/

Edit: Fixed the previous problem, but it can't seem to be able to save the setting.

It tells me the value does not fall within expected range.

Edit: Nevermind, figured it out.

Thanks for the help!
[Windows Phone 7 Software Development] Andy7:
coding with xml

hi guys am in trouble with programming on windows phone 7 emu. I think some methods are missing and i cant go in child nodes...

pls guys help...
[Windows Phone 7 Software Development] cohowap:
I suggest you read into Silverlight and XNA development.

Coding isn't in xml... it's called XAML which is a UI markup. Most your actualy functionality code will be in C#. Google some stuff to learn Silverlight (probably what your using since XNA doesn't have that).
[Windows Phone 7 Software Development] Andy7:
thx but...

@cohowap

thx for the reply but i think you dont fully undrestand what i want to say...

i think some methods are missing with xml nodes(System.Xml)...

like...

.SelectNodes

.MoveToFirstChild
[Windows Phone 7 Software Development] Musicman247:
Anyone plan on releasing source code as a way for free apps??

MS is limiting loading apps to just the new Marketplace, but in Visual Studio there is an option to load the program on a Windows Phone 7 Device.

I was wondering if anyone was going to release their Visual Studio source code as a way of getting around the Marketplace? (letting people load the project into Visual Studio, then "debugging" it on their devices)

I know that with WM6.5 VS would load all the code and source files needed onto the device itself, so you could run the app even after stopping the debugging session. I wonder if it will be the same way with WP7S?
[Windows Phone 7 Software Development] C:Sharp!:
Actually, as far as I know, developers must have their phones unlocked, before they can load apps via Visual Studio.

Thus, I'm not sure whether "normal" people will be able to do that, even if they get the source code.

I wouldn't release my sources, anyway ;)
[Windows Phone 7 Software Development] Musicman247:
Ah. I had not heard that dev phones would need to be unlocked. I wonder if those of us in the DreamSpark program would be eligible for those devices as well?
[Windows Phone 7 Software Development] Andy7:
http://weblogs.asp.net/scottgu/arch...-7-twitter-application-using-silverlight.aspx
[Windows Phone 7 Software Development] C:Sharp!:
I'd think so.
[Windows Phone 7 Software Development] matejdro:
I'm sure that there will be smart developer, which will create utility that will install already compiled apps, pretending that is visual studio.

And even if it wont, you can include compiled app to your visual studio project and make app that will launch it. Then visual studio will copy both apps to phone and launch your app, which will launch app you want to use.

Since i saw application menu in WMP7, i still have fate that there will be ways to make platform less locked.
[Windows Phone 7 Software Development] RustyGrom:
Windows Phone Application Platform Application Size and Quota

The default application size for applications is 2 GB. Quota management can be enforced to block applications from growing their data storage beyond their specified limit. However, Windows Phone 7 Series CTP applications will not be restricted to a particular quota. They should make careful use of space based on their application scenario requirements.

http://msdn.microsoft.com/en-us/library/ff402541(VS.92).aspx

In other words, there will be a limit. MS just hasn't decided on what it is yet.
[Windows Phone 7 Software Development] Ren13B:
You should use XDocument and Linq.

using System.Xml.Linq;

IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();

IsolatedStorageFileStream isoStream;

isoStream = new IsolatedStorageFileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read, isoStore);

XDocument xml = XDocument.Load(isoStream);

Run your linq query here

isoStream.Close();
[Windows Phone 7 Software Development] Noonski:
I've seen more reports of some lags when switching away from start page on hi end systems.

Your not alone.
[Windows Phone 7 Software Development] Andy7:
@Ren13B

thanks again for the reply but the shame is mine that i dont make you understand want is my prob...anw

the problem is not how to load an xml but how to navigate into it and especialy how to get into its child nodes...

thanks in advance...
[Windows Phone 7 Software Development] Ren13B:
Its best to use linq queries for that. In this example im stepping through the "content" element to get the "name" attributes value and sorts it.

The output would simply be:

Section

Section2

Heres my sample xml file:

<?xml version="1.0" encoding="utf-8"?>
<content>
<section name="Section">
<setting name="setting1" value="setting value"/>
<setting name="setting2" value="setting value"/>
</section>
<section name="Section2">
<setting name="setting3" value="setting value"/>
<setting name="setting4" value="setting value"/>
</section>
</content>

Code:

isoStream = new IsolatedStorageFileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read, isoStore);

XDocument xml = XDocument.Load(isoStream);

var query = from c in xml.Elements("content").Elements("section")
orderby c.Attribute("name").Value
select c.Attribute("name").Value;

foreach (string section in query)
{
//string "section" holds the attribute value
Debug.WriteLine(section);
}

isoStream.Close();

This query goes through the "setting" elements and gets the value for the attribute "name" and sorts it:

var query = from q in xml.Descendants("setting")
orderby q.Attribute("name").Value
select q.Attribute("name").Value;

Output would be:

setting1

setting2

setting3

setting4
[Windows Phone 7 Software Development] Andy7:
...

thanks Ren13B now you really help me ... now one more question ...

how about if xml is like that:

<?xml version="1.0" encoding="utf-8"?>
<content>
<Section>
<setting1>setting value</setting1>
<setting2>setting value</setting2>
</section>
<Section2>
<setting3>setting value</setting3>
<setting4>setting value</setting4>
</section2>
</content>
[Windows Phone 7 Software Development] Ren13B:
Depends what values you want but this page should help you with that query.

http://www.linqhelp.com/linq-tutorials/linq-to-xml-displaying-and-filtering-data-from-xml-file-in-c/
[Windows Phone 7 Software Development] GLiNTCH:
If you did you homework right when you built your WM6.x app and have a Business Tier / MIddle Tier/ Service Tier - what ever you call it, you can bring over that source or even a DLL into the WP7 SL project and reuse the code.

As long as it does not touch anything that WP7 does not have like pInvoke and POOM and so on.

As far as UI goes, it's a throw away.

So if you are building Wm6.x apps now - consider architecture and build-out your classes properly, don't throw all the logic to the UI tier.
[Windows Phone 7 Software Development] vangrieg:
I wish we had more threads like this instead of endless "WP/M$ sucks", "I'll switch to Android", "it's an iPhone clone" and such rants.

Anyway, I'm not an expert, but I did take a look at what's available, and what I've seen isn't really exciting, to say the least. GLiNTCH mentioned PInvoke and POOM, but there's quite a lot of stuff that seems to go to the "so on" category. I haven't seen any traces of SNAPI, so not only you cannot run a background service, but you can't even launch your app on system events. Obviously file access is missing, there's no FileOpenDialog or FileSaveDialog for you. No access to registry - you can use isolated storage to store and read key/value pairs, so that's not a big loss for your app settings, but you cannot read data left by other applications. So you cannot check if device is locked or not, whether a call is in progress or not, etc. etc. No power manager obviously, no device access, you cannot adjust brightness and even volume. The whole window messaging system is missing. Internet access is limited to http only. Surely you have no way to check running processes etc. So overall we get a very limited version of .Net CF, with added [great] UI framework.

I only took a quick glance at what's available, so I'll be happy to be proven wrong about my findings, but the way I see it, you really need native code to do most things that are posted on xda, even more so than was the case with WM.
[Windows Phone 7 Software Development] pupakota:
Like i said, they just want to make new market(place) by destroying possibility of using >65k of good, MOSTLY FREEWARE apps from wm03/6.0.

It's all about cash.

Simple consumers will buy this bs.

Period.
[Windows Phone 7 Software Development] Musicman247:
Deleted by Musicman247 for being off topic.
[Windows Phone 7 Software Development] pupakota:
[deleted by user - reason: OT]
[Windows Phone 7 Software Development] jvitor83:
Ok. Now we know that Microsoft will not support some namespaces from .net 3.5...

By that, the only way to make an older APP work will be create some kind of class library that has the same name/funcionality from the CF 3.5...

What i mean is:

If a program was writen only in cf .net 3.5 and use for example a class:

System.Windows.Forms.MessageBox.Show("Foo", "Foo", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);

Since we get and try to compile this on cf .net 3.7 it will not work if this class not exists.

A solution for this is to make an DLL that has a class with this same name and methods working in WP7 using the new API (even silverlight). So... this class will create a window using silverlight and work the same...

Ok ok... not flames, just an idea...

I know that lots and lots of software already made has some stuffs that this kind of solution will not work, but its a try...

For example, i already make use of a form created for Windows Forms and put in Windows mobile. It was a disaster, since i used a lot of BackgroundWorker and other stuff that in CF not exists. My solution? I used a library from http://www.opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx that has BackgroundWorker and other. Work like a charm...

Well... its only a discussion... what u guys think?

Sorry by the bad english anyway.
[Windows Phone 7 Software Development] ramdroid77:
pupakota please shut up if you don't have to contribute anything to the topic!

I don't think this will work. The MessageBox class in Forms is just a wrapper around the MessageBox function in coredll. I doubt this function is still available in the new coredll since I doubt there'll be any message boxes in WP7.

And you can also create a native DLL but you don't have an interface to access it from your Silverlight app. Proove me wrong but I don't think it's possible so easily!
[Windows Phone 7 Software Development] vangrieg:
We'll need to hack the damned thing to get the answer. The new coredll is part of the underlying WinCE, so it may have everything there. I seriously doubt that you'll be able to do it from .Net environment though, with security management, missing dlls and all such nonsense. But native code may work if you get needed permissions.
[Windows Phone 7 Software Development] ramdroid77:
Yes in native code it's of course possible but then I think you can't have any UI. You can only use native to write services and such. Maybe it's possible to write a service that contains a TCP server. On your desktop PC you implement the client. Then you have to implement functions to access file system and manipulate registry or maybe even install cabs. That's an idea coming to mind what you can do with native API. But I don't think you can have any "real" WP7 app with native API access....
[Windows Phone 7 Software Development] vangrieg:
At first I thought that you could do a native dll and export functions from there, but I'm not even sure Silverlight apps can import anything from external dlls. Can they?
[Windows Phone 7 Software Development] ramdroid77:
I don't think so. In order to import functions from a dll you need to call PInvoke - which is unfortunately not available.

Few days ago I created a .NETCF 3.5 assembly that imports a function from coredll. Then tried referencing it from a WP7 Silverlight project but it claims the assembly is not compatible or something along that line.

I don't know of any further approach! I'm not a .NET expert (only developed on one project for around ~2 years some time ago) but as long as Microsoft doesn't allow it, it's just not possible I guess.....
[Windows Phone 7 Software Development] vangrieg:
Sheesh. I won't miss messageboxes for a second (I loathe intrusive modal dialogs almost everywhere), but I'm really puzzled as to whether useful things can be done in SL at all.
[Windows Phone 7 Software Development] ramdroid77:
That's why I think that WP7 is completely useless without official native API support from Microsoft. Cooking our own ROMs doesn't help ****. Now isn't it frustrating?

Like I said few times already: only thing you basically can do is develop fart apps! I guess it's closer to the truth than some might think of. And due to idiot-proof easy interface thousands of people will commit such apps to marketplace. have fun picking out ONE good app!
[Windows Phone 7 Software Development] vangrieg:
True. I'm still waiting for jailbreak to make the final judgment, PInvoke may still be there, just unaccessible without proper permissions. But yeah, this is all incredibly frustrating. It's like coming back to your home city and seeing it ruined by an earthquake or something...
[Windows Phone 7 Software Development] ramdroid77:
here's what a quick google result about Silverlight (for desktop OS):

So I don't really know in what way OEMs get access to win32 api....
[Windows Phone 7 Software Development] vangrieg:
Who said they get it from Silverlight? This whole thing starts looking like a big scam to me...
[Windows Phone 7 Software Development] smnbss:
@Andy7 the missing methods are due to the Framework used.

The mobile use the .NET Compact Framework that is a cut down version of the full framework you use on the desktop.
[Windows Phone 7 Software Development] bassmaster:
is there any workaround for pivot control?
[Windows Phone 7 Software Development] drowdd:
$8000 contest

I need a local developer or one that I can communicate with on a regular basis to see this application through. i have a couple of ideas that would be great as an original W7 app. Please feel free to contact me so that we could discuss a possible partnership. Details:

To win the Windows Phone 7 Series “Rockstar” Award, your team is challenged to create a Windows Phone 7 Series application (app) in either Silverlight or XNA. This app needs to be designed with the consumer in mind and should be as visually compelling as possible. Be prepared to demonstrate your team’s app entry running on an actual Windows Phone 7 Series device or in an emulator. Mobile applications are “all the” buzz today. Windows Phone 7 Series is a revolutionary new platform and you have the opportunity to be a part of it. This is your chance to think of something that is truly outside the box and be one of the first developers, ever, to be building apps for Windows Phone 7 Series. Create an app that people will love having on their Windows Phone.

Prizes:

Award Finalists receive:

* First Prize: $8,000 USD, a trip to the Worldwide Finals in Warsaw, Poland from July 3-8, 2010, and a Windows Phone for each team member.

* Second Prize: $4,000 USD and a Windows Phone for each team member

* Third Prize: $3,000 USD and a Windows Phone for each team member
[Windows Phone 7 Software Development] julian2596:
im a developer just finish my other theme/app what you want me to do again
[Windows Phone 7 Software Development] drowdd:
I just sent you a message.
[Windows Phone 7 Software Development] julian2596:
ok but still working on another project trying to get windowsmobile7 series platform on a windowmobile standard device its will be app like jaxbot and others
[Windows Phone 7 Software Development] ElCondor:
Any developer that needs a graphics designer, just PM me.
[Windows Phone 7 Software Development] MikeKnoop:
Where are these contest details from?

-Mike
[Windows Phone 7 Software Development] drowdd:
1800 pocket pc
[Windows Phone 7 Software Development] wouter11:
Would like to desing something, so developers pm me ill design something for you!:)
[Windows Phone 7 Software Development] DMAND:
I think you failed to mention that this is a competition for STUDENTS and your team members have to be Students also

http://imaginecup.com/Competition/mycompetitionportal.aspx?competitionId=47
[Windows Phone 7 Software Development] Ambious:
I'm trying to code in Hebrew and what I'm seeing is that the native phone font support Hebrew, but there is absolutely no Right-to-Left support whatsoever. I'm assuming the same goes for Arabic.

I'm currently working on a DLL for automatically 'reversing' Hebrew text, if there'll be interest, I'd be willing to add Arabic support as well.
[Windows Phone 7 Software Development] Ambious:
Deploying packages manually?

Say I created an application and I want to send it to a friend.

I'm assuming the .xap file is the package I need to send him, but even then - how does he 'deploy' it to the emulator? Is there a command line switch he can use, or anything?
[Windows Phone 7 Software Development] Kloc:
He'll probably have to load the source in visual studio and then run the emulator from there. Just a guess though.
[Windows Phone 7 Software Development] TheCyberKnight:
Ambious,

This scenario is not supported with the current tools.

And it doesn't look like it will be supported anytime soon considering the approach Microsoft talked about during MIX10. The only announced way to install software mentionned the use of the Zune software.

As an alternative (although not very practical), you can send your sources and have your friend compile and deploy locally. I know, not very funny.
[Windows Phone 7 Software Development] Spike15:
Do you understand how an emulator works?
[Windows Phone 7 Software Development] solomhamada:
it appears that the original font does not include UTF8 :P

any way, if you can , change the default font .. i think this will help
[Windows Phone 7 Software Development] hazeline:
Developing App for Windows Phone 7

Hi, i have just touched the basic of java, with a little of C#. May i know what should i know before i can start developing app for Windows Phone 7. Thanks :)
[Windows Phone 7 Software Development] Gurny:
This Blows

This new marketplace-deployment-only method is absolutely enraging. Android is looking more and more like the platform I need to jump on.

I have a Windows Mobile app used by different companies that requires other cab files to be installed (like sql server compact, and others). What am I supposed to do now? Tell all my clients "oh, I know everything was working perfectly before, but now, you need to go to M$ marketplace and dig around for this, this and this if you decide to upgrade your Windows Phone."

Thanks M$!
[Windows Phone 7 Software Development] flashpanda:
I believe there was a sideload scenario mentioned at one point, but it was for enterprise deployment of applications only. It does however, exist.
[Windows Phone 7 Software Development] DMAND:
Check out all the links in this blog http://bhandler.spaces.live.com/Blog/cns!70F64BC910C9F7F3!8195.entry for all you need to get started
[Windows Phone 7 Software Development] nikescar:
No offense to the above member but THIS is a much better place to start. Download the training kit (upper right side green button) and then tackle the tutorials. This kit has all files and tutorials in one nice package that can all be accessed locally (not online).

I'm about 50% done porting my game.
[Windows Phone 7 Software Development] DMAND:
The link to the downloadable version of the training kit is in the second link on the blog page I posted ;)