WP7 and SQL Azure - Windows Phone 7 Software Development

Hi guys,
I'm looking forward to building apps with WP7 using SQL Azure database
I can build apps with WP7 and have my SQL Azure database ready, but I don't know how to query data from Azure to my WP7 client
So far I don't find any tutorial on this topic yet
Any help would be greatly appreciated
Thanks

huy302 said:
Hi guys,
I'm looking forward to building apps with WP7 using SQL Azure database
I can build apps with WP7 and have my SQL Azure database ready, but I don't know how to query data from Azure to my WP7 client
So far I don't find any tutorial on this topic yet
Any help would be greatly appreciated
Thanks
Click to expand...
Click to collapse
I don't have an Azure account to test, but don't you just connect to an Azure SQL server the same way you do a regular one?
Code:
string _connectionString = "Server=tcp:[serverName].database.windows.net;Database=myDataBase;User ID=[LoginForDb]@[serverName];Password=myPassword;Trusted_Connection=False;Encrypt=True;";
using(SqlConnection conn = new SqlConnection(_connectionString)) {
conn.Open();
...
}
Replacing the information in _connectionString for your Azure account obviously. You can find all necessary connection strings here:
http://www.connectionstrings.com/sql-azure

Blade0rz said:
I don't have an Azure account to test, but don't you just connect to an Azure SQL server the same way you do a regular one?
Replacing the information in _connectionString for your Azure account obviously. You can find all necessary connection strings here:
http://www.connectionstrings.com/sql-azure
Click to expand...
Click to collapse
Yep.
Oh an NO EXCUSES for not having an Azure account!
For all of you independent software developers out there, you can get a full Azure instance for FREE.
Just sign up for BizSpark:
http://www.microsoft.com/bizspark/default.aspx
Yes, it is legal and if you are developing software, you you qualify. Basically, BizSpark gets you a full MSDN account, including Azure for free.
Not bad...
BTW, get started on SQL Azure here: http://www.microsoft.com/en-us/sqlazure/whitepapers.aspx

Hi,
I'm currently registered as an individual software developer in germany.
Do I have to use my own name as "Startup Name"? How is the general
process with BizSpark? What do I fill in for "Date/Month founded"? The
date when I registered as developer in germany? I read about the
sponsorship network partner you need to approval. What about this?
I contacted one of the partners OCC Bangalore for more info.

toolsche said:
Hi,
I'm currently registered as an individual software developer in germany.
Do I have to use my own name as "Startup Name"? How is the general
process with BizSpark? What do I fill in for "Date/Month founded"? The
date when I registered as developer in germany? I read about the
sponsorship network partner you need to approval. What about this?
I contacted one of the partners OCC Bangalore for more info.
Click to expand...
Click to collapse
PM Sent on BizSpark

I would like to know the same about the process of the BizSpark. I'm interested in using SQL Azure.

Probably not a good idea. Unless you don't mind giving access to anyone with Reflector your connection string. (A read-only account with V. limited priv's for example).
Might be better to host a webservice and make requests to that webservice using one of the many Client - Server frameworks (WCF, JSON, etc) available.
That way the client calls a method on the webservice which queries the Azure data and then returns it to the client. The client then know's nothing about the database.
nTier might seem a bit much, but a hacker with your database login could be worse .

Related

[Q] Booking system app for Windows Mobile

