SlideShare a Scribd company logo
Cross Platform Development with xamarin 
(ANDROID, WINDOWS PHONE , WINDOWS STORE APP) 
Prepared by 
CHEAH ENG SOON 
DEVELOPER 
CHEAH ENG SOON 17/9/2014
Agenda 
•Register and Setup Xamarin 
•Setup Android Library 
•Setup Android Emulator 
•Port Android to Windows Phone App 
•Port Android to Windows Store App 
•References 
CHEAH ENG SOON 17/9/2014
REGISTER & SETUP XAMARIN 
CHEAH ENG SOON 17/9/2014
Register and SETUP XAmarin 
1.Register XamarinAccount 
https://store.xamarin.com/account/register 
2. Download and Setup Xamarin 
http://xamarin.com/download 
CHEAH ENG SOON 17/9/2014
ReGISTERAND SETUP XAMARIN 
3. Login With XamarinAccount 
TOOLS > XamarinAccount 
CHEAH ENG SOON 17/9/2014
SETUP ANDROID LIBRARY 
CHEAH ENG SOON 17/9/2014
SETUP Android Library 
1. Click “Start Android SDK Manager” 
CHEAH ENG SOON 17/9/2014
2. Install All The Library 
[ / ] Select all library and install 
•Keep Calm and Wait the library install complete. 
CHEAH ENG SOON 17/9/2014
KEEP CALM & WAIT INSTALL COMPLETELY 
CHEAH ENG SOON 17/9/2014
SETUP ANDROID EMULATOR 
CHEAH ENG SOON 17/9/2014
SETUP ANDROID EMULATOR 
Click “Open Android Emulator Manager” > “Create…” 
CHEAH ENG SOON 17/9/2014
CHEAH ENG SOON 17/9/2014
Setup the Android Emulator as Below 
CHEAH ENG SOON 17/9/2014
Port Android to Windows Phone 
1.Create NEW PROJECT > Select “Windows Desktop” > Select “Class Library” > Name “Youtube” 
CHEAH ENG SOON 17/9/2014
CHEAH ENG SOON 17/9/2014
DOWNLOAD 
XamarinWorkshop Demo 
http://1drv.ms/1qVsGar 
CHEAH ENG SOON 17/9/2014
IMPORT ANDROID PROJECT 
CHEAH ENG SOON 17/9/2014
IMPORT ANDROID PROJECT 
2. Delete the “Class1.cs” and create the “YoutubeSearcher.cs” or Import the file “YoutubeSearcher.cs” 
Right click “Youtube(Portable)” > Add > Existing Items 
3. Import the “YouTube.Android” Project 
Right click “Solution ‘Youtube’ “ > “Add Existing Project” 
CHEAH ENG SOON 17/9/2014
CHEAH ENG SOON 17/9/2014
4. Right click “YouTube.Android” >Add > Existing Item > Select “ YouTubeSearcher.cs” in “Youtube(Portable)” > Add As Link 
CHEAH ENG SOON 17/9/2014
•You will seen a “YouTubeSearch.cs” . 
It means share the class 
CHEAH ENG SOON 17/9/2014
CHEAH ENG SOON 17/9/2014
PORT ANDROID TO WINDOWS PHONE CHEAH ENG SOON 17/9/2014
Port AnDroidTo Windows Phone App 
1.Right Click “Solution ‘YouTube’” > Add > New Project 
2.Select “Windows Phone Apps” > 
Select “Blank App (Windows Phone Silverlight” 
> Name “YouTube.WP8” 
CHEAH ENG SOON 17/9/2014
3. Select “Windows Phone 8.1” 
4. Right Click “YouTube.WP8” > Add > 
“Existing Item” 
5. Select “ YouTubeSearcher.cs” in “Youtube(Portable)” 
> Add As Link 
CHEAH ENG SOON 17/9/2014
6. Select “YouTube.WP8” > Right Click “Add” > Select “New Item” > Select “ Windows Phone Portrait Page” > Name “PlayVideo.xaml” 
7. Go “MainPage.xaml” & “PlayVideo.xaml” 
CHEAH ENG SOON 17/9/2014
MainPage.xaml 
<StackPanelOrientation="Horizontal" Grid.Row="0"> 
<TextBlockText="YouTube:" VerticalAlignment="Center" FontSize="20" Margin="10,20,0,10"></TextBlock> 
<TextBoxTextWrapping="Wrap" x:Name="txtKeyword" Text="" VerticalAlignment="Center" FontSize="20" Width="240" Margin="0,10,0,0"/> 
<Button Content="Search" VerticalAlignment="Center" x:Name="btnSearch" HorizontalAlignment="Stretch" FontSize="20" Margin="0,20,0,10" Height="72" Width="134" Click="btnSearch_Click"/> 
</StackPanel> 
CHEAH ENG SOON 17/9/2014
<phone:LongListSelector 
x:Name="VideoList" Grid.Row="1" Height="640" 
ScrollViewer.VerticalScrollBarVisibility="Auto" 
SelectionChanged="VideoList_SelectionChanged"> 
<phone:LongListSelector.ItemTemplate> 
<DataTemplate> 
<StackPanelOrientation="Horizontal"> 
<Image Width="100" Height="100" Source="{Binding Thumbnail}" /> 
<StackPanelOrientation="Vertical" Margin="5,0"> 
<TextBlockText="{Binding Title}" TextWrapping="Wrap" /> 
<TextBlockText="{Binding PubDate}" Foreground="Gray"/> 
</StackPanel> 
</StackPanel> 
</DataTemplate> 
</phone:LongListSelector.ItemTemplate> 
</phone:LongListSelector> 
CHEAH ENG SOON 17/9/2014
MainPage.CS 
private void btnSearch_Click(object sender, RoutedEventArgse) 
{ 
varsearcher = new YouTubeSearcher(); 
searcher.list= this.VideoList; 
searcher.SearchForWP8(this.txtKeyword.Text); 
} 
CHEAH ENG SOON 17/9/2014
private void VideoList_SelectionChanged(object sender, SelectionChangedEventArgse) 
{ 
if (VideoList.SelectedItem!= null) 
{ 
vartitle = (VideoList.SelectedItemas Entry).Title; 
varlink = (VideoList.SelectedItemas Entry).Link; 
NavigationService.Navigate(new Uri(string.Format("/PlayVideo.xaml?Title={0}&Link={1}", title, link), UriKind.Relative)); 
} 
} 
CHEAH ENG SOON 17/9/2014
PlayVideo.xaml 
<Grid x:Name="LayoutRoot" Background="Transparent"> 
<StackPanelOrientation="Vertical"> 
<StackPanelOrientation="Horizontal"> 
<TextBlockx:Name="txtTitle" FontSize="20" HorizontalAlignment="Center" Margin="20,40,0,20"></TextBlock> 
</StackPanel> 
<phone:WebBrowserx:Name="webview" Grid.Row="1" Width="480" Height="320" Margin="0,0,0,0" HorizontalAlignment="Center"></phone:WebBrowser> 
</StackPanel> 
</Grid> 
CHEAH ENG SOON 17/9/2014
PlayVideo.cs 
protected override void OnNavigatedTo(NavigationEventArgse) 
{ 
base.OnNavigatedTo(e); 
string title, link; 
NavigationContext.QueryString.TryGetValue("Title", out title); 
NavigationContext.QueryString.TryGetValue("Link", out link); 
this.txtTitle.Text= title; 
this.webview.IsScriptEnabled= true; 
this.webview.Navigate(new Uri(link)); 
} 
CHEAH ENG SOON 17/9/2014
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgse) 
{ 
base.OnBackKeyPress(e); 
this.webview.NavigateToString(""); 
} 
CHEAH ENG SOON 17/9/2014
CHEAH ENG SOON 17/9/2014
PORT ANDROID TO WINDOWS STORE APP 
CHEAH ENG SOON 17/9/2014
PORT ANDROID TO WINDOWS STORE 
1.Right Click “Solution ‘YouTube’” > Add > New Project 
2.Select “Windows APPS” >Select “BLANK App (WINDOWS)”> Name “YouTube.RT” 
3.RIGHT Click “YouTube.RT” > Add >“Existing Item” 
4.Select “ YouTubeSearcher.cs” in “Youtube(Portable)” > Add As Link 
5.Add “Playvideo.xaml” 
CHEAH ENG SOON 17/9/2014
MainPage.xaml 
<Grid.RowDefinitions> 
<RowDefinitionHeight="Auto" /> 
<RowDefinitionHeight="Auto" /> 
</Grid.RowDefinitions> 
<StackPanelOrientation="Horizontal" Grid.Row="0"> 
<TextBlockText="YouTube Search:" FontSize="20" Margin="10,20,0,0"></TextBlock> 
<TextBoxTextWrapping="Wrap" VerticalAlignment="Center" FontSize="20" x:Name="txtKeyword" Text="" Height="40" Width="364" Margin="10,10,0,10"/> 
<Button Content="Search" x:Name="btnSearch" HorizontalAlignment="Stretch" FontSize="20" Margin="10,0,0,10" VerticalAlignment="Bottom" Height="42" Width="109" Click="btnSearch_Click"/> 
</StackPanel> 
CHEAH ENG SOON 17/9/2014
<ListViewx:Name="VideoList" Grid.Row="1" Height="640" 
ScrollViewer.VerticalScrollBarVisibility="Auto" 
SelectionMode="None" 
IsItemClickEnabled="True" 
ItemClick="VideoList_ItemClick"> 
<ListView.ItemTemplate> 
<DataTemplate> 
<StackPanelOrientation="Horizontal"> 
<Image Width="75" Height="75" Source="{Binding Thumbnail}" /> 
<StackPanelOrientation="Vertical" Margin="5,0"> 
<TextBlockText="{Binding Title}" TextWrapping="Wrap" /> 
<TextBlockText="{Binding Link}" TextWrapping="Wrap" /> 
<TextBlockText="{Binding PubDate}" Foreground="Gray"/> 
</StackPanel> 
</StackPanel> 
</DataTemplate> 
</ListView.ItemTemplate> 
</ListView> 
CHEAH ENG SOON 17/9/2014
MainPage.cs 
List<Entry> SearchResult; 
public MainPage() 
{ 
this.InitializeComponent(); 
this.NavigationCacheMode= Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled; 
} 
CHEAH ENG SOON 17/9/2014
private void btnSearch_Click(object sender, RoutedEventArgse) 
{ 
YouTubeSearchersearcher = new YouTubeSearcher(); 
SearchResult= searcher.Search(this.txtKeyword.Text); 
this.VideoList.ItemsSource= SearchResult; 
} 
private void VideoList_ItemClick(object sender, ItemClickEventArgse) 
{ 
Frame.Navigate(typeof(PlayVideo), e.ClickedItemas Entry); 
} 
CHEAH ENG SOON 17/9/2014
CHEAH ENG SOON 17/9/2014
PlayVideo.xaml(BLANK PAGE) 
<StackPanelOrientation="Vertical"> 
<StackPanelOrientation="Horizontal"> 
<Button HorizontalAlignment="Left" Tapped="OnBackButtonTapped"/> 
<TextBlockGrid.Row="0" x:Name="txtTitle" FontSize="20" HorizontalAlignment="Center" Margin="20,40,0,20"></TextBlock> 
</StackPanel> 
<WebViewx:Name="webview" Grid.Row="1" Width="480" Height="320" Margin="0,0,0,0" HorizontalAlignment="Center" ></WebView> 
</StackPanel> 
CHEAH ENG SOON 17/9/2014
protected override void OnNavigatedTo(NavigationEventArgse) 
{ 
varp = (Entry)e.Parameter; 
this.txtTitle.Text= p.Title; 
this.webview.Navigate(new Uri(p.Link)); 
} 
private void OnBackButtonTapped(object sender, TappedRoutedEventArgse) 
{ 
if (Frame.CanGoBack) 
{ 
this.webview.NavigateToString(""); 
Frame.GoBack(); 
} 
} 
CHEAH ENG SOON 17/9/2014
CHEAH ENG SOON 17/9/2014
Full SOURCE CODE 
XamarinWorkshop Demo 
http://1drv.ms/1qVsGar 
CHEAH ENG SOON 17/9/2014
References 
Cross Platform Development With Xamarin 
http://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Cross-Platform- Development-With-Xamarin 
Documentation 
http://developer.xamarin.com/guides 
Contact 
cheahengsoon@live.com.my 
cheahengsoon.weebly.com 
CHEAH ENG SOON 17/9/2014

