Loading Google Maps to C# Winform without web browser - c#

Is there a way to integrate Google Maps into a C# WinForms application without embedding a browser into the application?
Thanks

Somewhere in 2016, Google declared that you must use a key to use their Google Maps API, that leaves you with 2 options.
To open Google Maps from the internet directly by URL (using a browser) or
Get a key, and run it using javascript, but you'd still need a browser to execute the javascript.
As far as I know, there are no current option to use Google's API offline from your own application, even the offline version of Google Maps itself will only be available for 30 days, due to the daily change in infrastructure in the world.

Related

Post and/or Share Text/Images on Facebook Wall Server-Side With .NET C#

I've spent a few days implementing Facebook's iOS SDK to allow our users to be able to login and then post text/images to their Facebook wall via our iOS application. I've got that all working smoothly.
However, management would like to take an alternate direction for several reasons (which are irrelevant to me), whereas instead of posting on the device side (iOS), they would like the device side to use the iOS SDK in order to get the user to login and then capture the AccessToken. Then, when the user chooses to share content from our app for example, they want to pass the AccessToken up to the server, and then have the .net/c# code do the actual posting of the text/image there.
1) Is this possible?
2) I see no official support from Facebook for a server-side api. All I see is that they support Mobile and Web (client-side).
3) Through my SO and other online searches, I've seen some very out-dated attempts at an open-source .net Facebook SDK, but they seem to have been abandoned.
4) I do know that it's possible server-side (using the oAuth api) to login and gather some user information, like name/profile photo). But that is not what I need. I need the opposite. I need to login on the client-side, but post/share on the server-side.
Any help and/or direction on this matter would be greatly appreciated.

Using Google Maps for work in C#

I'm trying to use Google maps API from a Desktop app (C#), for doing this we use a resource file that contains an HTML file from which we load the maps-api. What we do is load HTML in a WebBrowser Control from windows Forms, from which we use the google earth plugin for 3D visualization and also use the google maps API for geocoding, sometime we also load some KMZ's in that Control.
If we don't use a licensed API the app works, but when we try to use a licensed API, we must register an URL and sign it to be able to use the maps API for work, but it only can be done from a Internet URL.
Is there another way of using a "work" API for desktop apps?
Kind Regards
The "authorized URL" you need to register depends a bit on the web browser control you are using. Local files for example usually get a referrer with a file:// URL (eg. file:///C:/somefile.html)
With an embedded resource, it highly depends on the implementation, but you should be able to use alert(window.location.href) or something similar inside a script block in your embedded HTML to get the proper URL.
Note that the support portal does not allow arbitrary protocols in URLs at the moment, so you might need to contact Google for Work Support if you require special protocols.

From my own website programmatically POST a video on my user's Facebook Wall

