jQueryMobile
Implementing jQueryMobile in .NET Framework v2.0
Create a new MVC 2.0 project
Modify the Views\Shared\Site.master file to include the following header includes:
<link
rel=”stylesheet” href=”http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css”
/>
<script
type=”text/javascript” src=”http://code.jquery.com/jquery-1.6.1.min.js”></script>
<script
type=”text/javascript” src=”http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js”></script>
Modify the div footer with the following markup:
<div
data-role=”footer” id=”footer” data-theme=”a”>
<h4>Page Footer</h4>
</div>
QR code
Generated at http://goqr.me/
MVC steps to create a new Model, View and Controller
In the MVC project, select the Models folder and create a new class, Customer.
The Customer class has the following properties:
public class Customer
{
public string Id { get; set; }
public string FullName { get; set; }
}
Build the solution so that the Customer class will be available when we build the View later on.
In the Controllers folder, create a new Controller, CustomerController and leave the checkbox checked which reads “Add action methods for Create, Update, Delete and Details scenarios”.
In this example, I am going to delete everything but the Index and Details methods.
Now let’s create the view. Right click inside the Index method and choose Add View. Leave the view name Index and in the View data class list, choose Customer so that a strongly typed view will be created based on the Customer class we created above. Choose List from the View content list and click the Add button to generate the Index view.
The Index view will be created in a new Customer folder named Index.aspx and will have all the properties of the Customer class displayed on the page. The generated code looks like this:
<h2>Index</h2>
<table>
<tr>
<th></th>
<th>
Id
</th>
<th>
FullName
</th>
</tr>
<% foreach (var item in Model) { %>
<tr>
<td>
<%: Html.ActionLink("Details", "Details", new { id=item.Id })%> |
</td>
<td>
<%: item.Id %>
</td>
<td>
<%: item.FullName %>
</td>
</tr>
<% } %>
</table>
One property we need to change is the key which is passed to the Details page. Look for the following line in the generated code:
<%: Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ })%>
We need to change PrimaryKey to be the property of our unique value that will be passed to retrieve a Customer. In this case, the value is Customer.Id so change the line to read:
<%: Html.ActionLink("Details", "Details", new { /* id=item.Id */ })%>
where item is the single instance of a Customer in the Model.
The code behind for our controller looks like this:
public List<Customer> CustomerList;
public CustomerController()
{
CustomerList = new List<Customer>();
var c1 = new Customer() { Id = "1", FullName = "Peyton Manning" };
var c2 = new Customer { Id = "2", FullName = "Drew Brees" };
CustomerList.Add(c1);
CustomerList.Add(c2);
}
//
// GET: /Customer/
public ActionResult Index()
{
// In this case, View is a list of Customers
return View(CustomerList.ToList());
}
Next we will add code to the Details method to lookup the Customer based on the link clicked on in the List on the Index view. This will pass the Customer.Id into the Details method and it’s code looks like this:
public ActionResult Details(string id)
{
var FindCustomer = CustomerList.Find(result => result.Id == id);
return View(FindCustomer);
}
Next we need to create the Details view by right clicking inside the Details method and choosing Add View. Leave the view name Details and in the View data class list, choose Customer so that a strongly typed view will be created based on the Customer class. Choose Details from the View content list and click the Add button to generate the Index view.
A file named Details.aspx will be created in the Customers folder. The generated html looks like this:
<h2>Details</h2>
<fieldset>
<legend>Fields</legend>
<div class="display-label">Id</div>
<div class="display-field"><%: Model.Id %></div>
<div class="display-label">FullName</div>
<div class="display-field"><%: Model.FullName %></div>
</fieldset>
<p>
<%: Html.ActionLink("Back to List", "Index") %>
</p>
iPad Tips and Tricks
Screen Capture
To capture whatever is on your iPad’s screen as a photo, hold the Power button, and hit the Home button. You’ll see the display flash and hear a shutter click, and the image will appear in the Camera Roll in Photos.
Lock Rotation or Mute
Lock Rotation or Mute is now controlled by the same switch and configured in Settings.
Go to Settings>General and under "Use Side Switch To:" choose either Lock Rotation or Mute.
View and Kill Running Applications
Two quick hits of the Home button can show you the apps you have running. Press and hold on one icon, and they’ll all start shaking. Tap on the small red minus sign in the top left corner of its icon to kill that app.
iPod Controls Quick Access
If you swipe left, rather than right, after you tap the Home button twice, you’ll get video/music play controls, and volume and screen-brightness sliders.
Passcode Lock
To set a 4-digit code that needs to be entered to unlock the iPad, choose General>Passcode Lock>Simple Passcode.
Find your iPad
Possibly the most valuable app you can download, Find my iPhone (it works for iPads too) once required a paid MobileMe subscription, but now all you need is an Apple ID. Download it for free in the App Store, follow the set-up instructions, and you can view your iPad on a map from your computer or cell phone.
jQueryMobile Notes
Create a new MVC application
Add the following to the site.master to include the jQuery Mobile css and js libraries:
<head id="Head1" runat="server">
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script>
</head>
http://www.htmlgoodies.com/tutorials/forms/article.php/3911771/The-Mobile-Web-with-jQuery-Mobile.htm
Web Camp Notes
Takeaways:
Look at Web Platform Installer
MVC:
There’s an MVC handler in the System.Web.Mvc.dll
There will be an IIS express.
Convention over configuration
In the Controller, created a new function Poo with ActionResult.
Run it and type /Home/Poo
No View.
Right click, in solution, in function, Add View
Now run again
Model:
Controller – retrieves Model, does stuff
View – visual represent the model
Razor:
Just out an @ sign in front of your code, and variables (making the parser starter)
Dynamic expressions in C# 4
(Dynamic view data dictionary – the operation will be resolved at runtime)
ViewBag.Whatever = PeopleList
The compiler is the first unit test, just a spell checker.
Scaffolding, Nuget,
Nuget – Add Elmah
Dependency Injection (DI)
Create class
Create interface from Class
Every time you NEW up something, think about DI.
From the Package Manager Console, PM> Install-Package Ninject.MVC3
Look at MVCScaffolding
Web Camps
Takeaways:
Look at Web Platform Installer
MVC:
There’s an MVC handler in the System.Web.Mvc.dll
There will be an IIS express.
Convention over configuration
In the Controller, created a new function Poo with ActionResult.
Run it and type /Home/Poo
No View.
Right click, in solution, in function, Add View
Now run again
Model:
Controller – retrieves Model, does stuff
View – visual represent the model
Razor:
Just out an @ sign in front of your code, and variables (making the parser starter)
Dynamic expressions in C# 4
(Dynamic view data dictionary – the operation will be resolved at runtime)
ViewBag.Whatever = PeopleList
The compiler is the first unit test, just a spell checker.
What’s new in MVVM Light V3
Sending messages with callbackCertain classes have been added to the GalaSoft.MvvmLight.Messaging namespace, allowing sending a message and getting a callback from the recipient. These classes are:
* NotificationMessageWithCallback: Base class for messages with callback.
* NotificationMessageAction: A class with string notification, and a parameterless callback.
* NotificationMessageAction: A class with string notification, and a callback with a parameter of type T. To send a message with callback, use the following code:
view source
print?
01.var message = new NotificationMessageAction(
02. “Hello world”,
03. callbackMessage =>
04. {
05. // This is the callback code
06. if (callbackMessage)
07. {
08. // …
09. }
10. });
11.
12.Messenger.Default.Send(message);To register and receive a message with callback, use the following code:
view source
print?
01.Messenger.Default.Register>(
02. this,
03. message =>
04. {
05. // Do something
06.
07. // Execute the callback
08. message.Execute(true);
09. });
Messenger.Default can be overridenThe Messenger.Default property can also be replaced, for example for unit testing purposes, by using the Messenger.OverrideDefault method. All the public methods of the Messenger class have been made virtual, and can be overridden in the test messenger class.
Sending messages to interfacesIn V2, it was possible to deliver messages targeted to instances of a given class. in V3 it is still possible, but in addition you can deliver a message to instances that implement a certain interface. The message will not be delivered to other recipients.
Use the overload Messenger.Default.Send
(TMessage message) where TTarget is, in fact, an interface (for example IDisposable). Of course the recipient must register to receive the type of message TMessage.
Sending messages with a tokenMessages can now be sent through the Messenger with a token.
* To send a message with token, use the method overload Send
(TMessage message, object token).
* To receive a message with token, use the methods Register(object recipient, object token, Action action) or Register (object recipient, object token, bool receiveDerivedMessagesToo, Action action) The token can be a simple value (int, string, etc…) or an instance of a class. The message is not delivered to recipients who registered with a different token, or with no token at all.
http://blog.galasoft.ch/archive/2010/03/16/whatrsquos-new-in-mvvm-light-v3.aspx
The Best iPad Apps
Social
Twitter:
The official Twitter app for iPad packs in the features, giving you a
full Tweet-and-browse experience. It can be a little bit overwhelming at
first, but powerful things often are. Free.
Flipboard:
A true testament to the iPad’s transformative powers, Flipboard scrapes
your Twitter and Facebook feeds for links and arranges them in a
simple, beautiful magazine-style format. Free.
BeeJive IM for iPad:
If you’re looking for one place to corral all your chats, BeeJive is
it. It’s the best, best-looking IM client for the iPad, connecting to
AIM, GTalk, Facebook chat and a handful of others. $10.
Entertainment
Korg iMS-20: A faithful reproduction of Korg’s MS-20 analog synth, this is the app that will make your music-playing friend get the iPad. It’s proof of just how powerful the tablet can be as a music production machine. $16.
Sketchbook Pro:
The challenge with drawing apps is packing the most features in the
most accessible way possible. Sketchbook Pro walks that line, offering
up enough stuff to keep real deal artists busy while making it easy enough for schlubs like me to enjoy. $8.
Remote:
With AirPlay, Apple’s signalled its intentions to not just sell you
music and movies but to let you move them around your house, too. The
official Apple Remote is a key piece of the puzzle, serving as a rich
controller for iTunes or AppleTV. Free.
TED for iPad:
TED talks are some of the best content the internet has to offer, bar
none. The iPad, safe from the constant, pinging distractions of the
internet, is the perfect place to watch them. Free.
Kindle:
Even if you don’t have an actual Kindle, Amazon’s still the king of
ebooks. Their iPad app lets you buy books from the vast Kindle library,
and you can rest easy knowing that they’re on a platform that’s almost
guaranteed to have some staying power. Free.
StreamToMe:
The iPad doesn’t play nice with many file formats natively. Along with a
server app you install on your main machine, StreamToMe will re-encode
pretty much any video you throw at it on the fly and beam it to your
iPad. Magnificent. $3.
Netflix:
I’ve gotta say, when you’re curled up in bed streaming some old TV show
to your tablet, the future starts looking like a pretty alright place.
With great new Instant Watch offerings popping up all the time, a
Netflix subscription is essentially mandatory. Free.
Google Earth:
You haven’t experienced Google Earth until you’ve experienced it on the
iPad. Seamless swishing, flicking, pinching, and zooming. Free.
Games
World of Goo:
The smash Wii Ware hit somehow makes even more sense on the iPad, like
this is how it was meant to be played all along. Pure gooey physics fun.
$5.
Osmos HD: One of, if not the most, immersive, unique iPad games in the App Store, Osmos makes cellular life captivatingly beautiful. $5.
Dead Space:
A new, tablet-optimized extension of the popular console shooter
series, Dead Space shows just how robust an iPad game can be. From the
visual details to the spooky sound design, it’s got the full package.
$10.
Infinity Blade: How good can an iPad game really look? Uh, check out Infinity Blade to find out. Spoiler: really f-ing good. $6.
Monkey Island 2 Special Edition:
The iPad’s big touchscreen breathes new life into the LucasArts
classic, and its smart UI stays out of the way while you enjoy the
puzzles, humor, and animations you remember from way back when. $5.
Flight Control HD:
It was one of the best games when the iPad came out and it still
is—directing air traffic can quickly turn from meditation to mayhem.
Both modes are fun. $5.
The Incident: 8-bit pixel revival at its finest, the Incident is at once retro and fresh, apocalyptic and hilarious. $2.
Productivity
Instapaper:
Reading, it turns out, is just about the best thing you can do on this
crazy futuristic tech-slab of yours. Instapaper strips all the web junk
from the articles you come across and leaves you with the sweet, pure
text. $5.
Reeder:
Thanks to RSS feeds, you will never, ever run out of cool stuff to
read. Reeder is the cleverest, prettiest way to sift through it all. $5.
Elements:
An attractively sparse text editor for the iPad with a handful of
features—like autosaving to the cloud via Dropbox—that set it apart. If
you’re used to cumbersome, feature-soaked text editors like Word,
Elements is a breath of fresh air. $5.
SimpleNote:
SimpleNote is the longstanding holder of the minimalist note taking
crown: It lets you take notes and keep them in sync across your iPad,
iPhone, and the web reliably and simply with zero distractions. Free.
Dropbox:
Wanna see what this “cloud” fuss is all about. Start dumping your files
in Dropbox on your PC or Mac and watch them magically appear in the
iPad app. It’s quick, it’s clean, it works, and it’s free.
Screens:
VNC can get confusing, but Screens makes it dead simple. Turn internet
sharing on on your Mac (or PC, or Linux machine) and Screens will let
you control it. You can even use all your favorite multitouch gestures.
$20.
Pulse:
So you like the idea of RSS—news coming to you, instead of you going to
it—but don’t want to deal with adding feeds and endless lists of
headlines. Pulse makes the whole thing visual, giving you swipeable
columns and rows of stories and sources. Free.
Lifestyle
NightStandHD:
If you happen to dock your iPad next to your bed, you might be
thinking, “Hey, this thing could probably make for a pretty beautiful
clock.” You’re right! NightStandHD has a handful of beautiful clocks
both analog (looking) and digital. $2.
Epicurious:
You like food, right? Epicurious has got tons of recipes presented in a
nice, photo-friendly format. Show this to your Mom to justify your iPad
purchase. Free.
Wired: No one’s really made the slam dunk tablet magazine yet, but if you want to get a sense of how the magazine of the future might look, Wired’s leading the pack. $4.
Gravilux:
Most people looked at the iPad and saw a device for creation or
consumption. Scott Snibbe saw it as the perfect platform for interactive
art. Gravilux, a whirling, touch-baed gravity simulation, is
addictively purposeless. $2.
New York Times for iPad:
After a somewhat clunky start in the app world, NYT has pulled it
together and put together a clean, content-packed tablet edition of
their paper. You’ll have to start paying for it soon, but for now it’s
free.
Yelp:
The preeminent food-finding service goes great on the tablet. Just make
sure to wash your hands before you pick it back up. Free.
The Nielson Company releases stats on smartphone use
A report released by The Nielsen Company shows 29.7 percent of U.S. mobile subscribers own smartphones that run full operating systems.
The stats indicate that iPhone and Blackberry are neck in neck at 27% and Android comes in second at 22%.

Article link:
http://blog.nielsen.com/nielsenwire/online_mobile/us-smartphone-battle-heats-up/