More Related Content

Viewers also liked

What the Watchdogs Are Watching
What the Watchdogs Are WatchingWhat the Watchdogs Are Watching
What the Watchdogs Are Watching
Tate Tryon CPAs
 
Power point baru
Power point baruPower point baru
Power point baruainiazza
 
Trakya universitesi-anlatimi
Trakya universitesi-anlatimiTrakya universitesi-anlatimi
Trakya universitesi-anlatimizeynep_zyn85
 
BF+H Store Brands '12
BF+H Store Brands '12BF+H Store Brands '12
BF+H Store Brands '12
Brandversations
 
พรบ.คอมพิวเตอร์
พรบ.คอมพิวเตอร์พรบ.คอมพิวเตอร์
พรบ.คอมพิวเตอร์
Angkana Potha
 
Scoop módulo 4 aiskel andrade
Scoop módulo 4 aiskel andradeScoop módulo 4 aiskel andrade
Scoop módulo 4 aiskel andrade
Aiskel Naitari Andrade Suarez
 
Teerut Petsungwan_Resume
Teerut Petsungwan_ResumeTeerut Petsungwan_Resume
Teerut Petsungwan_Resume
Teerut Petsungwan
 
Virgin Media Profile
Virgin Media ProfileVirgin Media Profile
Virgin Media Profile
Aaron Heffernan
 