Hey guys
I'm an entrepreneur from Brisbane, Australia. I'm looking into introducing a new product and am wondering if you guys would be able to help me clarify a few questions. I have to add I have no idea what so ever about programming languages or whats possible or not. I just going to post my vision of the application I will need and hope some of you guys can tell me what of that will be possible, what not and how much effort / money it would take to realise.
Firstly of all and most importantly I need the the Phone application to work with several other systems which would be at the moment : - Iphone, Facebook, Windows Mobile, Blackberry Android, a Website interface, Windows Vista / 7 and Mac OS. I need this to work in two ways. One for the user to sync their data on different apps and secondly for the admin to receive and send data from the main system (that would be working on Windows or Mac)
On first interface the user would have to log in with a username and password, high security would be welcome, after the log in the general interface should be offering the user a booking request form with the ability to use a saved lists of items which have been previously use / prepared but also a interface for add one or editing
It also should offer a open bookings lists and the ability to edit this lists. This should also be able to be synced to the other systems. A third interface showing a history and updates should be also available.
If possible it should offer different accounts and groups where admins can edit the bookings of other users. If this is possible it also should offer a control for the admins which shows bookings and history of other group users.
I would like this obviously to be a professional looking app which offers a good service and is secure and bug free. If anyone has an idea if this is realisable or what parts of it would be difficult or have to be changed please do me the favour and comment.
Thank you for your help in advance.
JPM

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 ?

DropBox ver 1 API and/or non-MS and not ugly SkyDrive API

