The 7 Things I Know About Cyber Security After 25 Years | April 2024
Â
Iasi code camp 12 october 2013 adrian marinica - windows 8 and windows phone 8 two platforms, multiple experiences
1. Windows 8 and Windows Phone 8
two platforms, multiple experiences
Adrian-Petre MarinicÄ
âą adrian.marinic
@adrianmarinica
a@live.com
adrian.marinica@maxcode.ro
2. Agenda
ï¶ Setting the expectations
ï¶ Use Case
ï¶ The platforms
ï¶ Demo
ï¶ Goals
ï¶ The techy stuff
4. User expectations â What a good app should
1. Work fast
2. Be easy to understand & use
75%
74%
57%
3. Be well designed
Speed
Usability
Yes
Design
No
Data provided by http://www.uxbooth.com
6. Use Case â The request
ïŒ RSS reader with 5 IT related feeds.
ïŒ Enable / disable feeds.
ïŒ Ability to share application to friends.
ïŒ Available on both platforms, W8 &
WP8.
7. Use Case â The request
1 Windows 8 app
1 Windows Phone 8 app
8. Use Case â The goals
ïŒ Similar functionality
ïŒ Similar look & feel
ïŒ Proper User Experience
ïŒ Maximize code reuse
10. The platforms
Windows Phone 8
Windows 8
ïŒ One handed touch
ïŒ Guaranteed hardware
(camera, accelerometer, etc.)
ïŒ One column of content
ïŒ Vertical scroll
ïŒ Small app bar
ïŒ Hardware back button
ïŒ No semantic zoom
ïŒ One or two-handed touch, mouse
ïŒ No guarantee of any specific
hardware, must check at run time
ïŒ Multiple columns of content
ïŒ Horizontal scroll
ïŒ Larger app bar
ïŒ On-screen back button
ïŒ Semantic zoom
12. The platforms â App Development
ï¶ Windows 8 development
ï¶ C# XAML
ï¶ C++ XAML
ï¶ JavaScript HTML
ï¶ Windows Phone 8 development
ï¶ C# XAML
ï¶ C++ XAML (limited)
13. The platforms â XAML Development
ï¶ XAML = Extensible Application Markup Language
ï¶ Control-based UIâs
ï¶ XML type syntax
ï¶ MVVM to the max
16. Use Case â The request & the goals
ïŒ
ïŒ
ïŒ
ïŒ
RSS reader with IT related feeds.
Enable / disable feeds.
Ability to share application to friends.
Available on both platforms, W8 & WP8.
ïŒ
ïŒ
ïŒ
ïŒ
Similar functionality.
Similar look & feel.
Proper User Experience.
Maximize code reuse.
18. Maximize code reuse â The problem
ï¶ We want to be fast.
ï¶ We want to be efficient.
ï¶ We want to reuse code in both apps.
ï¶ Class libraries are not supported in W8 and WP8. ï
19. Maximize code reuse â The solution
"...for those people who are writing .NET and want
it to run on everything from Watches to Phones to
Tablets to Xboxen to Desktops to the Cloud, they
are enjoying what PCLs can offer."
Scott Hanselman
20. Portable Class Library (PCL)
ï¶ Library-type project in VisualStudio
ï¶ Used for building portable assemblies targeting multiple
platforms at the same time.
ï¶ Supports only a subset of features.
21. Portable Class Library (PCL) â Target frameworks
ï¶ .NET Framework
.NET4+ or .NET4.0.3+ or .NET4.5
ï¶ Silverlight
SL4+ or SL5
ï¶ Windows Phone
WP7+ or WP7.5+ or WP8
ï¶ .NET for Windows Store apps
ï¶ Xbox 360
22. Portable Class Library (PCL) â Features
Feature
.NET Framework
Windows
Store
Silverlight
Windows Phone
Xbox
360
Core
â
â
â
â
â
LINQ
â
â
â
â
IQueryable
â
â
â
7.5 and higher
Dynamic keyword
Only 4.5
â
â
Managed Extensibility Framework (MEF) â
â
â
Network Class Library (NCL)
â
â
â
â
Serialization
â
â
â
â
Windows Communication Foundation
(WCF)
â
â
â
â
Model-View-View Model (MVVM)
Only 4.5
â
â
â
Data annotations
Only 4.0.3 and 4.5 â
â
XLINQ
Only 4.0.3 and 4.5 â
â
System.Numerics
â
â
â
â
â
23. Portable Class Library (PCL) â MVVM
implementation
ï¶ MVVM Isolates the User
Interface from the
Business Logic.
ï¶ Model and ViewModel
implemented in a
Portable Class Library.
ï¶ Custom Views implemented separately in each project.
25. XAML Controls
ï¶ Mostly specific to platform.
ï¶ Cannot be reused in multiple projects.
ï¶ Can be reused in the same project.
ï¶ Similar syntax between the two platforms.
27. Classic RSS
reader
async Task<FeedData> GetAsync(string feedUri)
{
var client = new SyndicationClient();
var feedUri = new Uri(feedUriString);
var feed = await client.RetrieveFeedAsync(feedUri);
var articleList = new FeedData();
foreach (SyndicationItem item in feed.Items)
{
var article = ParseArticle(item);
articleList.Items.Add(feedItem);
}
return articleList;
}
28. PCL RSS reader
ï¶ Had to use HttpWebRequest ï
ï¶ Had to use an AsyncCallback ï
ï¶ Had to parse the XML manually ï
ï¶ Managed to make it work ï
35. Manage settings
Windows 8
ïŒ Added a UserControl
ïŒ Accessible through the
Settings charm
ïŒ Two-way data binding
Windows Phone 8
ïŒ Added a Page
ïŒ Accessible through the
ApplicationBar
ïŒ Two-way data binding
36. Manage settings
public ItemsPage() // constructor
{
SettingsPane.GetForCurrentView()
.CommandsRequested += SettingsReq;
}
void SettingsReq(SettingsPane sender, object args)
{
var handler = new UICommandInvokedHandler(ShowPanel);
var filter = new SettingsCommand("RSSFilter",
"Manage feeds",
handler);
args.Request.ApplicationCommands.Clear();
args.Request.ApplicationCommands.Add(filter);
}
41. Share application to friends - Solutions
ï¶ Windows 8
ïŒ Enable share in application
ïŒ Set application as share
source
ï¶ Windows Phone 8
ïŒ Create a share task
(email, link, status, SMS, etc.)
ïŒ Set message details and
launch
42. Share app
public ItemsPage() // the constructor
{
this.DataTransferManager
.GetForCurrentView()
.DataRequested += DataRequestedHandler;
}
void DataRequestedHandler(object sender, object args)
{
args.Request.Data.Properties.Title = "IT Feeder";
args.Request.Data.SetText("Go to the marketplace
and download IT Feeder. It's great!");
}
44. Share app
void ShareApp()
{
var smsTask = new SmsComposeTask();
smsTask.Body = "Go to the marketplace and
download IT Feeder.
It's great!";
smsTask.Show();
}
46. Summary
ï¶ Develop an app available on both platforms?
ïŒ
ïŒ
ïŒ
Doable: yes
Easy: not all the time
Limited: yes
ï¶ Offer similar experience on both platforms?
ïŒ
ïŒ
ïŒ
Doable: yes
Easy: yes
Limited: sometimes
Code
[VAL
UE]
[VAL
UE]
ï¶ Reuse code?
ïŒ
ïŒ
ïŒ
Doable: to some extent
Easy: yes
Limited: oh, yeah!
Not reused
Reused
47. Call for apps
We support you to become the winner.
Are you interested? Get in touch with us!
Contact us on: facebook.com/CodeCampRO
More info at: http://appcup.eu