Get to know me!
Get to know me!Get to know me!
Get to know me!
Pedro Aguirre
 
Sommerkampanje for Nærbutikken
Sommerkampanje for NærbutikkenSommerkampanje for Nærbutikken
Sommerkampanje for Nærbutikken
lisembj
 
best physical theraphist in Houston
best physical theraphist in Houstonbest physical theraphist in Houston
best physical theraphist in Houston
nicholson557
 
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motorAdafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Stefan Oprea
 
Walking Festival Kingston upon Thames 2016 Programme
Walking Festival Kingston upon Thames 2016 ProgrammeWalking Festival Kingston upon Thames 2016 Programme
Walking Festival Kingston upon Thames 2016 Programme
KingstonVA
 
MAD Global activities
MAD Global activitiesMAD Global activities
MAD Global activities
Pedro Aguirre
 
Slide bhs
Slide bhsSlide bhs
Slide bhs
Norsabrina Japar
 
Weight Loss Tips
Weight Loss TipsWeight Loss Tips
Weight Loss Tips
farrahcollins
 

Viewers also liked (16)

What the Watchdogs Are Watching
What the Watchdogs Are WatchingWhat the Watchdogs Are Watching
What the Watchdogs Are Watching
 
Power point baru
Power point baruPower point baru
Power point baru
 
