SQL CE4 public beta will be released - Windows Phone 7 Development and Hacking

http://weblogs.asp.net/scottgu/archive/2010/06/30/new-embedded-database-support-with-asp-net.aspx
Replied by Scott, M$ is looking to enable it on silverlight.
I think this is also work in wp7 in future

Yes, I'm pretty sure it's among the things they wanted to do with it. Not only does it make a dead-simple database support for ASP.NET apps, but it also will be good for Silverlight as platform.
That way we can get a nice DB with a LINQ provider, that will be able to be scaled up on the *real* SQL Server when needed. A counter-reaction to sqlite being made available for Silverlight though Mono.
It also fits the whole concept with IIS7 Express very good

"That is something we are looking to enable as well in the future. Not there just yet though "
Sounds like "not anytime soon" to me.

The problem is writing a database is fully managed code is, well, difficult. Specially if you want it to be performant.
Also I think they might rather want us to use cloud service (read: Windows Azure) instead of a RDBMS, for our Silverlight and WP7 applications, if datastorage is needed. I believe you can expose a Azure Storage easily to WP7 using WCF.

The thing is that when we can't deploy any native stuff, microsoft can. They just need to provide a wrapper so it can be used from .NET

Related

WP7 -IS- Backwards compatible (well almost)

Applications that were made for Windows Mobile 6 are compatible with Windows Phone 7 Series. The interface of the new mobile operating system has been changed though, so the user interface for these applications will have to be changed as well.
"So there is no reason why programs written for Windows Mobile 6 cannot run on the new version of the OS", said Maarten Sonneveld of Microsoft Netherlands to Tweakers.net. "The interface is complete different though, so the applications will have to be changed somewhat before being ready for Windows Phone 7 Series".
It is still unclear how developers can port their user interfaces to the new version of Windows Mobile. Microsoft will only disclose how applications can be developed and distributed at their developer event Mix2010.
Microsoft announced it’s new OS on Monday afternoon at the Mobile World Congress in Barcelona. The OS is primarily aimed at synchronisation and integration with Microsft-services like Windows Live, Bing, Zune and Xbox Live. Aside from those Windows Phone 7 Series can also synchronise with Google-accounts and facebook.
Click to expand...
Click to collapse
Source
So in summary, while none of the current applications will run on it, the underlying non-UI APIs will be compatible. So if understand correctly, porting would just a case of redeveloping the UI then recompiling, rather than starting completely from scratch. This acts to filter out apps with no more developer support, and promote a consistent UI.
Doesn't sound too bad to me.
That might explain why TomTom was seen on that screenshot of WP7 running on the HD2 (although, it could be a fake!). TomTom takes control of the screen, so uses no WM interface elements. So, it might be able to run full-screen apps/games without changes.
But, who knows...
elyl said:
That might explain why TomTom was seen on that screenshot of WP7 running on the HD2 (although, it could be a fake!). TomTom takes control of the screen, so uses no WM interface elements. So, it might be able to run full-screen apps/games without changes.
But, who knows...
Click to expand...
Click to collapse
I was just thinking the same except if you use the included .net controls, there's no reason that the OS couldn't just reskin them automatically to be at least somewhat more in line with the WP7 styling.
This would be excellent if it's true - and I can't see why it wouldn't be. The UI may be new but why throw away a perfectly good underlying core.
What would also be ideal is if the "multi-tasking" involved an app being set to pause in the background by default, but with a "keep me running" API call available for apps that needed it. I'm sure most apps hog resourses not because they need to but because the developer hasn't really thought about how the rest of the device performs when his app has been left running.
Makes sense, WindowsCE core is still the same
Zaim2 said:
Applications that were made for Windows Mobile 6 are compatible with Windows Phone 7 Series
Click to expand...
Click to collapse
Absolutely wrong statement due to incorrect translation. Original: "De interface van Windows Phone 7 Series is totaal anders, waardoor er in elk geval iets aan de applicaties moet gebeuren voordat ze geschikt zijn voor Windows Phone 7 Series"
Even google translates it correctly:
"The interface of Windows 7 Phone Series is different, which in any case something should happen to the applications before they are suitable for Windows 7 Phone Series".
We have some "ms confidential" documentation dated January 2010 that proves that none of the existing apps would be compatible with WinPhone7. And the only programming suite that is available to "generic" application-writers is Silverlight+XNA. Native apps are prohibited. Only OEMs and MO are allowed to create them (and even they have a set of limitations).
We would not have even source code compatibility - as all our C++ apps have to be converted to .NET.
mamaich said:
We have some "ms confidential" documentation dated January 2010...
Click to expand...
Click to collapse
What the heck? And you say that only now? What else is in there? Any word about how background tasks are handled? Please give us some more information, or maybe, can you upload that documentation?
freyberry said:
maybe, can you upload that documentation?
Click to expand...
Click to collapse
Obviously I cannot. As it would reveal the person who provided it.
Just to prove that such info really exists - see attached screenshots.
I really hope that the community would force MS to change such a dumb idea to limit independent software vendors to create only managed apps. Prohibiting C++ as a developing language, and "hiding" Windows API from programmer would force lots of developers to abandon this platform. The main reason of success of old WinMobile OSes was the ability to recompile "desktop" apps to WinMobile with just a minor set of changes (ANSI->Unicode + some interface changes).
P.S. I don't read PMs.
Obviously I cannot. As it would reveal the person who provided it.
Just to prove that such info really exists - see attached screenshots.
Click to expand...
Click to collapse
Well, there's certainly a way to remove that information. But anyway, what about background tasks? Are third party applications allowed to run in the background?
mamaich said:
Obviously I cannot. As it would reveal the person who provided it.
Just to prove that such info really exists - see attached screenshots.
I really hope that the community would force MS to change such a dumb idea to limit independent software vendors to create only managed apps. Prohibiting C++ as a developing language, and "hiding" Windows API from programmer would force lots of developers to abandon this platform. The main reason of success of old WinMobile OSes was the ability to recompile "desktop" apps to WinMobile with just a minor set of changes (ANSI->Unicode + some interface changes).
P.S. I don't read PMs.
Click to expand...
Click to collapse
Wow, I can't believe noone has picked up on this
freyberry said:
Are third party applications allowed to run in the background?
Click to expand...
Click to collapse
OS itself supports multitasking, see attach. But "Windows Phone OS 7.0 Application Platform" that we'll be forced to use to create apps may force our application to be paused in background. I never programmed Silverlight and XNA and can't tell how multitatsking is made in them.
WinPhone 7 == Zune Phone. Both are based on CE kernel, and they should have lots of common in implementation of multitasking, clipboard, etc.
OS itself supports multitasking, see attach. But "Windows Phone OS 7.0 Application Platform" that we'll be forced to use to create apps may force our application to be paused in background.
Click to expand...
Click to collapse
The question is, can we write applications that are not automatically suspended when sent to the background? What are the policies on this?
It says multiple processes can run at the same time, but it does not say whether they get suspended automatically.
Is there any info on this? Maybe in the "Scheduling" section?
I’m not sure this is a big deal. I can see them saying a lot of native C++ apps may have compatibility issues. I could go either way on it with the limited amount of information I have on this. I’ll have a better opinion at and after MIX
Note that this could be old documentation, and it’s pretty annoying you're leaking confidential documentation. Personally, I hope you get into trouble for breaking your contract - they trust you and you're posting it? Yuck.
To be fair, though, every app we’ve written has been managed, and Microsoft hasn't t said P/Invoking is verboten, so what would be the problem?
There’s probably exceptions for games and the like, and the documents you've scanned even say a waiver is available to use the Native APIs. So I don’t know what you're complaining about…
Microsoft's dev teams have been listening to developers - why not get them to chime in and also give them a chance to hear you. Posting confidential Microsoft documents, assuming those are real, is not the way to get them to listen
Best,
-Auri
freyberry said:
The question is, can we write applications that are not automatically suspended when sent to the background? What are the policies on this?
It says multiple processes can run at the same time, but it does not say whether they get suspended automatically.
Is there any info on this? Maybe in the "Scheduling" section?
Click to expand...
Click to collapse
Personally, I like Android's approach to this, where Services can run in the background, but UI apps are allowed to be "put to sleep" while other apps run. But then again, we may see a lot of that come into play come MIX and "Answer Time"
Best,
-Auri
Well, I am now both excited and nervous -I think I will just cool my jets until MIX10 and just enjoy the eye candy for now. At worst - if the interface is nice, but the core is crap I am sure some of the boys here at xda will make us an inteface port for 6.5.x that acts and looks like the new hotness with the old compatibility. - lets see MIX
AuriRahimzadeh said:
Note that this could be old documentation, and it’s pretty annoying you're leaking confidential documentation.
Click to expand...
Click to collapse
Docs are dated 2010.
I'm not leaking the documentation. I'm sharing the information that anyway would be opened in some days, maybe weeks.
And screens are posted here just as a confirmation of my words. You may think that these pics come from my mind and are made with photoshop - it is your opinion.
I really think that WinPhone 7 would be a failure similar to desktop Vista. Of cause some people would like it, but most would stay on WM 6.x and wait for the next version.
Regarding P/Invoke. As far as I've seen, "unsafe" operations are prohibited in XNA and Silverlight. Otherwise we would be able to call coredll funcs and run native apps (and do everything else that is allowed in our chamber).
mamaich said:
Docs are dated 2010.
I'm not leaking the documentation. I'm sharing the information that anyway would be opened in some days, maybe weeks.
And screens are posted here just as a confirmation of my words. You may think that these pics come from my mind and are made with photoshop - it is your opinion.
I really think that WinPhone 7 would be a failure similar to desktop Vista. Of cause some people would like it, but most would stay on WM 6.x and wait for the next version.
Regarding P/Invoke. As far as I've seen, "unsafe" operations are prohibited in XNA and Silverlight. Otherwise we would be able to call coredll funcs and run native apps (and do everything else that is allowed in our chamber).
Click to expand...
Click to collapse
Mamaich any though of a WP7 ce6.0 bsp for all the current cortex A8 devices running on a ce5.2 bsp, will the new kernel support them natively or will extensive bsp/bootloader hacking be required?
P/invoke surely is a limitation of .NET CF, rather than Silverlight/XNA libraries?
I think it would be a bit stupid to remove P/Invoking, because it's just not realistic to rely on .NETCF alone which has soooo much stuff stripped out to minimize size.
Will we be seeing a whole new .NETCF so soon after 3.5? I highly doubt it...Unless MS have been working overtime the past year
Shame, time to stop mobile development altogether if this is true. When we developers are considered as dumb earning pipes for companies who in their arrogant big ways think they have all the wisdom, and app developers only make annoying software that makes their precious leaky OS'es crash, it's time to move on. i would have been talking about IPhone, Android etc, but sadly we must add Microsoft to the list also.
Then there's the $1195,- and airplane tickets we have to pay to get to the Mix2010 in oder to maybe maybe get to be a "partner" with access to limited native API's (probably only reserved for the big companies) and don't even bother talking about giving away 30% of our earnings to a company that last year made how many billions of profits was it ?
Time to start an XDA OS based on REAL Linux maybe ? NVidia have a nice dev-board available for $400,- with Tegra on it. That's what I call developer friendly.
Cheers !
Regardless of how this will play out, I'm pretty sure of two things:
1. Closing down the OS may be beneficial for the majority of users by bringing stability, ease of use, UI consistency, etc. Even though I don't like it.
2. Because the OS itself is multitasking, any and all restrictions may be hacked around, and a "jailbreak" will be possible.
Depending on how this whole thing will be implemented, jailbreaking and using "illegal" apps may be a major PITA (think iPhone 3GS/tethered jailbreak) or as easy as a few registry tweaks/installing additional certs/whatever. If Apple didn't chase JB with every update it would be a rather good platform for both mainstream "ordinary" users and those who want rather unusual things from their phones.
We'll have to wait and see how it evolves really to make a final judgment.

