How to open mobile view of website in Windows Phone application? - c#

I am trying to open a web page in my Windows Phone application. But, I am unable to open desired web page in its mobile form.
I am adding web browser in my XAML:
</Grid>
<phone:WebBrowser x:Name="wb" HorizontalAlignment="Left" Margin="0,10,0,0" Grid.Row="1" VerticalAlignment="Top" Height="686" Width="480" Loaded="wb_Loaded"/>
</Grid>
And this is my backend code in C#:
private void wb_Loaded(object sender, RoutedEventArgs e)
{
wb.Navigate(new Uri("http://facebook.com/mobile", UriKind.Absolute));
}
But I am unable to view the actual mobile web page of Facebook. This code makes Facebook to look very much ugly.
I tried with http://m.facebook.com also, but this is also not helping.
Please suggest me, how can I correct this error to have actual mobile web page of Facebook in my application.

Wrong mobile url, mobile sites are usually differentiated by the prefix m such as facebooks' actual mobile page https://m.facebook.com which is the subdomain usage for the mobile apps. The mobile page you linked to is to install a mobile app; which is a standard html viewing type page and not mobile.

Related

WPF MediaElement play http url and storage problem

I'm having a MediaElement playing a google drive link like so
xaml code:
<MediaElement x:Name="MdPlayer"
MaxHeight="350"
MaxWidth="350"
Margin="5">
</MediaElement>
.cs code:
MdPlyr.Source = new Uri(#"http://drive.google.com/uc?export=download&id=1jWhVXnC9ziy5jNZeDpcJpTUGrAcF4fNf");// It's actually runbable
When I access to the link on web browser, it download the file, while playing it with MediaElement I didn't have to download it at all. I wonder if the file is downloaded and stored somewhere in the background or is it streamed directly on google drive. Is there any keyword so that I can look into this kind of things?

Share link to social media from Phone

i am developing an app in wp7, which gives you the ability to post on social networks, the song you are listening with name, description and link!
The app is writen with # for Windows Phone and it use
ShareLinkTask shareLinkTask = new ShareLinkTask();
to post the link of song from YouTube!
The format of post is like:
Link = SONGLINK
Message = Listening now: SONGNAME from APP(APPLINK)
The problem is that when i post to facebook the SONGLINK does not have a preview, so is displayed like APPLINK in text-blue-hyperlink with border!
I think is like facebook gets the link but not loads the preview...
I also tried to post facebook via the Facebook app (Microsoft's) and i got the same result, so the app has not problem but the facebook service?
Problem it seems to be from facebook as when i am working with twitter i have the preview with the same code sample!
So any ideas?
Problem it seem to be solved from facebook after some days, it seems that this happend due maintence of the facebook page.

How to add Microsoft Advertising on WP7 App

I'm trying to insert a Microsoft Advertising on my WP7 app but without success.
Of course i'm registered at pubCenter.
I've put in MainPage.xaml this code:
<UI:AdControl Grid.Row="1" ApplicationId="MY APP ID" AdUnitId="MY UNIT AD" HorizontalAlignment="Left" Height="80" VerticalAlignment="Top" Width="480"/>
Of course i've replaced MY APP ID and MY UNIT AD with my personal codes.
In the top of MainPage.xaml i've added this code:
xmlns:UI="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"
In MainPage.xaml.cs i've add this code:
using Microsoft.Advertising.Mobile.UI;
What's missing? What's wrong? App is on the Store but it doesn't show any ads...
You can try this app (it's free) at this link: http://www.windowsphone.com/it-it/store/app/myvodafone/c6a86290-4f69-4fdf-9312-401f93ccb35d
I've just tested the app and the ads are displayed. I guess what happened is your first contact with the concept of fill rate. Basically, putting an ad control in your application doesn't guarantee that ads will be displayed 100% of the time. Depending on the category of the ad unit, the localization of the user, and the period of the year, there may be more apps trying to display ads than actual ads available. In those cases, the ad control won't display anything. The fill rate is the common name for the percentage of times your control has displayed ads. Unfortunately, the administration console of Microsoft PubCenter doesn't display the fill rate yet.
There's a few ways to get a better fill rate: changing the category of your ad unit, or using a special ad control like AdRotator which will automatically switch to another ad provider when there's nothing to display.

Displaying youtube video in silverlight app using Javascript/jQuery

I'm converting an application from php/js/css over to c#/silverlight for a client.
In the old system, I used a URL & the jquery prettyPhoto plugin to display a youtube video.
In the new system, silverlight cannot play FLV natively.
Does anybody have a process & code for how to get my link from the silverlight app, over to a div in my aspx page hosting the silverlight control (default.aspx), then playing the video?
Cheers,
Scott
Lets say you have this Javascript function in your host .aspx page:-
function goAheadAndPlayThatVid(urlOfVid)
{
// some code that plays the Vid
}
Now in Silverlight/C# code you can invoke this function with:-
HtmlPage.Window.Invoke("goAheadAndPlayThatVid", "urlOfVidHere");

CanvasAuthorizer Authorize() not returning true on facebook C# sdk

I downloaded the Facebook C# SDK 4.1.1, and incorporated it on a small ASP.NET 3.5SP1 web project. When I run the application from VS Studio 2008, it allowed me to install my Facebook application. When I log onto facebook, I can see that my app installed, as I see it on my home page left nav.
When I click on the app, it displays the default.aspx page on my facebook app iframe. Looks like it worked, right? No it doesn't because when I debug the page on localhost, I see that the Authorize() on the CanvasAuthorizer app returns FALSE.
I created a web app in IIS 5.0 so that the default vs studio debugger doesn't interfere.
Here are they facebook settings I have set and other relevant information.
Any help is greatly appreciated!
Thanks!
Canvas Page
"http://apps.facebook.com/mynewapp/"
Canvas URL
http://localhost/MyNewApp/
Canvas FBML/iframe
iframe
My Page Load:
protected void Page_Load(object sender, EventArgs e)
{
fbApp = new FacebookApp();
authorizer = new CanvasAuthorizer(fbApp);
authorizer.Perms = requiredAppPermissions;
if (authorizer.Authorize())
{
ShowFacebookContent();
}
}
Here are the relevant sections of my web.config:
Found out the issue:
http://adamyoung.net/IE-Blocking-iFrame-Cookies
The issue was only happening in IE. IE blocks iframe cookies...have to set the header to allow cookies.

Categories

Resources