Trakya universitesi-anlatimi
Trakya universitesi-anlatimiTrakya universitesi-anlatimi
Trakya universitesi-anlatimi
 
BF+H Store Brands '12
BF+H Store Brands '12BF+H Store Brands '12
BF+H Store Brands '12
 
พรบ.คอมพิวเตอร์
พรบ.คอมพิวเตอร์พรบ.คอมพิวเตอร์
พรบ.คอมพิวเตอร์
 
Scoop módulo 4 aiskel andrade
Scoop módulo 4 aiskel andradeScoop módulo 4 aiskel andrade
Scoop módulo 4 aiskel andrade
 
Teerut Petsungwan_Resume
Teerut Petsungwan_ResumeTeerut Petsungwan_Resume
Teerut Petsungwan_Resume
 
Virgin Media Profile
Virgin Media ProfileVirgin Media Profile
Virgin Media Profile
 
Get to know me!
Get to know me!Get to know me!
Get to know me!
 
Sommerkampanje for Nærbutikken
Sommerkampanje for NærbutikkenSommerkampanje for Nærbutikken
Sommerkampanje for Nærbutikken
 
best physical theraphist in Houston
best physical theraphist in Houstonbest physical theraphist in Houston
best physical theraphist in Houston
 
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motorAdafruit raspberry-pi-lesson-9-controlling-a-dc-motor
Adafruit raspberry-pi-lesson-9-controlling-a-dc-motor
 
Walking Festival Kingston upon Thames 2016 Programme
Walking Festival Kingston upon Thames 2016 ProgrammeWalking Festival Kingston upon Thames 2016 Programme
Walking Festival Kingston upon Thames 2016 Programme
 
MAD Global activities
MAD Global activitiesMAD Global activities
MAD Global activities
 
Slide bhs
Slide bhsSlide bhs
Slide bhs
 
Weight Loss Tips
Weight Loss TipsWeight Loss Tips
Weight Loss Tips
 

Similar to Port Android To Windows App

Building iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360FlexBuilding iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360Flex
danielwanja
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
Junda Ong
 
Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011
Patrick Lauke
 
Building WebApp with HTML5
Building WebApp with HTML5Building WebApp with HTML5
Building WebApp with HTML5
Tien Tran Le Duy
 
Html5 - short intro
Html5 - short introHtml5 - short intro
Html5 - short intro
jeiseman
 
JavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the PlatformJavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the Platform
Robert Nyman
 
Leave No One Behind with HTML5 - FFWD.PRO, Croatia
Leave No One Behind with HTML5 - FFWD.PRO, CroatiaLeave No One Behind with HTML5 - FFWD.PRO, Croatia
Leave No One Behind with HTML5 - FFWD.PRO, Croatia
Robert Nyman
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming En
guest9bcef2f
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
Davide Cerbo
 
Google I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsGoogle I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb Highlights
Romain Guy
 
20150812 4시간만에 따라해보는 windows 10 앱 개발
20150812  4시간만에 따라해보는 windows 10 앱 개발20150812  4시간만에 따라해보는 windows 10 앱 개발
20150812 4시간만에 따라해보는 windows 10 앱 개발
영욱 김
 
Hybrid app
Hybrid appHybrid app
Hybrid app
hyun soomyung
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
Marc Grabanski
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
Marcelio Leal
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
Kevin DeRudder
 
Sperimentazioni lezione6 from_designtoapplication copy
Sperimentazioni lezione6 from_designtoapplication copySperimentazioni lezione6 from_designtoapplication copy
Sperimentazioni lezione6 from_designtoapplication copy
Salvatore Iaconesi
 
Building windows8 modern app for sp2013
Building windows8 modern app for sp2013Building windows8 modern app for sp2013
Building windows8 modern app for sp2013
Vinh Nguyen
 
Infinum Android Talks #16 - App Links by Ana Baotic
Infinum Android Talks #16 - App Links by Ana BaoticInfinum Android Talks #16 - App Links by Ana Baotic
Infinum Android Talks #16 - App Links by Ana Baotic
Infinum
 
The Devil and HTML5
The Devil and HTML5The Devil and HTML5
The Devil and HTML5
Myles Braithwaite
 
.Net Dev Summit 2020 - What's new and next for Xamarin developers
.Net Dev Summit 2020 - What's new and next for Xamarin developers.Net Dev Summit 2020 - What's new and next for Xamarin developers
.Net Dev Summit 2020 - What's new and next for Xamarin developers
James Montemagno
 

Similar to Port Android To Windows App (20)

Building iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360FlexBuilding iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360Flex
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011
 
Building WebApp with HTML5
Building WebApp with HTML5Building WebApp with HTML5
Building WebApp with HTML5
 
Html5 - short intro
Html5 - short introHtml5 - short intro
Html5 - short intro
 
JavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the PlatformJavaScript APIs - The Web is the Platform
JavaScript APIs - The Web is the Platform
 
Leave No One Behind with HTML5 - FFWD.PRO, Croatia
Leave No One Behind with HTML5 - FFWD.PRO, CroatiaLeave No One Behind with HTML5 - FFWD.PRO, Croatia
Leave No One Behind with HTML5 - FFWD.PRO, Croatia
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming En
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
 