First, I'd like to wish happy New Year for everybody!
Second, I have a question to xda's developers: is there a working and non-ugly (without involving WebBrowser window) library for WP7 to access DropBox API version 1 (it's important, new apps can't use ver 0 anymore; all codeplex'es libs are using version 0 and seems like nobody planned to improve their non-working stuff).
I'm also interested in non-ugly (as Microsoft Live SDK) access library to SkyDrive, also without WebBrowser (it's a most stupidest and ugly API I've ever seen!).
If you have your own working code, could you please share with me for my new free app? I don't have much time to write my own implementation, and I hope that someone has already done this job.
Thanks!
I saw already apps, check BoxShot:
Free: http://www.windowsphone.com/en-US/apps/0be109c4-08be-4ac3-a96b-70ef2b0580e3
Pay: http://www.windowsphone.com/en-US/apps/1abb6e8c-d1ca-4209-a7b8-c2d657ffc9b4
Budniu said:
I saw already apps, check BoxShot:
Click to expand...
Click to collapse
Hmm... Seems like you didn't understand me, I need Silverlight library, not an app.
BoxShot is using DropNet library, ver 0 of DropBox API only...
Ok, sr. You're right, I don't understand.
How about this: http://sharpbox.codeplex.com/releases/view/74634
singularity0821 said:
How about this: http://sharpbox.codeplex.com/releases/view/74634
Click to expand...
Click to collapse
Unfortunately, not working at all (for DropBox) even their demo app Also, they are using synchronous http calls and current code just block whole thread execution.
sensboston said:
Unfortunately, not working at all (for DropBox) even their demo app Also, they are using synchronous http calls and current code just block whole thread execution.
Click to expand...
Click to collapse
I'm sure we can figure out how to get it without using the web browser . I'll see what I can figure out if you want.
snickler said:
I'm sure we can figure out how to get it without using the web browser . I'll see what I can figure out if you want.
Click to expand...
Click to collapse
I'm 100% sure it's possible I just don't have time to work with the new API (v 1) specs and OAuth. So if you have time and want to implement - it's really will be great! And of course I can help you with testing (using my project).
P.S. BTW, SharpBox designed to use synchronous calls; I don't like this way. IMHO good implementation should be more "WP7-oriented"...
And how about this: http://dkdevelopment.net/what-im-doing/dropnet/
singularity0821 said:
And how about this: http://dkdevelopment.net/what-im-doing/dropnet/
Click to expand...
Click to collapse
This one is working but it's "lazy" and kinda ugly solution (author is using WebBrowser window to login to Dropbox account). I completely dislike this way. Same ugly as MS SkyDrive API
sensboston said:
This one is working but it's "lazy" and kinda ugly solution (author is using WebBrowser window to login to Dropbox account). I completely dislike this way. Same ugly as MS SkyDrive API
Click to expand...
Click to collapse
Isn't that how most apps that use OAuth work?
PG2G said:
Isn't that how most apps that use OAuth work?
Click to expand...
Click to collapse
I don't know, actually, but all Dropbox access libs (API v. 0) are working without showing browser window.
P.S. I've found on the Dropbox devs forum, it's possible (but not a guaranteed) to ask dropbox support team to change your app and secret keys to API version 0.
sensboston said:
I don't know, actually, but all Dropbox access libs (API v. 0) are working without showing browser window.
P.S. I've found on the Dropbox devs forum, it's possible (but not a guaranteed) to ask dropbox support team to change your app and secret keys to API version 0.
Click to expand...
Click to collapse
Hello,
I'm the developer behind DropNet. Just a bit of background on the change to API v1: Dropbox wanted to support the full oauth spec which actually requires the web login. I know this makes it not as "clean" for the apps but makes it more secure for Dropbox. They have also announced they will be turning off API v0 sometime in the future (Though they have not stated when).
I dont think the authentication is process is too bad, once you get your head around it. Its accepted by users that they will have to login via the website nowadays (Twitter and Facebook do it as well).
d1k_is said:
actually requires the web login
Click to expand...
Click to collapse
What do you mean by that? I don't know term "web login"... If you mean - "I guess it requires a kinda unknown - for me - parameters or headers for HTTP POST/GET request" - I'll agree but it's definitely not a point to display slow loading and ugly web page each time you need an access to your files. Do you know, what is the actual login technique in API 1 (I mean what kind of params , headers, cookies are used, not a "web login" stuff)?
sensboston said:
What do you mean by that? I don't know term "web login"... If you mean - "I guess it requires a kinda unknown - for me - parameters or headers for HTTP POST/GET request" - I'll agree but it's definitely not a point to display slow loading and ugly web page each time you need an access to your files. Do you know, what is the actual login technique in API 1 (I mean what kind of params , headers, cookies are used, not a "web login" stuff)?
Click to expand...
Click to collapse
Hmmm, sounds like you have the wrong idea about the authentication.
First of all the authentication is a 3 step process (for the developer), step 1 is to get a request token from the API, step 2 is to browse to the site (using the request token as page parameters) so the user can login, step 3 is authorizing the request token (changing it to an access token).
Once you get an access token you can save that in your app and use it forever (or until the user removes access from your app) this means the user will only have to login the first time they run the app as you will have their access token saved locally which you can use to access the API functions (but the access token only works with the API Keys it was created with).
For more info check out the DropNet documentation for the Authentication process (http://dkdevelopment.net/what-im-doing/dropnet/) Theres also a sample app in the Github project.
It sound like you have no idea how the browsers works... "Browse", "navigate" - it's good terms for users, not for developers. From a technical point of view, browser makes an HTTP or HTTPS request to the host and receive a response. So, what you (and dropbox dev and marketing team) called "token" is a text/binary data, part of the response.
So, what is preventing you to make a direct call to dropbox web service using WebRequest?
P.S. I definitely don't like the whole idea to use browser cookies (it suppose to be a kind cookie) for authentication: as for dropbox, as for ms skydrive. It's just ugly - period. And about security - I don't think it's a huge improvement.
sensboston said:
It sound like you have no idea how the browsers works... "Browse", "navigate" - it's good terms for users, not for developers. From a technical point of view, browser makes an HTTP or HTTPS request to the host and receive a response. So, what you (and dropbox dev and marketing team) called "token" is a text/binary data, part of the response.
So, what is preventing you to make a direct call to dropbox web service using WebRequest?
P.S. I definitely don't like the whole idea to use browser cookies (it suppose to be a kind cookie) for authentication: as for dropbox, as for ms skydrive. It's just ugly - period. And about security - I don't think it's a huge improvement.
Click to expand...
Click to collapse
Sorry I was only trying to help.
The tokens are string values and you use a GET via HTTPS sending them as page parameters.
You dont use browser cookies as the dropbox API keeps track of the token you are authenticating against.
Just tried your WP7 example app from DropNet. Actually it demonstrates a little bit more than nothing Could you make a real example, with folders browsing and file operations, please?
P.S. You should use mobile version of dropbox - it feets WP7 screen much better than regular desktop.
600 MB additional free storage
Hi all
Just found a smart way to increase your Dropbox account with 600 MB:
1 Sign into your existing Dropbox account (or create a new account)
2 Goto https://www.dropbox.com/free
3 Follow instructions ... and voila 600 MB additional free storage
thx for the tip, I now got 3,12 GB

[BETA] WP7 Developers for Testing

Hi,
We are creating a back-end service for WP7 developers so they will not need to develop and maintain back-end server for their apps. We are searching for beta testers who can feedback on our service. Please pm me if you are interested.
Thanks
First, what type of service?
lseidman said:
First, what type of service?
Click to expand...
Click to collapse
It is ready back end server for mobile app developers. For example save/query user data , save location information or retrieve saved locations that is in a specified area etc. Our goal is to build an easy to use, complete set of server side functionality for mobile app developers so they can go to market faster without worrying server side.
Sent PM but will be good if you can answer here.
sensboston said:
Sent PM but will be good if you can answer here.
Click to expand...
Click to collapse
Thanks , Actually all the details are on our web site appEasify.com , I am not sure if I am allowed to post links . This will be a paid service but beta testers will enjoy free limited service(and details for this is also on the web site). This is WP7 only for now, we have a WP7 client that talks to our Azure web service. Clients for other platforms will follow. The API details are on the web site under developers section.

[SDK] Promocodes for your app

Hello!
I'm software developer from Russia, and made one very popular app in local market. Very soon I realized that I need an ability to give licensed version of app for my friends or reviewers or someone else.
Unfortunately AppHub doesn't provide such functionality(private distribution is pain in ass), so I created a webservice for myself.
After two days I realized that it may be useful for other developers, so here it is:
promo.g33k.ru (here I wanted to post url, but I can't due to low post count. You may find it in my profile->interests)
Now it has:
- JSON/SDK with RSA1024/SHA1 sign for additional security checks
- Binary SDK available
- Russian localization(if anyone cares ) (btw, if you can help translating to other language(s) or correct english misspellings - i will appreciate this).
Now this service works in beta mode.
So for developers I have two questions:
1) Is such service useful for you?
2) How to develop it further, in which way?
Not yet clear
I am sorry, but after reading your post and also checking your website I am still not sure what you offer. For me there is just not enough information to understand and then judge the usefulness of your service.
Maybe you could give a step-by-step scenario: Dev does this, then interested user does that, dev then this ...
Ok, I'll try to describe a little more details:
1) Developer wants to add capability of promo codes in his app(to give some specific users full licensed app).
The first problem is that developer need his own server for checking of promo code validity(hardcoding is not an option, of course).
2) So, Developer registers in my service, add his app's guid to his app list and create a promo code for specific app via web.
3) Developer adds support for promo codes in his app by:
a) adding an text box for user to enter promode
b) adding a web request to specific URL for promocode activation
c) adding to his license check web request for checking is current user activated a promo code.
Benefits for developer:
- Add support for promo codes without owning a server.
- Simple way to give full version of program to friends
Benefits for users:
- User may found promo code for specific app somewhere and use it to get full version of app in simple manner.
Benefits for reviewers/portals:
- Developers can easily give promo code for reviewing purpose or as giveaway for news post.
Clear now
Thanks for the additional info, now it's clear
Well yes, sounds useful. Properly implemented is probably really easier than Microsoft's "closed beta" mechanism, and of course can be used for other, non-beta apps as well.
The icing on the cake would be a "frame application" as sample code that basically does nothing more than asking for a promo code and then check against the list of valid codes on your server.
Sounds intresting but how do you ensure security?
chabun, I thought about security and situation is same as with default checking for trial - there is no security Man-in-the-Middle and direct cracking of xap will work, and there is no way out. I could use RSA signing for MitM, but still cracking of xap is very easy option today, so no one really interested will try to use MitM. When WP8 SDK will be out(I believe it will be in several weeks) - some developers may implement trial checks in native code - this will be much harder to crack.
As for server part there are following possible problems
- App's ID squatting(same as domain, someone else could reserve developer's app's guid). Don't know yet what to do with this, may be think about it later when this happens?
- Promocode's for App ID bruteforce - could be easily avoided via server throttling, if this ever happens - i'll add such checks
- Server DDoS - every webmaster's nightmare, I hope this never happens(or my Amazon AWS will pour my purse empty
rbrunner7, nice idea, I'll add a sample app as soon as possible on site.
This looks like an interesting concept
Sent from my SGH-i917 using XDA Windows Phone 7 App
Yop, you can never avoid direct cracking... However, RSA signing would be good I'd say as it will avoid MitM - with MitM you could create simple tools which can be used by every noob outhere. Cracking xaps requires some skill and it will need an unlocked WP7 as well.
I can see this working i have been thinking about something similar also. You can encrypt the data on device before sending it off to the cloud, you can than verify the encrypted data with a password and compare it to the codes registered on the server. Than link a code to a certain device id (once the code becomes 'registered') if a certain code is already coupled to a deice id and the device is not the same than the app will jump back into trial mode. Otherwise one can use the paid mode.
This can defenetly work and will prevent reselling th codes. Although it requires a server. And users can still hack/patch the app ofcourse but that will require an unlocked device so I should not worry to much about it.
Also to prevent spoofing you can frequently check with the server if this device is legitetmately registered.
Marvin_S said:
I can see this working i have been thinking about something similar also. You can encrypt the data on device before sending it off to the cloud, you can than verify the encrypted data with a password and compare it to the codes registered on the server. Than link a code to a certain device id (once the code becomes 'registered') if a certain code is already coupled to a deice id and the device is not the same than the app will jump back into trial mode. Otherwise one can use the paid mode.
This can defenetly work and will prevent reselling th codes. Although it requires a server. And users can still hack/patch the app ofcourse but that will require an unlocked device so I should not worry to much about it.
Also to prevent spoofing you can frequently check with the server if this device is legitetmately registered.
Click to expand...
Click to collapse
That's what I thought of... private/public key
chabun, so, for example, how about following scenario:
for each developer server creates public/private key pair.
when checking license on server: if success server encodes userid with developer private key
when checking license in app: server response decoding via public key(hardcoded in app) and comparing to userId. if ok -> licensed.
You might want to ask @ngreader guys on twitter. They do have this concept implemented in their app.
diverofdark said:
chabun, so, for example, how about following scenario:
for each developer server creates public/private key pair.
when checking license on server: if success server encodes userid with developer private key
when checking license in app: server response decoding via public key(hardcoded in app) and comparing to userId. if ok -> licensed.
Click to expand...
Click to collapse
I'm not sure if it would be good to encode the request to the server as well but otherwise it sounds really cool now... I'll use this service when I need this (and tell my friends about it)
Here is one way to do it http://stackoverflow.com/questions/599837/how-to-generate-and-validate-a-software-license-key
wpxbox said:
Here is one way to do it http://stackoverflow.com/questions/599837/how-to-generate-and-validate-a-software-license-key
Click to expand...
Click to collapse
Well, what they suggest is not as good as diverofdark's service which is a lot more secure and still easy to use for the customers...
Greetings everyone!
Today I updated promo.g33k.ru, now it has:
- more detailed about page,
- SDK now includes RSA1024/SHA1 sign for additional security checks
- Binary SDK available
- Russian localization(if anyone cares ) (btw, if you can help translating to other language(s) or correct english misspellings - i will appreciate this).
- Many minor bugfixes.
So, from now this service works in beta mode
diverofdark said:
Greetings everyone!
Today I updated promo.g33k.ru, now it has:
- more detailed about page,
- SDK now includes RSA1024/SHA1 sign for additional security checks
- Binary SDK available
- Russian localization(if anyone cares ) (btw, if you can help translating to other language(s) or correct english misspellings - i will appreciate this).
- Many minor bugfixes.
So, from now this service works in beta mode
Click to expand...
Click to collapse
Thanks! I will check this out
Hey diverofdark
It would be nice if you update the first post in the thread with all information. That's the way it's usually done in the forum.
A possible user (here dev ) can read it and without having to browse the whole thread, he can use your promocode service...
Thanks for mentioning it, I updated the first post.

Categories

Resources