Facebook User Login in XNA-GameStudio for Windows Desktop - facebook

Is it possible to do user authentication / user-login for Facebook-Api inside a Visual Studio C# project using XNA Game Studio? I need to generate the access-token to post a message on a user's facebook wall.
Currently I managed to do it with a WinForms application using this tutorial (English):
http://blog.prabir.me/posts/facebook-csharp-sdk-writing-your-first-facebook-application-v6
or this tutorial (German)
http://frank-it-beratung.com/blog/2011/01/29/tutorial-ein-facebook-pinnwandeintrag-mit-visual-basic-oder-c-teil-2/
Its no problem with WinForms, because you can use System.Windows.Forms.Webbrowser control.
So in order to support this functionality in XNA Game Studio, do I need to embed a Winform Control in XNA? Or is there a better way?
I could embed the Winform in XNA by using this tutorial:
http://theinstructionlimit.com/how-to-properly-use-windows-forms-with-xna

You can try to use HttpWebRequest. You can google more info on how to use this method, essentially it is a direct connection to web page, the same way browser does it in background. Unfortunately it is not so easy to do and you might encounter additional facebook security barriers (as facebook does not want automated connections without web service).
There is also facebook sdk for windows store applications, but it should be possible to take some of it's code and use it for XNA.
So to answer your question - yes, there is definitely better ways to implement facebook login, but most likely much more complex than using Webbrowser control. Webbrowser should be last resort.

Related

iPhone app programming

I've built a few iPhone web apps using HTML, CSS, JavaScript, jQuery, PHP, and SQL Queries. However, I haven't found a way to access the camera with a web app. If you know of a way to do that, please tell me what to use and how to use it. If there is no way to access the camera with a web app, I realize I'll have to make a regular app. What languages should I start to learn? Instagram is a website, so I'm not entirely sure how they did what they did.
So my question is, if I wanted to built an app similar to instagram (where I could access the camera), where should I begin?
What languages should I learn?
Thanks ahead of time.
PhoneGap might be the right tool for you.
PhoneGap is an HTML5 app platform that allows you to author native
applications with web technologies and get access to APIs and app
stores.
See this reference on its camera API.

Can I write a plugin for google earth desktop application?

It seems the preferred way to use Google Earth in an application is to embed it within a web page then access it via the javascript API.
However, rather than embed it in a web page, is it possible for some code to embed new functionality within the Google Earth desktop application itself? or is writing my own app with an embedded web browser my only option?
is it possible for some code to embed new functionality within the Google Earth desktop application itself
Depends exactly what you want to do. Can do a fair bit (but not everything!) with KML and in particular NetworkLinks.
is writing my own app with an embedded web browser my only option?
Not the only, but probably the most flexible.
Google dropped support for the COM API (ie. the desktop app) some time ago. The COM API was pretty terrible even on the best of days anyway.
What you could do is write an app that uses an embedded web browser -- and that web browser is what is viewing your Google Earth instance. Then you get the full features of the web API, plus the robust features of your language. If you use C#, you can use Google's API (which has a C# binding) and connect that to the javascript events as needed (ie. to figure out when the user clicked stuff in the web page.)
Here's an excellent point where you can get started:
http://code.google.com/p/winforms-geplugin-control-library/
In all seriousness -- having worked with the old COM API for nearly 2 years -- I'm glad it's gone. You really don't want to use it.

Can the browser access to camera (independent of OS) and other applications on the laptop?

we want to create an internet platform, where for registered users the following is done:
1) Tracking of the applications they open during they are "checked in" on the page
2) Tracking of their web surfing
3) In regular periods a picture is automatically taken by the built-in camera of the laptop (not Smartphone) and uploaded to the platform.
I know, sounds like brave new world;)
Is a server-sided framework like Rails with client code in JQuery sufficient for it?
Or is an own client application in e.g. objective-C for MacOS necessary?
Thanks,
R
You can do 2 using almost any of the web application frameworks + javascript.
1 is impossible unless the there is an application running in the desktop or a browser extension that is communicating with your website.
However the 3 sounds very alarming from a privacy standpoint. But if the users are willing and is aware of it then it's not an issue.
As far as I know, JavaScript does not natively support accessing the web camera. But Flash does!
Fortunately for you there is a library which combines both Flash and JavaScript that can take a web cam snapshot. It's called jpegcam. There seems to be another one called jquery web cam plugin. Also read this question - https://stackoverflow.com/questions/3922723/using-a-webcam-with-javascript

Can PhoneGap apps use server pages to load on it?

I am trying to do web apps using PhoneGap framework for iOS. I need to know whether PhoneGap loads page from server or not, I mean , can I use server side scripting language like php, pyhon, etc?
And if I used those scripting language, can I use phone native feature like camera?
Also for data storage there may be feature, I heard opendatabase can be used for online / offline database. Please anyone help me to figure out these things.
Waiting for good answer.
Thanks
Server side scripts cannot be loaded from within the app, however you can certainly call out to PHP, Python, etc running on a server from the app using AJAX, XHR, etc.
I gave an example in the question below:
How can get value in phonegap which is returned by php class?

Windows mobile application and javascript communication

Is it possible to create communication between running program context and javascript ?
for example, iPhone have good example about it under webkit development on iPhone.
It's possible to invoke this command stringByEvaluatingJavaScriptFromString from webview in the application scope on Obj-C and iPhone platform. I'm looking to same thing in windows mobile 6 or greater versions.
Any comments would be appreciated.
This question has some links about hosting a web browser control on an application.
I guess it's possible to catch events from the page, or maybe just from the url change that you can use to trigger an action on the application.
PhoneGap has a WiMo prototype here. You have a web browser control in your application, then call out to C# by setting the href and intercepting in the Navigating event.