Google I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsGoogle I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb Highlights
 
20150812 4시간만에 따라해보는 windows 10 앱 개발
20150812  4시간만에 따라해보는 windows 10 앱 개발20150812  4시간만에 따라해보는 windows 10 앱 개발
20150812 4시간만에 따라해보는 windows 10 앱 개발
 
Hybrid app
Hybrid appHybrid app
Hybrid app
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
 
Sperimentazioni lezione6 from_designtoapplication copy
Sperimentazioni lezione6 from_designtoapplication copySperimentazioni lezione6 from_designtoapplication copy
Sperimentazioni lezione6 from_designtoapplication copy
 
Building windows8 modern app for sp2013
Building windows8 modern app for sp2013Building windows8 modern app for sp2013
Building windows8 modern app for sp2013
 
Infinum Android Talks #16 - App Links by Ana Baotic
Infinum Android Talks #16 - App Links by Ana BaoticInfinum Android Talks #16 - App Links by Ana Baotic
Infinum Android Talks #16 - App Links by Ana Baotic
 
The Devil and HTML5
The Devil and HTML5The Devil and HTML5
The Devil and HTML5
 
.Net Dev Summit 2020 - What's new and next for Xamarin developers
.Net Dev Summit 2020 - What's new and next for Xamarin developers.Net Dev Summit 2020 - What's new and next for Xamarin developers
.Net Dev Summit 2020 - What's new and next for Xamarin developers
 

More from Cheah Eng Soon

Microsoft Defender for Endpoint
Microsoft Defender for EndpointMicrosoft Defender for Endpoint
Microsoft Defender for Endpoint
Cheah Eng Soon
 
Azure Active Directory - Secure and Govern
Azure Active Directory - Secure and GovernAzure Active Directory - Secure and Govern
Azure Active Directory - Secure and Govern
Cheah Eng Soon
 
Microsoft Zero Trust
Microsoft Zero TrustMicrosoft Zero Trust
Microsoft Zero Trust
Cheah Eng Soon
 
MEM for OnPrem Environments
MEM for OnPrem EnvironmentsMEM for OnPrem Environments
MEM for OnPrem Environments
Cheah Eng Soon
 
Microsoft Threat Protection Automated Incident Response
Microsoft Threat Protection Automated Incident Response Microsoft Threat Protection Automated Incident Response
Microsoft Threat Protection Automated Incident Response
Cheah Eng Soon
 
Azure Penetration Testing
Azure Penetration TestingAzure Penetration Testing
Azure Penetration Testing
Cheah Eng Soon
 
Azure Penetration Testing
Azure Penetration TestingAzure Penetration Testing
Azure Penetration Testing
Cheah Eng Soon
 
Penetration Testing Azure for Ethical Hackers
Penetration Testing Azure for Ethical HackersPenetration Testing Azure for Ethical Hackers
Penetration Testing Azure for Ethical Hackers
Cheah Eng Soon
 
Microsoft Threat Protection Automated Incident Response Demo
Microsoft Threat Protection Automated Incident Response DemoMicrosoft Threat Protection Automated Incident Response Demo
Microsoft Threat Protection Automated Incident Response Demo
Cheah Eng Soon
 
Microsoft Secure Score Demo
Microsoft Secure Score DemoMicrosoft Secure Score Demo
Microsoft Secure Score Demo
Cheah Eng Soon
 
Microsoft Cloud App Security Demo
Microsoft Cloud App Security DemoMicrosoft Cloud App Security Demo
Microsoft Cloud App Security Demo
Cheah Eng Soon
 
M365 Attack Simulation Demo
M365 Attack Simulation DemoM365 Attack Simulation Demo
M365 Attack Simulation Demo
Cheah Eng Soon
 
Cloud Security Demo
Cloud Security DemoCloud Security Demo
Cloud Security Demo
Cheah Eng Soon
 
Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo
Cheah Eng Soon
 
Azure WAF
Azure WAFAzure WAF
Azure WAF
Cheah Eng Soon
 
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Azure Weekend 2020 Build Malaysia Bus Uncle ChatbotAzure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Cheah Eng Soon
 
Microsoft Azure的20大常见安全漏洞与配置错误
Microsoft Azure的20大常见安全漏洞与配置错误Microsoft Azure的20大常见安全漏洞与配置错误
Microsoft Azure的20大常见安全漏洞与配置错误
Cheah Eng Soon
 
20 common security vulnerabilities and misconfiguration in Azure
20 common security vulnerabilities and misconfiguration in Azure20 common security vulnerabilities and misconfiguration in Azure
20 common security vulnerabilities and misconfiguration in Azure
Cheah Eng Soon
 
Integrate Microsoft Graph with Azure Bot Services
Integrate Microsoft Graph with Azure Bot ServicesIntegrate Microsoft Graph with Azure Bot Services
Integrate Microsoft Graph with Azure Bot Services
Cheah Eng Soon
 
Azure Sentinel with Office 365
Azure Sentinel with Office 365Azure Sentinel with Office 365
Azure Sentinel with Office 365
Cheah Eng Soon
 