I keep finding posts about preparing websites to be "postable" within the Facebook Status update (like with a youtube link that when typed from on the Facebook Status Update edit box and it will display in your TimeLine).
What I need is the opposite:
From my own website, I would like to have a button that when clicked, it should automatically post a specific video that is hosted within my website (or I could post a specific webpage that has the video inside).
What's the process to accomplish that?
Do I need Open Graph?
Do I need an Facebook App?
Do I need to use FQL?
Can I achieve this solely using FB Javascript SDK?
Should I use FacebookSDK for .Net (I'm using Asp.MVC and C#)?
Please any help would be truly appreciated.
I'm so lost on this one !!
Do I need Open Graph?
The Graph API is the primary way to get data in and out of Facebook's
social graph. It's a low-level HTTP-based API that you can use to
query data, post new stories, upload photos and a variety of other
tasks that an app might need to do.
How to Use Graph Api Take a look at FB Docs. The Graph API and Quick Start
Do I need an Facebook App?
You need to create facebook app. Its required for authentication
purpose. when you read and write its must need access. If you create
you will get APP ID and APP Secret ID to give the access.
Go Here and get logged in and Create an APP.
Should I use FacebookSDK for .Net (I'm using Asp.MVC and C#)?
If you are okay to go with C# with ASP.NET then in FaceBook Official site they are suggesting many third parties SDK which is free. For
Authentication, File Upload and Download you can use the SDK.
Click here to Go
Can I achieve this solely using FB Javascript SDK?
I'm not sure whether you can use FB Javascript SDK for uploading. I
just guess you can't use. Take a look how they are using FB
Javascript SDK.
Do I need to use FQL?
Facebook Query Language, or FQL, enables you to use a SQL-style
interface to query the data exposed by the Graph API. It provides
advanced features not available in the Graph API.
FQL Why and What? Read Here

How to write a command line C# program that posts to Twitter

I'd like to write a console program in C# that posts a Tweet to Twitter. I've never used the Twitter APIs before and don't know anything about how their authentication works. I found an API library called Twitterizer, but it seems geared towards web applications and wants the user to logon with a web browser. All the API docs on Twitter's website seems geared around this scenario as well.
Is it possible to access the Twitter APIs using a console app with no web browser access? I'm perfectly fine hard coding in the name and password for the Twitter user I want to post under as well. Thanks!
Mike
You'll need to use OAuth for authenticating in twitter.
Then use regular HTTP Request to use the twitter JSON-based API.
Here you can find a good article about OAuth, Twitter and console applications.
Also take a loot at linq2twitter lib. From it's documentation;
The Twitter API is built using
Representable State Transfer (REST).
Wikipaedia defines REST as "...a style
of software architecture for
distributed hypermedia systems...",
but I'm going to be so bold as to try
to simplify what that means. In
practice, REST is a Web service
protocol built upon Hypertext Transfer
Protocol (HTTP). You use the REST Web
service by making an HTTP call with a
URL and getting text back in some
form, which is often XML or JSON. So,
if you were to write code that made an
HTTP request with the following URL:
http://api.twitter.com/1/statuses/public_timeline.xml
You would get back an XML document
with all of the Twitter statuses from
the public timeline, which is a
snapshot in time of the last 20 tweets
at the time of your request. Go ahead
and open your browser, copy and paste
the URL above into the address bar,
and see what you get back.
I couldn't find any decent information on the web on how to do this, so I decided to write my own blog post with all the details.. Enjoy!
http://blog.kitchenpc.com/2011/01/22/rise-of-the-twitterbot/
of course you can use anything to connect to Twitter via RESTful api.
you should use oauth, and set up your application in http://dev.twitter.com, then you should read all articles listed in documents, you must specify your app as Client but not Browser so user input a number to get through authentication.
you can use many libraries so that you can save your time, all are listed in the documents
and be CAREFUL, you should not use Twitter's own api console which is buggy (as i know parameters somtimes can't be parsed), you should use APIgee instead which is powerful and stable.
if you want use basic authentication, you should use api proxy (one famous is twip), if you just need only one single C# apps, you must code by yourself:
you should use given username and password to login twitter, parse cookies passed
use normal oauth to get temporaly access token url.
use cookies got from step 1, emulates form submit to allow your apps, capture PIN code
use pin code to finish oauth.
MOST IMPORTANT, you must store access token in client's machine so next time you can bypass above steps
Just wrote a Twitter Bot in C#. This is currently posting tweets to #valuetraderteam.
https://gist.github.com/sdesalas/c82b92200816ecc83af1
The API component in the GIST below is less than 500 lines, only dependency is Json.NET, you'll need to download the latest DLL for either x64 or x86 (depending on what platform you are targetting) and include as a reference in your project.
There is an example at the bottom of the page of how you can make a tweet from a console application
Hopefully this is useful to some other people out there.

Getting started with silverlight/facebook development

Is there any very simple sample applications to get started with facebook dev?
I just want to know how I would connect to facebook through silverlight, get the authentication stuff out of the way and then develop, debug and test my applications.
Do I need to be connected to a server which connects to facebook or can I do the development from my own PC which can 'talk' to facebook?
I'm also a bit worried about the updating APIs. Some of hte samples seem a bit old? I'd really like something for the latest version of silverlight/facebook API...
We are working on posting some silverlight samples to the Facebook C# SDK on Codeplex in the next week or so. You can find that SDK at http://facebooksdk.codeplex.com or http://www.microsoft.com/facebook. We will have an in browser and out of browser sample. For now, we have other samples on there that you can look at. For the most part the SDK works the same on any .Net platform.
I've been working on a SL application with facebook integration that utilizes. I use the JavaScript SDK to log the user in, then pass the access_token into my SL app via a ScriptableMember method. I then use the FacebookApp constructor that takes an access token to create a new Facebook App object. Then I can make my calls directly from the SL app, without the need for a server-side proxy.
One thing to note, in your Facebook applicaiton settings, just enter http://localhost/ without the port for your site address.
I'm eagerly awaiting a little more guidance from Nathan, as he's a developer of the C# SDK

Categories