I'm trying to insert ad in a Windows Phone 8 app using Visual Studio 2013 Ultimate.
I inserted this code in MainPage.xaml :
xmlns:UI="using:Microsoft.Advertising.WinRT.UI"
And my Grid tag:
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<UI:AdControl
ApplicationId="----------------------"
AdUnitId="------"
HorizontalAlignment="Left"
Height="500"
Margin="0,0,0,0"
VerticalAlignment="Top"
Width="200"/>
</Grid>
Why do I get this error?
AdControl not exist in namespace "using: Microsoft.Advertising.WinRT.UI"
Errore2 type 'UI: AdControl' not found. Check for missing a reference to an assembly and all assembly to which you refer have been compiled
Right click on Reference in your Solution Explorer window and select Add Reference.
WINDOWS RT (UNIVERSAL APPS)
Then move on Windows Phone 8.1 Tab and select 'Extensions'. You should find Microsoft Advertising SDK for Windows Phone 8.1 XAML. Select it and click ok, then rebuild (F6)
WINDOWS PHONE SILVERLIGHT
Move on Assemblies tab, then click on Extensions and add these 2 references:
Microsoft.Advertising.Mobile
Microsoft.Advertising.Mobile.UI
Then you have to add in the XAML page this namespace:
xmlns:adv="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"
and finally add the advertising control to your page:
<adv:AdControl ApplicationId="YOUR_APPLICATION_ID" AdUnitId="YOUR_AD_UNIT_ID"
Width="480" Height="80"/>
If you're not able to find references, it's beacuse you didn't install the SDK on your computer. Go here, download the right version according to your needs and install it, then repeat the steps.
Let me know if it works!
Related
I am trying to figure out, how to set the app logo as well as the splashscreen using the preview for cordova apps (or Multi-Device Hybrid Apps) in Visual Studio 2013. I tried adding
<platform name="wp8">
<icon src="img/logo.png" width="99" height="99" />
<!-- tile image -->
<icon src="img/logo.png" width="159" height="159" />
</platform>
However this won't do the trick. It's a pretty new thing so finding informations on this topic is kind of hard. It was pretty easy, using the old method. Any help is appreciated.
Multi-Device Hybrid apps use the Cordova CLI to build for each platform, which provides a fallback by default, so you don't actually need to add a reference in your HTML files.
Instead, to set a logo (I assume you're talking about the icon that shows up in the app drawer), you need to add(or replace) the image in res/icons/wp8/ by following the resolution and naming guidelines mentioned in "Platform-specific Visual Assets" section of the docs.
Switch to wp8.1 emulator instead of wp8 emulator.
I am currently working on an application that was developed using windows phone 8.0 sdk and and i targeted it to work with Wp8.1 SDK. Everything is working fine, apart from the issue with tiles. For some reason, it is taking the WMAAppmanifest settings into consideration instead of the Package.appxmanifest file.
here's my Application tag in the Package.appxmanifest file,
<Applications>
<Application Id="xxxxxxxxxxxxxxxxxx" Executable="AGHost.exe" EntryPoint="/Views/SplashScreen.xaml">
<m3:VisualElements DisplayName="SampleUI" Square150x150Logo="Assets\SquareTile150x150.png" Square44x44Logo="Assets\Logo.png" Description="SyncUI" ForegroundText="light" BackgroundColor="#464646">
<m3:DefaultTile Square71x71Logo="Assets\SquareTile71x71.png">
</m3:DefaultTile>
<m3:SplashScreen Image="Assets\Splashscreen.png" />
</m3:VisualElements>
<Extensions>
<Extension Category="windows.backgroundTasks" EntryPoint="ScheduleSync.TimerTriggerTask">
<BackgroundTasks>
<Task Type="systemEvent" />
<Task Type="timer" />
</BackgroundTasks>
</Extension>
</Extensions>
</Application>
</Applications>
The tile doesn't seem to change irrespective of what i change the image to be.
Am i looking at the right place? Is there some other place where i need to change the tiles ?
I had to change the tile in the WMAppmanifest instead of the Packageappxmanifest.
Here's the sample,
<Tokens>
<PrimaryToken TokenID="Token1" TaskName="_default">
<TemplateType5>
<BackgroundImageURI IsRelative="true" IsResource="false">Images\Cloud_WP8_71x71.png</BackgroundImageURI>
<Count>0</Count>
<Title>Sample Cloud</Title>
</TemplateType5>
</PrimaryToken>
</Tokens>
Double Click on the Package.appxmanifest in the Solution Explorer of your project. It will load up a GUI for updating the App manifest rather than using the xml versions.
In the GUI representation there will be a 'Visual Assets' Tab at the top which will let you set each of the different tiles.
Here is a link to a video of how to use the Package.appmanifest file. It also talks about hwo to set the tiles of the app. http://channel9.msdn.com/Series/Windows-Phone-8-1-Development-for-Absolute-Beginners/Part-8-Working-with-the-package-appxmanifest
I am new to windows phone development and i will like to create a page with buttons similar to the windows phone main page.
Something like this http://cdn.marketplaceimages.windowsphone.com/v8/images/b60e325c-ac45-4d7d-bdf9-f83762c23c90?imageType=ws_screenshot_large&rotation=0
Can you please suggest how I can achieve this?
You can either use the Windows Phone Toolkit (free) or Telerik Rad Controls (not free)
Both of them have a "Hub Tile" Component that allows you to create "Live Tiles" like those inside your app.
I just upgraded my app to Windows 8.1, but now pages that I am loading into the WebView are no longer interactive. I can't press any buttons or fill out any HTML form fields. My WebView looks like this
<WebView x:Name="browser" ScrollViewer.ZoomMode="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled"></WebView>
I just created a new Windows Store app for Windows 8.1 based on the Blank App (XAML) template only putting the following line inside the Grid of MainPage.xaml:
<WebView x:Name="browser" ScrollViewer.ZoomMode="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" Source="http://www.quackit.com/html/codes/html_form_code.cfm" />
The HTML form controls behave as expected. Does this work for you? Do you have anything else on your page that could prevent interaction with HTML controls?
Maybe you have other (transparent) controls over the WebView. There's a change in z-ordering in Windows 8.1: in Windows 8 WebView was always rendered on top of other controls, now it can be rendered under other controls.
I just put the WebView with an Rectangle in a Grid and it seems that all the inputs are captured by the Rectangle:
<Grid>
<WebView Name="ContentWebView" ScrollViewer.ZoomMode="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollMode="Disabled"
DefaultBackgroundColor="Transparent" Height="Auto" MinHeight="600" />
<Rectangle Fill="Transparent"></Rectangle>
</Grid>
U should navigate webview or set source as explained above. Blank webview does not show anything
browser.navigate("http://example.com//");
Windows Phone 8 :
I have an HTML design to bind in webbrowser control.
In that HTML I need to set the image() dynamically from my windows 8 phone application itself (Eg:MyApp/Images/Done.png).
How to set this Image in my HTML dynamically?
Could any one help me on that?
In terms of Zen, WP8 tried to align Uris as close as possible to Win8 Uris. So whenever you ask yourself "How do WP8 Uris work?" a good starting point would be Win8 and WP7 behaved. For example, you'll see lots of "ms-appx:///" and "ms-appdata:///" all around WP8.
Specfically, In order to access an app's Image resources from a WebBrowser just specify the local file path.For example, start a new WP8 project and in MainPage.xaml add:
<phone:WebBrowser Source="myPage.html" />
And create myPage.html and add:
<html>
<body>
<img src="Assets/AlignmentGrid.png"/>
</body>
</html>
This would render the correct image as part of the WebBrowser. See attached .