More from Cheah Eng Soon (20)

Microsoft Defender for Endpoint
Microsoft Defender for EndpointMicrosoft Defender for Endpoint
Microsoft Defender for Endpoint
 
Azure Active Directory - Secure and Govern
Azure Active Directory - Secure and GovernAzure Active Directory - Secure and Govern
Azure Active Directory - Secure and Govern
 
Microsoft Zero Trust
Microsoft Zero TrustMicrosoft Zero Trust
Microsoft Zero Trust
 
MEM for OnPrem Environments
MEM for OnPrem EnvironmentsMEM for OnPrem Environments
MEM for OnPrem Environments
 
Microsoft Threat Protection Automated Incident Response
Microsoft Threat Protection Automated Incident Response Microsoft Threat Protection Automated Incident Response
Microsoft Threat Protection Automated Incident Response
 
Azure Penetration Testing
Azure Penetration TestingAzure Penetration Testing
Azure Penetration Testing
 
Azure Penetration Testing
Azure Penetration TestingAzure Penetration Testing
Azure Penetration Testing
 
Penetration Testing Azure for Ethical Hackers
Penetration Testing Azure for Ethical HackersPenetration Testing Azure for Ethical Hackers
Penetration Testing Azure for Ethical Hackers
 
Microsoft Threat Protection Automated Incident Response Demo
Microsoft Threat Protection Automated Incident Response DemoMicrosoft Threat Protection Automated Incident Response Demo
Microsoft Threat Protection Automated Incident Response Demo
 
Microsoft Secure Score Demo
Microsoft Secure Score DemoMicrosoft Secure Score Demo
Microsoft Secure Score Demo
 
Microsoft Cloud App Security Demo
Microsoft Cloud App Security DemoMicrosoft Cloud App Security Demo
Microsoft Cloud App Security Demo
 
M365 Attack Simulation Demo
M365 Attack Simulation DemoM365 Attack Simulation Demo
M365 Attack Simulation Demo
 
Cloud Security Demo
Cloud Security DemoCloud Security Demo
Cloud Security Demo
 
Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo
 
Azure WAF
Azure WAFAzure WAF
Azure WAF
 
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Azure Weekend 2020 Build Malaysia Bus Uncle ChatbotAzure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
 
Microsoft Azure的20大常见安全漏洞与配置错误
Microsoft Azure的20大常见安全漏洞与配置错误Microsoft Azure的20大常见安全漏洞与配置错误
Microsoft Azure的20大常见安全漏洞与配置错误
 
20 common security vulnerabilities and misconfiguration in Azure
20 common security vulnerabilities and misconfiguration in Azure20 common security vulnerabilities and misconfiguration in Azure
20 common security vulnerabilities and misconfiguration in Azure
 
Integrate Microsoft Graph with Azure Bot Services
Integrate Microsoft Graph with Azure Bot ServicesIntegrate Microsoft Graph with Azure Bot Services
Integrate Microsoft Graph with Azure Bot Services
 
Azure Sentinel with Office 365
Azure Sentinel with Office 365Azure Sentinel with Office 365
Azure Sentinel with Office 365
 

Recently uploaded

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 

Recently uploaded (20)

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 

