Connecting ASP.NET MVC webApp and window mobile/windows phone7 app - asp.net-mvc

last year I made really simple blog system. it allows user to authorize, posting, commenting. Now I want to create windows mobile/wp7 application that can adding new posts to my blog. But I have no idea how should it work. Should my web app share some api for this or my phone app should just sending specified request to server? I'm interessting how do facebook phone apps work? How they pass data to fb etc.
It would be great if anyone knows book, tutorial or something about connecting web app and phone app. I rather need app architecture tutorials than codes.
PS I know I can just open phone browser and login on website but I want to do it for fun :)

One way of approaching this is create a few actions in your controllers to return data in a format that is friendly to a WP7 app, for example, return JSON rather than HTML.
In your WP7 app you will make HTTP requests to these actions and receive the data in JSON format. From there it's up to you to handle that information on the phone.

What is the back-end of the blog system? Almost any DB data can now be exposed out as an OData Service that can be consumed on a Windows Phone app & also provide CRUD operations. Is OData a possibility?
Check out these two posts for details:
http://www.silverlightshow.net/items/Producing-and-Consuming-OData-in-a-Silverlight-and-Windows-Phone-7-application.aspx
http://www.silverlightshow.net/items/Connecting-Azure-Windows-Phone-through-OData.aspx
The second one does talk about how a central data store can be shared between web & mobile apps.
Hope this helps!

Related

IOS Offline Login

Stange question, I'm looking to create an app for the company I currently work for which will hold all passwords for the software and platforms we use. I would like to be able to create some kind of login or authentication without connecting to the internet or using a post to HTTP.
Is this kind of thing possible? Even if I was to keep it to one username and password across the board. Or is it going to be better to only distribute to people that I know?
The only reason I want to do this is so that when downloaded from the App Store it would be only engineers that could login.
Thanks in advance!
For this you can add json file that contain all the data of the users for initial state and for user registration you can use core data. But you want to syncing with registered data and json file you need to fire silent api call to server.

ios app dynamically loads data from website made on opencart

I have a website made on opencart and now I want an ios app for my website which dynamically loads data from the website. their database should be integrated so that when a change is made to any one of them it should make changes on both website and application.
Does someone provide me that API??
I dont think there is an API like you wish. You have to develop an API gateway as a middleware between your mobile apps and OpenCart backend. And I think it’s a simple job since all your data already exists in OpenCart database.

Send requests to a website from an iOS app

I was wondering if there's a way to send requests to a website, directly from an iOS app, for example, I type my username and password in two inputbox and then I just tap a "login" button on the iPhone, sending the credentials to a website. Can it be done?
You can send requests to a website from an iOS application. You're probably looking to perform a HTTP action.
There is a great guide by the Spring development team which guides you through the process of using RESTful services on iOS, this includes Posting data to a web service.
RESTful services also allow you the create, retrieve, update and delete data from a webservice too using a variety of HTTP calls.

Google Drive API for iOS: OAuth2.0 with an application-owned account

I'm creating a simple iPhone app. The basic premise is that the app will display some data (That I provide online) on the application. The data changes over time, so the app has to draw the data from online and display it. I don't have a significant programming background so I don't want to use my own server.
Thus, I thought it would be significantly easier to just put the data into some documents on a Google account and then access them programmatically via the Google Drive API. I could then update the data in my Drive account and it would get updated in the application. The key here is that I am ONLY accessing ONE account that I own MYSELF. The users' accounts are not being accessed. Therefore the goal is to never have to log in manually. It should all happen behind the scenes, aka, it should look like a server, not a google doc.
With this in mind, it doesn't make sense to show the Google Accounts sign-in page to my users as the standard OAuth2.0 tutorial shows here:https://developers.google.com/drive/quickstart-ios#step_1_enable_the_drive_api
I should be able to access my own data by somehow hardcoding in my username, password etc. Google agrees here: https://developers.google.com/drive/service-accounts#use_regular_google_accounts_as_application-owned_accounts
The above link mentions a "refresh token" that I'm supposed to save. However, I have no idea how to build and save that token, or even for that matter, where to find it.
I've gone through both the basic tutorial and the Dr. Edit Tutorial for iOS, but they both assume that the application is accessing USER accounts not application-owned accounts.
I'm not asking for someone to write the code for me (though tidbits are nice), but if you can point me to a step-by-step guide or related sample code that would help me get started that would be awesome. I'll even come back and post the code that I use!
EDIT: Since I realized that the Google Drive API wasn't something I could use for what I am trying to do, I eventually found Parse which is an awesome tool that handles all the server backend for me and is free at the basic level.
Google APIs objective-C client library doesn't support service (application-owned) accounts, because they are supposed to be used by a server-side apps, instead of clients -- you shouldn't be distributing your private key as a part of an app.
If you would like to distribute content from a service account, maybe you should write a server leg to do the authentication and pass clients credentials in a secure way for them to talk to the API on the behalf of the service account. Or, use Web publishing to make documents universally accessible without authorization and authentication if privacy is not a concern.

Building a private API with rails

Hello me and friends are planning on taking on a big project. My two friends are going to be building iOS and Android apps and I will be making the server back end. I recently started developing with RoR and have fallen in love with Ruby. Now here are my questions:
Little more background:
I only want a private API for the android and iPhone app. I do NOT want a full fledged OAuth authentication process. Doing some research I think I will go with basic HTTP authentication.
1. My App uses cookie based authentication meaning a cookie has to be passed with each subsequent request. So will my friends need to have to store a cookie and on each subsequent request to the server send the cookie along with it?
2. How do I go about making the API private? I know in OAuth there are consumer secret and consumer key. I know if anyone could simply figure out the URL schema they will be able to have access to the API. How do I protect my back end from request from unknown users? (Hard coding strings in the Apps themselves?, Checking headers for device type?)
3. Should I only build the API now and worry about a web app later? Or would it be too horrific of an experience to go back and build a web app (Although I really do actually want the web app to be more significant than the mobile app
Here is a great article explaining exactly what you're looking for : securing an API without setting up a full OAUTH provider :
http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/
Works great (even if the solution is finally not so far from oauth ;)

Resources