no extra browsers?

looks like i was wrong & MS is being a A$$
there arent letting browser devs use native code at the moment...this is wack, IE better be the bomb or else this is gonna suck
From Mozilla
"While we think Windows Phone 7 looks interesting and has the potential to do well in the market, Microsoft has unfortunately decided to close off development to native applications. Because of this, we won’t be able to provide Firefox for Windows Phone 7 at this time. Given that Microsoft is staking their future in mobile on Windows Mobile 7 (not 6.5) and because we don’t know if or when Microsoft will release a native development kit, we are putting our Windows Mobile development on hold"
http://wmpoweruser.com/?p=14599
No native code = no alternative browers. At least not anytime soon.
That was clear all along.
You're not going to see any "big" applications on WP7S. Fart apps and twitter clients are easy to do, however...
A twitter client is already on board isn't it?
Probably they'll also add a fart app to the final retail version. so the only thing you could do is add customized fart sounds!
I really wish it was different but to be honest I don't see any potential for interesting apps on WP7.
seems counter-productive to not release their native client to bigger development studios as yet. They certainly want a library of applications for launch, it's a bit strange they the silverlight/xna libraries 1st, when those would typically be shorter to right than something like a Firefox, Opera, etc.
gom99 said:
seems counter-productive to not release their native client to bigger development studios as yet. They certainly want a library of applications for launch, it's a bit strange they the silverlight/xna libraries 1st, when those would typically be shorter to right than something like a Firefox, Opera, etc.
Click to expand...
Click to collapse
yeah but firefox did take awhile to produce nothing on Wm6 with access to native code so maybe MS doesnt trust them with native code cuz those fennec browser cause the phone to crash sometimes..im holding out hope that they give opera permission
gom99 said:
seems counter-productive to not release their native client to bigger development studios as yet. They certainly want a library of applications for launch, it's a bit strange they the silverlight/xna libraries 1st, when those would typically be shorter to right than something like a Firefox, Opera, etc.
Click to expand...
Click to collapse
.NET apps are much quicker to develop than native stuff. That's why they focus on .NET. They will eventually have quite a big app library by the end of the year, but most of it will be "fart apps".
Will there ever be an NDK? Who knows...
C:Sharp! said:
No native code = no alternative browers. At least not anytime soon.
That was clear all along.
You're not going to see any "big" applications on WP7S. Fart apps and twitter clients are easy to do, however...
Click to expand...
Click to collapse
LOL..I hate those fart apps...or fart jokes for that matter.
The latest IE that I have on the Prime-II ROM is very good at rendering and formatting the columns for readibility, esp when used in mobile mode. Panning large pages is also very smooth and does not show any blank/white "still loading" when moving rapidly left or right or top or down. I actually stopped using opera because it suck memory and still shows white spaces when panning pages.
I'm using the word "fart apps" as an explanation for a certain kind of apps. I don't mean that they're all useless, but they're the kind of apps that are easy to develop in .NET and will likely form the majority of apps that we'll see in the WP7S marketplace by the end of the year.
(To be honest, I'm also going to make some . Useful ones, however.)
C:Sharp! said:
.NET apps are much quicker to develop than native stuff.
Click to expand...
Click to collapse
But .NET in Windows -- at least from my understanding -- has access to native/lower-level APIs.
See: PowerShell, which is unashamedly built directly on top of .NET, and yet is a viable replacement to the command prompt due to the fact it can do pretty much anything.
Spike15 said:
But .NET in Windows -- at least from my understanding -- has access to native/lower-level APIs.
Click to expand...
Click to collapse
Yes, that's correct. You can do that via P/Invoke.
You could also do that on Windows Mobile.
But not on Windows Phone 7, this feature is officially gone.
C:Sharp! said:
But not on Windows Phone 7, this feature is officially gone.
Click to expand...
Click to collapse
I had guessed.
I was just pointing out that .NET on Windows Mobile and Windows is more powerful than it's going to be on Windows Phone.
C:Sharp! said:
I'm using the word "fart apps" as an explanation for a certain kind of apps. I don't mean that they're all useless, but they're the kind of apps that are easy to develop in .NET and will likely form the majority of apps that we'll see in the WP7S marketplace by the end of the year.
(To be honest, I'm also going to make some . Useful ones, however.)
Click to expand...
Click to collapse
make some musical ones, to live up to your name!
Hehe
But actually, the name is inspired by the programming language.
No more. Now you will be a music apps developer for WP7!
Maybe. But they have to be programmed in C# nevertheless
C# is the language that's used for .NET, thus all development for WP7 will be done in C#, in case you didn't know.
C:Sharp! said:
Maybe. But they have to be programmed in C# nevertheless
C# is the language that's used for .NET, thus all development for WP7 will be done in C#, in case you didn't know.
Click to expand...
Click to collapse
Nope. I did not know. Thanks for the info. Now I know just a bit more about the WP7 platform
havox22 said:
looks like i was wrong & MS is being a A$$
there arent letting browser devs use native code at the moment...this is wack, IE better be the bomb or else this is gonna suck
From Mozilla
"While we think Windows Phone 7 looks interesting and has the potential to do well in the market, Microsoft has unfortunately decided to close off development to native applications. Because of this, we won’t be able to provide Firefox for Windows Phone 7 at this time. Given that Microsoft is staking their future in mobile on Windows Mobile 7 (not 6.5) and because we don’t know if or when Microsoft will release a native development kit, we are putting our Windows Mobile development on hold"
http://wmpoweruser.com/?p=14599
Click to expand...
Click to collapse
I am sure .net framework in wp7s can access all hardware,so why Mozilla need native api access? just performance issues...but Mozilla do a sucked Firefox on WM6.X
Finally, I think .net framework good enough to develop great browser and developer can get benefit by GUI Acceleration
Managed is slow? May be but not critical
http://www.grimes.demon.co.uk/dotnet/man_unman.htm
It's not just about performance. A browser is a huge complex app with millions of lines of code. You can't just sit down and rewrite it in a different language when your engine is done in C++ for all platforms. That's a massive endeavor that will cost millions of dollars. In addition to that, there's no access to APIs necessary to do it. You can't open a socket and work with it directly in WP7's Silverlight.
vangrieg said:
It's not just about performance. A browser is a huge complex app with millions of lines of code. You can't just sit down and rewrite it in a different language when your engine is done in C++ for all platforms. That's a massive endeavor that will cost millions of dollars. In addition to that, there's no access to APIs necessary to do it. You can't open a socket and work with it directly in WP7's Silverlight.
Click to expand...
Click to collapse
So,this is not .net or Wp7 problem
All about the money
Everything in business is about money, so what? Restricting development to Silverlight makes developing alternative browsers for WP7 impossible because of a huge investment barrier.

Desperately Needed

WP7 desperately need a 3g to wifi tethering app like myfi. I used to have an iphone but switched WP7 and now I need a 'myfi' like app badly.
Can someone some building this app ASAP.
at present it's not possible to even build one as there aren't any APIs for it. I'm sure this has been asked quite a few times on this forum already... please search... rather than just continually asking what people deem as a common requirement. also search the pinned threads as they're a good place to start for missing functionality...
There are APIs. Samsung phones can tether so yh APIs are there. WP7 is just CE with some changes/additions. Microsoft just isn't allowing access to the APIs...
Sent from my HD7 using Board Express
I would think that OEMs have a different set of APIs which provide them with native capabilities. I doubt the OEMs are writting their apps in just C# otherwise MS would have released those APIs as well.
also to note, those phones that can tether is done through the diagnostics, which would imply that they should be already in all windows phones and just dormant. i highly doubt it's specific to samsung phones. it may be that we only know how to do it with samsung phones now.
The Gate Keeper said:
I would think that OEMs have a different set of APIs which provide them with native capabilities. I doubt the OEMs are writting their apps in just C# otherwise MS would have released those APIs as well.
Click to expand...
Click to collapse
That's my point. The APIs exist, as does the base Windows CE system.
We just don't have the development tools nor do we have access to that level of the system to be able to write those applications ourselves.
We're limited to sandboxed Silverlight-based applications, but Microsoft and OEMs can use Native Code and APIs we don't have access to.
They exist, we just don't have access to them. Apple does the same thing with iOS.
Thanks for agreeing with me, though
also to note, those phones that can tether is done through the diagnostics, which would imply that they should be already in all windows phones and just dormant. i highly doubt it's specific to samsung phones. it may be that we only know how to do it with samsung phones now.
Click to expand...
Click to collapse
Which also means WP7 supports tethering. The functionality just isn't exposed to users in the general user interface, that is why you have to dig for it. The same thing is true for Sideloading XAPs, among other things.
It's there. The OS is totally capable of it. WP7 did, in fact, inherit a ton of functionality from Windows Mobile. The difference is that the new UI doesn't expose it to the user, and applications (and the system) are managed in a totally different way.
There's a huge difference between "does not exist" and "exists, but functionality is not exposed in the UI."
Windows on a PC can access drives, etc. by device name, but that is not exposed in the UI - for example. The same is true for many features in WP7 that are there by virtue of it being based on CE and tied (although Microsoft would want you to think differently) to Windows Mobile. They just chose not to expose this functionality.
Not saying it's totalyl based on WM, since that's obviously untrue. If that was the case stuff like full Exchange support, Video support for MMS, etc. would be working.
But the fact that this stuff is there and they're dragging their feet to allow users to use it is what's keeping lots of users off of WP7 at the moment. It's taking them too long to make changes that seem too simple... Maybe for the sake of security, I don't know. They haven't really been transparent with early adopters, IMO.
EDIT: Also, you can call Native Code from managed languages (C#, VB.NET, Java, etc.), so I'm pretty sure they are writing their apps in C# and only calling native code/libraries when they need to. Writing it in straight C/C++ is [potentially] more dangerous than using a Managed Language with Interop. I can't see Microsoft going for that.

Nodo with SQL

Hello there,
I am developing a game for wp7, and I want to have a user login with skills an level. This users and levels I want toread and write from an SQL database.
But until now I found no API to connect. Is there any free solution to implement a database in wp7 (not linq)?
Thank you
Sent from my HD7 T9292 using Board Express
Nope, not in Nodo. You have to use linq-To-XML. This should be perfectly fine for small amounts of data.
If you can wait for Mango you can use a SQL CE database, but you still need to use Linq-to-SQL:
http://msdn.microsoft.com/en-us/library/hh202860(v=VS.92).aspx
Sent from my 7 Pro T7576 using Board Express
I know linq as a local database.
If I understand right linq-to-SQL is a one time sync? So I have to sync linq and SQL in the beginning and end of game.
So I would create for each user a linq db and then all linq dbs would be synced in SQL?
Sounds difficult, but I will give it a try this we
Sent from my HD2 with NoDo using Board Express
win98 said:
I know linq as a local database.
If I understand right linq-to-SQL is a one time sync? So I have to sync linq and SQL in the beginning and end of game.
So I would create for each user a linq db and then all linq dbs would be synced in SQL?
Sounds difficult, but I will give it a try this we
Sent from my HD2 with NoDo using Board Express
Click to expand...
Click to collapse
Sorry, do you want to connect to a remote SQL database on a webserver, or a just store a database on the phone itself? If on the phone itself, you can create on database for each user (Mango only).
If you want to sync with a remote server, you will need to interact with the server using some sort of Web Services. Then the Web Services do the reading/writing to/from the SQL sevrer and send the information back to the phone (you can currently do this in Nodo).
It should not be local, if its possible.
I want to subscribe on a free SQL host like I've of these: http://www.free-webhosts.com/free-mysql-database.php
Then I want to do the user management there and want do update the level and skills of the user who is logged in. A bit like a windows live account with the gamer points.
I would be glad if I can use SQL commands with c#.
I hope it become more easier to understand . Thank you for helping.
Do you got any sample code or tutorial how to use SQL in wp7? I failed :-D
Sent from my HD2 with NoDo using Board Express
With NoDo, you can't directly access an SQL server.
And even with Mango, I'd be careful doing such a thing, it can really be dangerous on many levels.
The best solution would be to use a web service, which could be accessed from your phone (via the WebClient class) and would handle the dirty work of connecting to the database and executing SQL queries (eg. inserting or retrieving data and outputting in XML format). This way even if you alter the structure of your database you don't have to change a single line of code in the app (that means you'll avoid resubmission), but only the web service code.
As a general suggestion, handle the more things you can server-side.
SQL Protocols are not really designed to work over slow/unreliable connections like the Internet, especially when it comes to 3G and so on. So it really would be best to encapsulate everything into a WebService to which you then send the Nickname, Game and Score and which allows to get the top rankings as well as a given players rankings.
I guess we won't see the ability to connect to remote SQL Servers through ADO.Net as it most likely would lead to bad user experience anyhow.
StevieBallz said:
SQL Protocols are not really designed to work over slow/unreliable connections like the Internet, especially when it comes to 3G and so on. So it really would be best to encapsulate everything into a WebService to which you then send the Nickname, Game and Score and which allows to get the top rankings as well as a given players rankings.
I guess we won't see the ability to connect to remote SQL Servers through ADO.Net as it most likely would lead to bad user experience anyhow.
Click to expand...
Click to collapse
i am good in sql and there are free sql hosters, thats why i wanted to try it with sql.
so, the webservice, is this kind of php? can i also get some free hosters for these services?
i found in google some sample code, but i dont understand where the data will be "stored". Is this going to be like a "cloud app"
edit: grrr looking for "free webservices" in goog but i just find free homepage hosting sites
I find this topic really interesting because it tackles something I just can't wrap my head around: getting Windows Phone 7 to interact with a SQL database just doesn't seem like it's been explained in a straightforward enough manner.
For instance, my case is one where I need my app to extract info from a MySQL db stored on my website, parse that data and display each entry as an item in a pivot control. Turns out that no, SQL is not supported natively so I must go out of my way and recode my data into something that WP7 can understand; I read it's XML and that makes sense, so I have designed an auto-updating XML file on my website with data I want fed into the WP7 app. This is a workaround to connecting directly to a SQL database, as it only requires there to be a PHP file periodically creating an XML file with the info I need and it won't expose any SQL connection credentials, etc. I do not manage users on my site, so maybe win98 needs to find a way for WP7 to call a PHP page, send it a user ID or something and then retrieve that user's info. But any way, I think XML can work perfectly as a means to communicate between SQL and WP7 apps.
But, I don't know how to make this XML file populate the pages of my app. In Expression Blend I can import the XML as sample data, but it does this during design time and not at run time. This means that Blend can see my data and display it how I want it displayed, but I can't take this to runtime and have it displayed like that on the phone. So far, I haven't seen a single easy to follow step by step tutorial on how to parse information coming from an XML file on a WP7 app.
Any suggestions on how to overcome this hurdle we both face? I am familiar with web programming, but I know jack sh*t about C#, so Linq is greek to me.
Ok so I really got this wrong, that with Mango you get SQL and ports support so that you can remotely interact with an SQL server, with sql commands pretty much like you would do on a desktop and how you could do with WinMo ??
Best practices aside, You still get to do that with webservices ?

[Q] WP7 and native for beginner

Hello everybody,
I got a WP7 Samsung Focus and I want to port my old application to this device and join native forces for WP7
My plan is simple: I'll convert my app into a dll, rewrite new gui in C# (or whatever the way to do it on WP7). I saw multiple posts about calling native code (original from Cris Walsh: http://goo.gl/2Tjks). Then I saw a few posts mentioning that it's impossible etc etc.
So, a few questions:
0) can I do it for my app (I don't need marketplace exams etc, I don't care for that)? I know that some WinAPI could be unavailable/broken, all I ask at this point if it's possible to load and run native dll without changing or re-flashing ROM.
1) ms wants 100$ out of my pocket to be able to deploy to my own device (WTF?!). What can I do to deploy to my phone without paying the crooks? (VS2010 tell me to register there and registration askes for 100$).
2) Is there a sample project I could D/L and run, I have zero experience in C# and I have no idea how to load and call native DLL from managed code in WP7? All these half broken samples are totally useless to me, I simply wanted to working HelloWorld app that loads and runs simple dll.
thanks
0) Yes, what you describe is possible. There are lots of limits, though - WP7 applications have very low permissions, and calling native code doesn't fix that. Unless you need to edit something outside the app's own iolated storage, though, you're probably OK.
1) Aside from the official marketplace account ($100), there are a few options:
a) if you've got an LG phone, they come with a built-in registry editor that can be used to dev-unlock your phone. I forget the exact key you need, though.
b) if you've got a student email address (ends in .edu) you can try registering through DreamSpark. This is free.
c) if you don't mind rolling back to pre-NoDo (7004 or 7008) you can use ChevronWP7 Unlock (instructions available on this forum). If you don't have a restore point that far back you can flash an official ROM for that version.
d) if you don't mind waiting, ChevronWP7 Labs will be available at some point (no ETA that I've seen, but it's been talked about for months) and will provide dev-unlock (but not marketplace account) for a nominal fee.
2) There are lots of apps distributed with source, and most of them will use some native code. You could do a search on this forum for subject lines including the tag "[SOURCE]" and find several (I release source for all my apps). However, I suspect what you'd find most useful is Heathcliff74's guide to WP7 apps that use native code, which is on this forum at http://forum.xda-developers.com/showthread.php?t=1299134. It includes step-by-step instructions.
Hope that helps! I look forward to seeing your app. Also, don't hesitate to ask for help with the actual development; I suck at GUIs and Silverlight but am fairly proficient at C# if you need somebody who knows that language, for example.
There is an ETA for the new ChevronWP7 unlocker:only a few weeks away from launch!
Hi GoodDayToDie
GoodDayToDie said:
0) Yes, what you describe is possible. There are lots of limits, though - WP7 applications have very low permissions, and calling native code doesn't fix that. Unless you need to edit something outside the app's own iolated storage, though, you're probably OK.
Click to expand...
Click to collapse
At this point I want to make a DLL from my simple app and call a few functions that interact with filesystem and network. FS is needed only for simple stuff (loading config file etc) from installation folder and creating some temporary files for local storage. Network is tcp/udp, I guess network should be available.
GoodDayToDie said:
1) Aside from the official marketplace account ($100), there are a few options:
...
Click to expand...
Click to collapse
I did some search, it seem that I've done that part. Chevron dev unlock was pulled out from their site, but the old version remains scattered all over the board. There is a good thread a good thread on how to do it. It happens that my phone is 7004. Where can I get old ROM in case if something goes bad and I need to re-flash? Is it easy, am I risking to brick and loose my phone?
I just tried to run sample phone app and it runs on the phone. Initially it said that it was revoked by MS, I run dev-unlock one more time and now it works.
GoodDayToDie said:
2) There are lots of apps distributed with source, and most of them will use some native code. You could do a search on this forum for subject lines including the tag "[SOURCE]" and find several (I release source for all my apps). However, I suspect what you'd find most useful is Heathcliff74's guide to WP7 apps that use native code, which is on this forum at http://forum.xda-developers.com/showthread.php?t=1299134. It includes step-by-step instructions.
Click to expand...
Click to collapse
I'll try to search, hope I'll be up and running soon. Too bad WP7 is DOA. They always had much better tools than all these ghetto Symbian/Android/Xcode crapware tools... WTF is wrong with these guys, at the point when they were surpassed at speed of light by newbies iPhone and Android they made some backward steps to cut off most of the devs (but they added all these 500K Silverlight newbie devs...). I'm so disappointed with Android, seems like they hired all these retards who were fired at symbian: same **** tools
I downloaded a few samples and it seems that all of them contain prebuild dll's and all of them are COM dlls or something like that.
What I'd like to find is simple sample that contains src code to native WinMo dll and C# project that it uses.
As far as I know native dll cannot be build with latest tools (am I right?), but I can use cegcc or VS2008 to build native DLL's.
stuff like:
Code:
if (ComBridge.RegisterComDll("ComFileRw.dll", new Guid("EEA7F43B-A32D-4767-9AE7-9E53DA197455")) != 0)
is totally unknown to me. I would really like to avoid to even elarning anything about COM related stuff. I prefer not to mess up with code that isn't portable.
HI mtlgui,
unless Heathcliff finishes his WP7 Root Tools SDK, you don't have any other way to access native c++ code besides using COM. DFT (The DarkForcesTeam) released a firmware loader, that allows you to flash customized unsigned firmware. They were also able to do some native c++ coding with the WM API. However the used firmware for that is not public and it is limited to HTC devices.
Did you already consider to write your application in c#? Mango has now TCP/UDP socket support for outgoing connections. Incoming connections or services running on the phone aren't possible without using native code, at least for the moment.
Hi rudelm,
if the only way to use native is to build COM dll, then I'm OK with that. My app code is old and I'd rather throw my WP7 device to trash can than trying to rewrite my app in C#.
Eventually, down the road while hacking maybe I'll learn c# well enough to do anything with it other than GUI and calling native/COM dlls.
So, just to confirm my understanding. I need to write COM dlls that access native API (socket, filesystem, wavein/waveout etc) and then load these COM dlls and call their functions from C# (or whatever is the closest lang to c/c++ in the WP7 world).
@mtlgui:
You've pretty much got it. A few thoughts, though:
There is a webserver project available on this site. It includes source for its C++ native component (the library is called NativeIO; I can probably send you the source if you can't find it). It exposes registry, filesystem, and TCP server and client sockets to COM. Note that because this library was built for pre-Mango phones, just compiling it and shipping it may not work on Mango phones as many deprecated libraries were removed in Mango and if the DLL contains any references to them, it won't load.
Generally speaking, what you're asking for with TCP/UDP is possible, though you may have to code against the winsock API directly. It sounds like you're doing as little as possible with C#, so even if the Socket API that is available with Mango were sufficient for your app's needs, you wouldn't be using it.
Filesystem access... even if you have read access to your app's install folder (I haven't checked, though you should), you almost certainly won't have write access. Each app does have a writable "isolated storage" though, under \Applications\Data\{GUID}\Data\IsolatedStore\. I've only ever tried writing to it using C# though, so I don't know for sure if it's writable using the native APIs directly (should be, though).
It's probably perfectly OK to write your app as one big native DLL (hell, it *might* work to just change the build type from Application to Library, then rename main() or something like that). You will need to expose the library to COM, but that's easy. You can then write a very simple C#/Silverlight app (see Heathcliff's instructions, or just post the COM interface and soembody could write it for you). All the C# app needs to do is use ComBridge to access the native DLL, and call a "run()" function or something similarly simple.
For what it's worth, C# is very close to a superset of C++, at least on the desktop. The phone version is crippled a little by not allowing the use of pointers - everything has to be done with strongly-typed references instead, which can make network code a little annoying but is otherwise rarely a problem - but with a little experimentation you may find your disdain for C# to be misguided. It's a useful language to know it today's job market, if nothing else.
Why is your phone still on 7004? That's the launch retail build, something like eight months out of date. On the plus side, this means that things like ChevronWP7 Unlocker still work for you, as you found. On the minu side, it means you're putting up with bugs and missing features that you needn't be. Have you tried updating at all? If/when you do update, make sure to back up the restore points that the Zune software generates (they got in %localappdata%\Microsoft\Windows Phone Update\). That way, if you ever need to roll back to 7004, you can do it. Normally, only the most recent restore point is kept.
Flashing ROMs is safe so long as you don't try something like flashing the wrong one for your device. Unless your bootloader is unlocked (only possible on HTC), you can only flash official ROMs anyhow, which saves you from most of the risks. On the other hand, you're already on as old a ROM as you will find, and so long as you keep your restore points, you can return to it any time you want to, easily.
I'm googling now the board to find NativeIO and that webserver app. So far only references to it, but no src code.
I'm ok with isolated read/write access. All I care is persistent fs storage.
My phone is still 7004 because I just bought it so I can do some WP7 development. I don't want to mess up with updates at the moment.
As I understand from another post ComBridge is C#->COM->native c++ dll or any other dll that can be used, right? I'm just learning some COM to learn enough to start actually programming for the phone. I see that I can pass whatever data I want, but I don't seem to be able to see a way to register callbacks so that native/COM could call back to C#
mtlgui said:
I'm googling now the board to find NativeIO and that webserver app. So far only references to it, but no src code.
I'm ok with isolated read/write access. All I care is persistent fs storage.
My phone is still 7004 because I just bought it so I can do some WP7 development. I don't want to mess up with updates at the moment.
As I understand from another post ComBridge is C#->COM->native c++ dll or any other dll that can be used, right? I'm just learning some COM to learn enough to start actually programming for the phone. I see that I can pass whatever data I want, but I don't seem to be able to see a way to register callbacks so that native/COM could call back to C#
Click to expand...
Click to collapse
Basic introduction to native code and COM, including references to more background info: http://forum.xda-developers.com/showthread.php?t=1299134.
Callback from C++ -> COM -> C# can be done. Decompile the WP7 Acrobat Reader app. You'll see how it works.
Ciao,
Heathcliff74

Categories

Resources