Port Android To Windows App

  • 1. Cross Platform Development with xamarin (ANDROID, WINDOWS PHONE , WINDOWS STORE APP) Prepared by CHEAH ENG SOON DEVELOPER CHEAH ENG SOON 17/9/2014
  • 2. Agenda •Register and Setup Xamarin •Setup Android Library •Setup Android Emulator •Port Android to Windows Phone App •Port Android to Windows Store App •References CHEAH ENG SOON 17/9/2014
  • 3. REGISTER & SETUP XAMARIN CHEAH ENG SOON 17/9/2014
  • 4. Register and SETUP XAmarin 1.Register XamarinAccount https://store.xamarin.com/account/register 2. Download and Setup Xamarin http://xamarin.com/download CHEAH ENG SOON 17/9/2014
  • 5. ReGISTERAND SETUP XAMARIN 3. Login With XamarinAccount TOOLS > XamarinAccount CHEAH ENG SOON 17/9/2014
  • 6. SETUP ANDROID LIBRARY CHEAH ENG SOON 17/9/2014
  • 7. SETUP Android Library 1. Click “Start Android SDK Manager” CHEAH ENG SOON 17/9/2014
  • 8. 2. Install All The Library [ / ] Select all library and install •Keep Calm and Wait the library install complete. CHEAH ENG SOON 17/9/2014
  • 9. KEEP CALM & WAIT INSTALL COMPLETELY CHEAH ENG SOON 17/9/2014
  • 10. SETUP ANDROID EMULATOR CHEAH ENG SOON 17/9/2014
  • 11. SETUP ANDROID EMULATOR Click “Open Android Emulator Manager” > “Create…” CHEAH ENG SOON 17/9/2014
  • 12. CHEAH ENG SOON 17/9/2014
  • 13. Setup the Android Emulator as Below CHEAH ENG SOON 17/9/2014
  • 14. Port Android to Windows Phone 1.Create NEW PROJECT > Select “Windows Desktop” > Select “Class Library” > Name “Youtube” CHEAH ENG SOON 17/9/2014
  • 15. CHEAH ENG SOON 17/9/2014
  • 16. DOWNLOAD XamarinWorkshop Demo http://1drv.ms/1qVsGar CHEAH ENG SOON 17/9/2014
  • 17. IMPORT ANDROID PROJECT CHEAH ENG SOON 17/9/2014
  • 18. IMPORT ANDROID PROJECT 2. Delete the “Class1.cs” and create the “YoutubeSearcher.cs” or Import the file “YoutubeSearcher.cs” Right click “Youtube(Portable)” > Add > Existing Items 3. Import the “YouTube.Android” Project Right click “Solution ‘Youtube’ “ > “Add Existing Project” CHEAH ENG SOON 17/9/2014
  • 19. CHEAH ENG SOON 17/9/2014
  • 20. 4. Right click “YouTube.Android” >Add > Existing Item > Select “ YouTubeSearcher.cs” in “Youtube(Portable)” > Add As Link CHEAH ENG SOON 17/9/2014
  • 21. •You will seen a “YouTubeSearch.cs” . It means share the class CHEAH ENG SOON 17/9/2014
  • 22. CHEAH ENG SOON 17/9/2014
  • 23. PORT ANDROID TO WINDOWS PHONE CHEAH ENG SOON 17/9/2014
  • 24. Port AnDroidTo Windows Phone App 1.Right Click “Solution ‘YouTube’” > Add > New Project 2.Select “Windows Phone Apps” > Select “Blank App (Windows Phone Silverlight” > Name “YouTube.WP8” CHEAH ENG SOON 17/9/2014
  • 25. 3. Select “Windows Phone 8.1” 4. Right Click “YouTube.WP8” > Add > “Existing Item” 5. Select “ YouTubeSearcher.cs” in “Youtube(Portable)” > Add As Link CHEAH ENG SOON 17/9/2014
  • 26. 6. Select “YouTube.WP8” > Right Click “Add” > Select “New Item” > Select “ Windows Phone Portrait Page” > Name “PlayVideo.xaml” 7. Go “MainPage.xaml” & “PlayVideo.xaml” CHEAH ENG SOON 17/9/2014
  • 27. MainPage.xaml <StackPanelOrientation="Horizontal" Grid.Row="0"> <TextBlockText="YouTube:" VerticalAlignment="Center" FontSize="20" Margin="10,20,0,10"></TextBlock> <TextBoxTextWrapping="Wrap" x:Name="txtKeyword" Text="" VerticalAlignment="Center" FontSize="20" Width="240" Margin="0,10,0,0"/> <Button Content="Search" VerticalAlignment="Center" x:Name="btnSearch" HorizontalAlignment="Stretch" FontSize="20" Margin="0,20,0,10" Height="72" Width="134" Click="btnSearch_Click"/> </StackPanel> CHEAH ENG SOON 17/9/2014
  • 28. <phone:LongListSelector x:Name="VideoList" Grid.Row="1" Height="640" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionChanged="VideoList_SelectionChanged"> <phone:LongListSelector.ItemTemplate> <DataTemplate> <StackPanelOrientation="Horizontal"> <Image Width="100" Height="100" Source="{Binding Thumbnail}" /> <StackPanelOrientation="Vertical" Margin="5,0"> <TextBlockText="{Binding Title}" TextWrapping="Wrap" /> <TextBlockText="{Binding PubDate}" Foreground="Gray"/> </StackPanel> </StackPanel> </DataTemplate> </phone:LongListSelector.ItemTemplate> </phone:LongListSelector> CHEAH ENG SOON 17/9/2014
  • 29. MainPage.CS private void btnSearch_Click(object sender, RoutedEventArgse) { varsearcher = new YouTubeSearcher(); searcher.list= this.VideoList; searcher.SearchForWP8(this.txtKeyword.Text); } CHEAH ENG SOON 17/9/2014
  • 30. private void VideoList_SelectionChanged(object sender, SelectionChangedEventArgse) { if (VideoList.SelectedItem!= null) { vartitle = (VideoList.SelectedItemas Entry).Title; varlink = (VideoList.SelectedItemas Entry).Link; NavigationService.Navigate(new Uri(string.Format("/PlayVideo.xaml?Title={0}&Link={1}", title, link), UriKind.Relative)); } } CHEAH ENG SOON 17/9/2014
  • 31. PlayVideo.xaml <Grid x:Name="LayoutRoot" Background="Transparent"> <StackPanelOrientation="Vertical"> <StackPanelOrientation="Horizontal"> <TextBlockx:Name="txtTitle" FontSize="20" HorizontalAlignment="Center" Margin="20,40,0,20"></TextBlock> </StackPanel> <phone:WebBrowserx:Name="webview" Grid.Row="1" Width="480" Height="320" Margin="0,0,0,0" HorizontalAlignment="Center"></phone:WebBrowser> </StackPanel> </Grid> CHEAH ENG SOON 17/9/2014
  • 32. PlayVideo.cs protected override void OnNavigatedTo(NavigationEventArgse) { base.OnNavigatedTo(e); string title, link; NavigationContext.QueryString.TryGetValue("Title", out title); NavigationContext.QueryString.TryGetValue("Link", out link); this.txtTitle.Text= title; this.webview.IsScriptEnabled= true; this.webview.Navigate(new Uri(link)); } CHEAH ENG SOON 17/9/2014
  • 33. protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgse) { base.OnBackKeyPress(e); this.webview.NavigateToString(""); } CHEAH ENG SOON 17/9/2014
  • 34. CHEAH ENG SOON 17/9/2014
  • 35. PORT ANDROID TO WINDOWS STORE APP CHEAH ENG SOON 17/9/2014
  • 36. PORT ANDROID TO WINDOWS STORE 1.Right Click “Solution ‘YouTube’” > Add > New Project 2.Select “Windows APPS” >Select “BLANK App (WINDOWS)”> Name “YouTube.RT” 3.RIGHT Click “YouTube.RT” > Add >“Existing Item” 4.Select “ YouTubeSearcher.cs” in “Youtube(Portable)” > Add As Link 5.Add “Playvideo.xaml” CHEAH ENG SOON 17/9/2014
  • 37. MainPage.xaml <Grid.RowDefinitions> <RowDefinitionHeight="Auto" /> <RowDefinitionHeight="Auto" /> </Grid.RowDefinitions> <StackPanelOrientation="Horizontal" Grid.Row="0"> <TextBlockText="YouTube Search:" FontSize="20" Margin="10,20,0,0"></TextBlock> <TextBoxTextWrapping="Wrap" VerticalAlignment="Center" FontSize="20" x:Name="txtKeyword" Text="" Height="40" Width="364" Margin="10,10,0,10"/> <Button Content="Search" x:Name="btnSearch" HorizontalAlignment="Stretch" FontSize="20" Margin="10,0,0,10" VerticalAlignment="Bottom" Height="42" Width="109" Click="btnSearch_Click"/> </StackPanel> CHEAH ENG SOON 17/9/2014
  • 38. <ListViewx:Name="VideoList" Grid.Row="1" Height="640" ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionMode="None" IsItemClickEnabled="True" ItemClick="VideoList_ItemClick"> <ListView.ItemTemplate> <DataTemplate> <StackPanelOrientation="Horizontal"> <Image Width="75" Height="75" Source="{Binding Thumbnail}" /> <StackPanelOrientation="Vertical" Margin="5,0"> <TextBlockText="{Binding Title}" TextWrapping="Wrap" /> <TextBlockText="{Binding Link}" TextWrapping="Wrap" /> <TextBlockText="{Binding PubDate}" Foreground="Gray"/> </StackPanel> </StackPanel> </DataTemplate> </ListView.ItemTemplate> </ListView> CHEAH ENG SOON 17/9/2014
  • 39. MainPage.cs List<Entry> SearchResult; public MainPage() { this.InitializeComponent(); this.NavigationCacheMode= Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled; } CHEAH ENG SOON 17/9/2014
  • 40. private void btnSearch_Click(object sender, RoutedEventArgse) { YouTubeSearchersearcher = new YouTubeSearcher(); SearchResult= searcher.Search(this.txtKeyword.Text); this.VideoList.ItemsSource= SearchResult; } private void VideoList_ItemClick(object sender, ItemClickEventArgse) { Frame.Navigate(typeof(PlayVideo), e.ClickedItemas Entry); } CHEAH ENG SOON 17/9/2014
  • 41. CHEAH ENG SOON 17/9/2014
  • 42. PlayVideo.xaml(BLANK PAGE) <StackPanelOrientation="Vertical"> <StackPanelOrientation="Horizontal"> <Button HorizontalAlignment="Left" Tapped="OnBackButtonTapped"/> <TextBlockGrid.Row="0" x:Name="txtTitle" FontSize="20" HorizontalAlignment="Center" Margin="20,40,0,20"></TextBlock> </StackPanel> <WebViewx:Name="webview" Grid.Row="1" Width="480" Height="320" Margin="0,0,0,0" HorizontalAlignment="Center" ></WebView> </StackPanel> CHEAH ENG SOON 17/9/2014
  • 43. protected override void OnNavigatedTo(NavigationEventArgse) { varp = (Entry)e.Parameter; this.txtTitle.Text= p.Title; this.webview.Navigate(new Uri(p.Link)); } private void OnBackButtonTapped(object sender, TappedRoutedEventArgse) { if (Frame.CanGoBack) { this.webview.NavigateToString(""); Frame.GoBack(); } } CHEAH ENG SOON 17/9/2014
  • 44. CHEAH ENG SOON 17/9/2014
  • 45. Full SOURCE CODE XamarinWorkshop Demo http://1drv.ms/1qVsGar CHEAH ENG SOON 17/9/2014
  • 46. References Cross Platform Development With Xamarin http://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Cross-Platform- Development-With-Xamarin Documentation http://developer.xamarin.com/guides Contact cheahengsoon@live.com.my cheahengsoon.weebly.com CHEAH ENG SOON 17/9/2014