Quantcast
Channel: Telerik Blogs
Viewing all 4135 articles
Browse latest View live

Understanding Fiddler Certificate Generators

$
0
0

Fiddler and FiddlerCore offer three different choices for generating interception certificates:

  • MakeCert
  • CertEnroll
  • Bouncy Castle

If you’re so inclined, you can even write your own certificate generator (say, by wrapping OpenSSL) and expose it to Fiddler using the ICertificateProvider3 interface.

On Windows, Fiddler includes the MakeCert and CertEnroll certificate generators by default; you can download the Bouncy Castle Certificate Generator if you like. By contrast, when Fiddler is running on Linux and Mac, only the Bouncy Castle certificate generator is available, and it is included by default.

If you’re using Windows, however, you may wonder which Certificate Generator you should use in Fiddler or for your applications based on FiddlerCore.

In general, I recommend the Bouncy Castle generator, as it has better performance than the default MakeCert generator, and it offers more configuration choices than the CertEnroll generator. Another advantage of the Bouncy Castle certificate generator is the only certificate that (typically) goes in the Windows Certificate store is the root certificate. The server (end-entity) certificates generated for each website are kept in memory and discarded when Fiddler exits; because the Bouncy Castle generator reuses a single private key for all certificates by default, the performance impact of this behavior is minimal.

The only downside to the Bouncy Castle generator is its size: it is ~200KB when compressed, which is 25 percent larger than FiddlerCore itself.

The CertEnroll generator was added to Fiddler relatively recently​. It offers better performance and standards-compliance than the legacy MakeCert generator, but is available only on Windows 7 and later. You can easily switch Fiddler to use CertEnroll inside Tools > Fiddler Options > HTTPS.

The MakeCert generator is the original certificate generator used by Fiddler, and it remains the default on Windows today (mostly) for legacy compatibility reasons. It suffers from a number of shortcomings, including the fact that the certificates it generates are not compatible with iOS and (some) Android devices. It generates certificates with a 1024-bit RSA key (which may soon trigger warnings in some browsers), and each certificate has a unique key (meaning each new secure site you visit triggers the somewhat costly key generation code).

Both the CertEnroll and MakeCert-based certificate generators must store all server certificates in the Windows Certificate store, which some users may find confusing:

Certificate Store

The storage of (potentially thousands of) server certificates in the user profile can also cause some problems for corporate users who have roaming user profiles, as these certificates are roamed to each workstation as the user logs in. To mitigate that, the Clear server certs on exit checkbox can be set inside the Tools > Fiddler Options > HTTPS > Certificate Provider dialog, or via:

    FiddlerApplication.Prefs.SetBoolPref("fiddler.certmaker.CleanupServerCertsOnExit", true);

However, the downside of doing that is Fiddler must then re-create the server certificates every time it starts. This performance penalty is smaller when using CertEnroll, which reuses a single 2048-bit RSA key, than for MakeCert, which generates unique 1024-bit RSA keys for each site.

FiddlerCore Considerations

To determine which Certificate Generator is in use, be sure to attach the following event handlers:

Fiddler.FiddlerApplication.OnNotification +=
  delegate(object sender, NotificationEventArgs oNEA) { Console.WriteLine("** NotifyUser: " + oNEA.NotifyString); };
Fiddler.FiddlerApplication.Log.OnLogString +=
  delegate(object sender, LogEventArgs oLEA) { Console.WriteLine("** LogString: " + oLEA.LogString); };

You can then view information about the Certificate Generator in the console when it loads.

Developers building applications atop FiddlerCore should keep the following in mind when deciding which Certificate Generator to use:

MakeCert

  • MakeCert.exe is a Microsoft Visual Studio 2008 redistributable file, meaning you’re licensed to redistribute it if you have an appropriate license to that version of Visual Studio. Microsoft may offer MakeCert.exe as a redistributable in other circumstances, but licensing is provided by Microsoft, not Telerik.
  • To use MakeCert.exe, you must include it adjacent to your application’s .exe file.
  • MakeCert-generated certificates are not compatible with iOS and some Android devices.
  • MakeCert-generated certificates “pollute” the user’s Certificate Store, and you should consider offering a mechanism to clear them.

CertEnroll

  • The CertEnroll API is available on Windows 7 and later.
  • Use CertEnroll by either omitting makecert.exe from the application’s folder or by explicitly setting the preference:
  •     FiddlerApplication.Prefs.SetBoolPref("fiddler.certmaker.PreferCertEnroll", true);

  • CertEnroll-generated certificates “pollute” the user’s Certificate Store and you should consider offering a mechanism to clear them.

Bouncy Castle

  • Bouncy Castle is an open-source PKI and crypto library distributed under the MIT license
  • To use Bouncy Castle, you must include CertMaker.dll and BCMakeCert.dll adjacent to your application’s .exe file
  • Bouncy Castle does not store certificates in the Windows Certificate Store (yay!), but this also means your application needs to keep track of its root certificate and private key (unless you recreate and retrust it every time the application runs)

Two preferences are used to hold the key and certificate, fiddler.certmaker.bc.key and fiddler.certmaker.bc.cert. After you first call createRootCert, you should retrieve these preferences using FiddlerApplication.Prefs.GetStringPref and store them somewhere within your application’s settings (registry, XML, etc); the private key should be considered sensitive data and protected as such. When your application next runs, it should detect whether the key and certificate have already been created, and if so, they should be provided to the certificate generator using FiddlerApplication.Prefs.SetStringPref before any certificates are requested, lest you inadvertently create a new root certificate.

Rick Strahl wrote a great blog post on this process, including some sample code.

 


An Interview with Progress CTO Matt Robinson

$
0
0

New Progress CTO, Matt Robinson, shares his thoughts about the technology landscape and how the vision for Progress technologies is uniquely positioned to meet today’s challenges.

A few weeks back we had the opportunity to sit down with our newly appointed Chief Technology Officer (CTO), Matt Robinson. Matt came to Progress in 2013 through the acquisition of Rollbase, which he founded. During his time at Progress, he’s been heavily involved the development, strategy and vision around much of our application development practice, so taking on the CTO position was a natural progression.

He welcomes the opportunity to work with a great group of colleagues to drive omni-channel digital experiences using the sweeping portfolio of Progress solutions.

Passionate about all things technology, Matt shared his thoughts about his new role, why he wanted to be CTO and what excites him about the future of Progress. He also offered his insights about the top industry trends and challenges, as well as how Progress addresses the needs of our customers and partners―including the value Telerik brings to the mix.

To see the full interview and hear his thoughts, click here. To learn more about Progress, visit our company page.

Surprises About the State of Mobility

$
0
0

Mobility is a white hot topic at the moment, but for all the rhetoric, is the enterprise really jumping on the mobility bandwagon? That’s what we wanted to find out when we recently surveyed 3,000 IT professionals to assess the adoption, trends and perceptions around mobile development. We found many of the results surprising.

Though interest in mobile apps among consumers and enterprises is on the rise, mobile application development is slower than expected. In fact, according to our findings, 57% of developers are still brand new to mobile development or have never built a mobile app. This tells us they need the right tools and processes to move forward with their development efforts.

Other key findings include:

Developing Compelling Mobile Apps Is Key to User Adoption

Improved operational efficiency was cited most often as a key reason for building mobile apps. Other reasons include creating revenue opportunities (39%), increasing employee productivity (38%), improving customer service (35%) and engaging customers in a more meaningful way (34%). 

To achieve these goals, user experience (UX) is the most important element for mobile apps of any type—whether they are external-facing or used for business-critical functions. This was confirmed by 44% of those surveyed, followed by ease of maintenance (24%), performance (15%) and security (11%).

Organizations Would Benefit from a Flexible, Multi-Platform Approach

While there are developer frustrations with a lack of tools and ever-changing development practices, most developers don’t have their hearts set on a particular approach for building mobile apps. Hybrid is the most preferred (33%), followed by native (25%) and web (19%), but the dividing line is close.

The survey also found that developers are developing across all platforms, with 76% percent developing for Android, 63% for iOS and 40% for Windows Phone. Of those who develop for iOS, 83% also develop for Android. Although multi-platform development is a requirement for the majority of B2B and B2E mobile apps, it is one of the greatest challenges—36% of respondents listed it as the most challenging part of the app building process, tied with the need to provide a clean UI.  

New Development Challenges Are Looming

Looking forward, respondents reported developing for a mix of platforms other than mobile, including web (87%), desktop (62%), IoT (22%), wearables (6%) and others.

According to the survey, IoT trumps wearables, such as the Apple Watch, as the “next big thing” in app development. Smart appliances and virtual reality devices, like the Oculus Rift, are expected to be more important by 35% and 21% of respondents, respectively. Only 21% have definitive plans to build apps for wearables in 2015. Of that 21%, 45% will be developing apps for the Apple Watch.


To read the full report and see all of the survey findings, click here.

Progress Snags Two Stevies

$
0
0

Progress is happy to announce two more award wins this August! We are winners in two categories in the International Business Awards (The International “Stevies”):

  • Progress® OpenEdge® is a GOLD winner in the “Software Development Solution” category
  • Telerik® Sitefinity™ DEC is a Bronze winner in the “Marketing/Public Relations Solution” category

The International Business Awards are the world’s premier business awards program. Stevie Award winners were determined by the average scores of more than 200 executives worldwide who participated in the judging process, from May through early August. The 2015 IBAs received entries from more than 60 nations and territories, and more than 3,700 nominations from organizations of all sizes and in virtually every industry were submitted this year for consideration in a wide range of categories.

OpenEdge has been the platform of choice for software application partners for more than 30 years. You wouldn’t think that an application (or a development platform) could change the world—but our partners have relied on Progress technology to do just that. From supply chain and payment systems to custom software for every industry, OpenEdge helps over four million users a day enable the systems that enable our daily lives.

The Sitefinity Digital Experience Cloud is a unified marketing command center that helps marketers drive growth by analyzing and optimizing every customer journey. It enables the understanding of marketing effectiveness and provides predictive and prescriptive analytics, thereby supplying organizations with valuable insights into driving ROI.

“The IBAs grow in stature and renown every year, and with that the number and quality of entries increases,” said Michael Gallagher, president and founder of the Stevie Awards. “This year’s judges were treated to more than 3,700 stories of success and achievement around the world. We thank the judges for their time and feedback, and we congratulate the Gold, Silver and Bronze Stevie winners whom we’ll celebrate in Toronto in October.”

Details about The International Business Awards and the lists of Stevie Award winners are available at www.StevieAwards.com/IBA.

We want to say a big “Thank You” to our community for its continuous support!

Creating Data Forms in Windows 10 Universal Platform Apps

$
0
0

Data Forms are found in just about every LOB application–can’t we make it easier?

Creating Line-of-Business (LOB) applications can become tedious, especially if you’re designing a data entry screen. ​Typically, you gather data from your users with a TextBlock, TextBox, CheckBox, RadioButton and for so forth. You begin by dragging those onto your designer, name the controls and position them where they look nice on the screen. Any additional data validation will need to come from code. If you left out a field, it's back to the designer, as you have to reposition your UI elements. I’m pleased to announce that your life just got a lot easier with DataForm in UI for Windows Universal.

A Common Data Form Layout

Before we take a look at how we implement our DataForm control, let’s look at how we do it currently.

The MainPage.xaml for a typical data form may look like the following:

<StackPanelGrid.Row="1"Margin="50">
    <TextBlock  TextWrapping="Wrap"Text="E-Mail: "/>
    <TextBoxx:Name="txtEmail"TextWrapping="Wrap"/>
    <TextBlock  TextWrapping="Wrap"Text="First Name: "/>
    <TextBoxx:Name="txtFirstName"TextWrapping="Wrap"/>
    <TextBlock  TextWrapping="Wrap"Text="Last Name: "/>
    <TextBoxx:Name="txtLastName"TextWrapping="Wrap"/>
    <TextBlock  TextWrapping="Wrap"Text="Title: "/>
    <StackPanelOrientation="Horizontal">
        <RadioButtonx:Name="rdMr"Content="Mr."/>
        <RadioButtonx:Name="rdMrs"Content="Mrs."/>
        <RadioButtonx:Name="rdMiss"Content="Miss."/>
    </StackPanel>
    <TextBlock  TextWrapping="Wrap"Text="Company: "/>
    <TextBoxx:Name="txtCompany"TextWrapping="Wrap"/>
    <TextBlock  TextWrapping="Wrap"Text="Phone Number: "/>
    <TextBoxx:Name="txtPhoneNumber"TextWrapping="Wrap"/>
</StackPanel>

Which results in the following screen: 

defaultxaml

Each input field is given a name and some properties have been set. So far, we have seen a lot of XAML and are using a simple StackPanel to display the data properly.

What if you could define your UI through a class and have it generate your UI automatically? That's where the new DataForm comes into play.

Using DataForm Included in UI for Universal

After you have installed the Windows Software Development Kit (UWP), you will see the following templates: 

templates

Begin by using the Blank App (Universal Windows) template and adding references to the following files:

  • Telerik.Core.dll
  • Telerik.Data.dll
  • Telerik.UI.Xaml.Input.dll
  • Telerik.UI.Xaml.Primitives.dll
  • Telerik.UI.Xaml.Controls.Data.dll

We are going to use the DataForm to automatically generate our UI in our app, so let’s begin by adding a class to this project to collect contact details. As you can see from the screenshot, the contact details on the first page ​include E-mail, First Name, Last Name, Title, Company and Phone Number. You can name the class Contact, and we will add the other fields later. The code contained in this file looks like this:

publicclassContact
{
    privatestringemail;
    privatestringfirstName;
    privatestringlastName;
    privateUserTitle title;
    privatestringcompany;
    privatestringphonenumber;
 
    publicenumUserTitle
    {
        Mr,
        Mrs,
        Miss
    }
 
    publicstringEmail
    {
        get
        {
            returnthis.email;
        }
        set
        {
            this.email = value;
        }
    }
 
 
    publicstringFirstName
    {
        get
        {
            returnthis.firstName;
        }
        set
        {
            this.firstName = value;
        }
    }
 
    publicstringLastName
    {
        get
        {
            returnlastName;
        }
        set
        {
            lastName = value;
        }
    }
 
    publicUserTitle Title
    {
        get
        {
            returntitle;
        }
        set
        {
            title = value;
        }
    }
 
    publicstringCompany
    {
        get
        {
            returnthis.company;
        }
        set
        {
            this.company = value;
        }
    }
 
    publicstringPhoneNumber
    {
        get
        {
            returnphonenumber;
        }
        set
        {
            phonenumber = value;
        }
    }
 
}

A Look at Our MainPage.xaml

Our UI is simply going to reference the DataForm control. Let’s go ahead and add the proper XML namespace as shown below:

xmlns:telerikDF="using:Telerik.UI.Xaml.Controls.Data"

Add the following code snippet to the Grid already located on the MainPage.xaml. 

<telerikDF:RadDataFormx:Name="radDataForm"/>

Switching Back to Our MainPage.xaml.cs File

We will need to add in the following code to set the Item property of the DataForm displayed on the screen:

Contact _contact = newContact();
 
publicMainPage()
{
    this.InitializeComponent();
    this.radDataForm.Item = _contact;
}

Once complete, we see this:

withdataform

As you can see, it automatically generated our UI based off the class that we instantiated. But, you may want to edit the field names as right now the “FirstName” needs a space between it (along with the other fields), or maybe you want to rearrange your UI to put the Company name after your last name. This is easily accomplished by adding the following property attribute to the class as shown below: 

[Label("First Name :")]
[Index(1)]
publicstringFirstName
{
    get
    {
        returnthis.firstName;
    }
    set
    {
        this.firstName = value;
    }
}

With this small change, we now have Labels with the correct spacing, and by using the Index property attribute, we changed our UI without going back inside our XAML file. We can finish this app up by adding a button and accessing the data the user entered with the click event handler. 

privateasync voidButton_Click(objectsender, RoutedEventArgs e)
{
    var messageDialog = newMessageDialog("First Name : "+ _contact.FirstName + Environment.NewLine + "Last Name : "+ _contact.LastName);
    await messageDialog.ShowAsync();
}
finalform

Wrap-Up

Now our DataForm is starting to become alive! You could submit the data to a webserver, perform validation and so forth. I hope this helped; if you would like early access to a preview build of our Windows 10 controls, email universalwindows@telerik.com. Until next time, happy coding!

ui-for-windows-universal-banner

Official MS Edge Support in UI for ASP.NET AJAX

$
0
0
The Q2 2015 Service Pack 2 release of Telerik UI for ASP.NET ​AJAX brings official support for Microsoft Edge.

Rumen blog image
 

What Does This Mean?

  • All controls have been tested under the modern browser and verified they work as expected
  • If you experience any problems under MS Edge, don't hesitate to report them in the feedback portal, forums or the ticketing system, where we will evaluate and prioritize them
  • The Browser Support page has been updated

Other Improvements

You and your users could also benefit from the following important fixes:

  • Button: Fix the displaying of the icons in the toggle state button
  • Editor: Empty paragraphs appear formatted in the content when new line is entered; Insert Table Light dialog raises an error when inserting a table in IE9, IE10 and IE11
  • Grid: When column resizing is enabled and there is a column with Display=false, a blank area appears in the Grid
  • PivotGrid: The horizontal scroll does not work as expected; the tooltips do not show content
  • TileList: The DataBindings.Target field value is ignored for data bound tiles
  • Window: RadWindow in Lightweight RenderMode doesn't set value for the name attribute of the iframe element

Additional Resources

3 Metrics Every Mobile App Should Track

$
0
0

These metrics are fundamentally important; without them, you are navigating in deeper darkness than back in 2008.

When my team at EQATEC took the first steps toward what would eventually become our application analytics solution back in 2008—five years before Telerik acquired the company—we simply thought it would be fun to see how often an application we developed was used. We followed the number of app downloads from our web page for some time, and, aside from the few emails we received in support and the number of licenses we sold, we didn’t really have any clue about what happened with our application after it was downloaded.

Once we started to receive live data from our applications, we became addicted to refreshing the web page, which displayed embarrassingly little information. It was tremendously inspiring to everyone to aim a small torchlight into the darkness that had previously surrounded our “application usage,” and now clearly see hidden facts in the spotlight. This was a complete game changer for us.

We started wondering how you could actually run a business without such data? Who would want to navigate in almost complete darkness? Why even get up in the morning? This kind of

“Analytics for applications” would be meaningful to any web, mobile or desktop application.

This had to be something the future would embrace!

All these thoughts and dreams fuelled our efforts to build a general solution to be widely used in any software project, to collect the data and present it for easy interpretation. These goals still drive our team, and we have come a very long way.

What Metrics Should You Analyze?

If I had to start all over again and build an application analytics solution from scratch based on my current experience, I would collect the exact same metrics we started with. These metrics are fundamentally important; without them, you are navigating in deeper darkness than back in 2008. A majority of your competitors are collecting them, plus a ton of other metrics, and they know what is going on with their apps.

So what are the fundamental metrics?

  1. Usage: Software that’s never used is basically a complete waste of all the time, money and effort that went into planning, developing, testing and deploying it. What’s software that is running constantly on more and more devices? Unless it’s a nasty virus, most people will consider it a success. Measuring the number of times your software is launched (we call this the number of sessions) is a fundamental gauge of your app’s success. To understand your level of success, you can take a deeper look at the sessions. How many of these come from the same physical devices? This number gives you an indication of how many unique users you have. You can also count how many unique users you have daily, weekly and monthly, and determine how many users continue to use your app over longer periods. With this information, you can build marketing campaigns to influence usage.
  2. Errors: If software crashes or malfunctions, the only way users will continue to use it is if it satisfies a unique need in the market. More likely, you’ll see the number of recurring users will be very low. Many may try your app, but then abandon it out of frustration. Collecting information about errors that occur when your app is running outside of development is a fundamental metric. Unhandled exceptions should be collected including stack traces. Programmers have pretty good control over what happens when the app is executing, but most developers will be surprised by the number of unhandled exceptions that occur. Until you start tracking exceptions, you’ll be able to fix issues that could be detrimental to your app’s success.
  3. Environment: Does your app adapt to the physical devices that are used to run the app? Maybe your users are trying to run your app on low-end mobile devices with low screen resolution and slow CPUs? Maybe the majority use tablets? Maybe your users tend to run on older OS versions?

If your mobile app is hybrid, it can run on a huge number of different physical devices. So can your web or desktop app. An app might execute quite well on devices used during testing, but in the real world, you never know what environment your users will use.

Having data about the user’s environment can help you immensely when you plan and develop your apps. Furthermore, the same information can help you to analyze unhandled exceptions. The majority of those exceptions may be occurring on specific device types.

Analytics Support in Telerik Platform

Each of the categories of metrics discussed here can be refined, enabling detailed insights for better decision making during development. Without such data, you’d only have your gut feelings to rely on—a risky, imprecise method.

Telerik Platform includes Telerik Analytics, which enables you to monitor all these metrics plus many, many more. If you develop a mobile app with Telerik Platform, simply include the Telerik Analytics plugin in your project, and your application will automatically report metrics to shine a very strong headlight into the darkness of your app usage. Whether you develop for mobile, web or desktop applications, Telerik Analytics presents the data in a completely uniform fashion.

You can try Telerik Analytics and monitor any mobile, web or desktop app now. Simply create a Telerik Platform trial account, then create a “blank app” and “add  analytics.” Here's the documentation.

Please leave comments, questions or suggestions below. We’d love to help!

 

Telerik Platform and iOS 9

$
0
0

Another year has flown by, and we have yet another major iOS update to contend with!

On Wednesday, September 16, Apple is expected to release iOS 9, the next iteration of ​its immensely popular mobile OS. What does this mean for hybrid and native mobile developers who are ​using Telerik Platform? Read on to find out.

ios 9 logo

NativeScript

One of the core benefits of leveraging NativeScript for your native mobile app development needs is the promise of day zero support for new operating systems. This is still the case today, as we support the entire set of iOS 9 APIs!

Specifically, you can check out some existing blog posts related to deep linking in iOS 9 and another on building a widget for the iOS notification center.

Hybrid (Cordova/PhoneGap)

Hybrid developers specifically need to know about some breaking changes that Apple introduced with iOS 9:

  • Users of our WKWebView plugin should upgrade their apps to the latest version, which provides full support for iOS 9.
  • Tried our new Apple Watch plugin yet? We made some tweaks to ensure compatibility with iOS 9.
  • Users of Angular/Ionic have reported a critical bug that requires a fix.
  • Bitcode is enabled by default, so any custom Cordova plugins you use will have to be built for bitcode.

App Transport Security

What is this ATS thing? If you've heard the buzz about App Transport Security, what you really need to know is iOS 9 requires all of your remote endpoints to be accessed securely with the HTTPS protocol. This is a great best practice, and you should definitely implement this going forward.

In the meantime, a quick workaround is to add the following key to your info.plist file:

<key>NSAppTransportSecurity</key> 
<dict>
    <key>NSAllowsArbitraryLoads</key> <true/> 
</dict>

Here are the instructions for editing these configuration files in Telerik AppBuilder.

Telerik Backend Services

In an upcoming release of Backend Services, we will provide full support for iOS 9 push notifications. This means your users will be able to input text directly into a notification and you can handle responses from these actions created by your users.

We will also be migrating to a new Apple Push Notification Service (APNS) API which will make enabling push even easier as it removes the requirement for separate production and development certificates!

Looking Ahead

Here at Telerik, we are actively testing our cloud-based build servers with the latest SDKs from Apple, and we plan on officially releasing iOS 9 support in an upcoming release. In the meantime, rest assured if you follow the advice in this article, your existing apps will work just fine on this new OS.


UI Testing with Xcode 7 and Telerik UI for iOS

$
0
0
At Telerik, we know how important is for our customers to have stable and reliable product. That is why we take testing seriously.

We know that automated tests allow us to verify that the whole product is functioning correctly. Until now, we used UIAutomation for unit tests to ensure that our API is functioning properly. Regarding UI tests, we tried different tools and products. However, no one was able to handle our requirements. 

Therefore, based on our own experience and our customers' experience, we built our own tool,Telerik Test Studio, which already implements and is going to implement a bunch of the features we were not able to find anywhere else. For more information about it, refer ​to the end of the article. Soon, we will make a deep dive into how to test UI for iOS with Telerik Test Studio. 

The main topic of the blog today, however, is the UI testing tool included in Xcode 7 which came as a nice surprise and complements Telerik Test Studio nicely

Xcode 7 UI Testing

The UI testing tool of Xcode 7 would enable us to replace our current JavaScript and picture-based tests with ones written in Swift, and we will be able to debug issues directly from Xcode.  
 
We tested the new testing tool, and it turned out to be easy to test our components with the new Xcode feature. Let's see how this can be done. 

How it works 
 
The new UI testing tool is based on the existing XCTest framework. All assertion methods are available and it just adds some new APIs. Most important are the following ones: 
  • XCUIApplication: This object represents your application and allows starting it. 
  • XCUIElement: This object represents a single UI element. Those are your UIViews. 
  • XCUIElementQuery: This one allows searching for specific element in the UI hierarchy. 
Writing a Test
 
If you are to create a new project, make sure that the "Include UI Tests" option is checked. Set the language to Swift. We use Swift in this example, but you can achieve the same by using Objective-C. 

Xcode7-NewProject
 
When using an existing project, you can add a new test target by using the "iOS UI Testing Bundle" template. Just choose a name, and Xcode will automatically create a new target and the corresponding folder in your project. 

Xcode7-AddTarget
 
Our first test will use TKAlert. It will ensure that TKAlert opens correctly and that its buttons contain the required texts.  

You should follow the steps described in our documentation to reference the TelerikUI.framework in your project.
 
Next, place the following code in your ViewController class to create a new TKAlert that starts with a tap of a button: 

let textLabel = UILabel()
  
overridefunc viewDidLoad() {
    super.viewDidLoad()
      
    let button = UIButton(type: UIButtonType.Custom)
    button.addTarget(self, action: "show:", forControlEvents: UIControlEvents.TouchUpInside)
    button.backgroundColor = UIColor(red: 0.5, green: 0.7, blue: 0.2, alpha: 0.7)
    button.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal)
    button.setTitle("Answer me", forState: UIControlState.Normal)
    button.titleLabel!.font = UIFont(name: "GillSans", size: 14)
    button.layer.cornerRadius = 40
    button.clipsToBounds = true
    button.frame = CGRectMake((CGRectGetWidth(self.view.frame) - 80)/2.0 , CGRectGetHeight(self.view.frame)-180, 80, 80)
    self.view.addSubview(button)
      
    textLabel.frame = CGRectMake(0, 100, self.view.frame.size.width, 44)
    textLabel.textAlignment = NSTextAlignment.Center
    textLabel.text = "Please, answer the question?"
    self.view.addSubview(textLabel)
}
  
func show(sender: AnyObject) {
      
    let alert = TKAlert()
      
    alert.title = "Chicken or the egg?"
    alert.message = "Which came first, the chicken or the egg?"
    alert.style.maxWidth = 210
    alert.dismissMode = TKAlertDismissMode.Swipe
      
    alert.addActionWithTitle("Egg") { (TKAlert, TKAlertAction) -> Bool in
        self.textLabel.text = "It was the egg"
        returntrue
    }
      
    alert.addActionWithTitle("Chicken") { (TKAlert, TKAlertAction) -> Bool in
        self.textLabel.text = "It was the chiken"
        returntrue
    }
    alert.show(true)
}
 
Here is how the application should look when started: 
 
AlertInitialPageAlertPopupPage

Now open the Alert_UI_TestsUITests.swift file, whcih should contain a method called setUp. This method is called when the application is launched. 
 
overridefunc setUp() {
    super.setUp()
      
    // Put setup code here. This method is called before the invocation of each test method in the class.
      
    // In UI tests it is usually best to stop immediately when a failure occurs.
    continueAfterFailure = false
    // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
    XCUIApplication().launch()
}
 
In the same file you will see an empty method called testExample. This is where your testing code should go. Now, move the cursor and click on the red record button on the bottom. This will launch the application and you will be able to tap and interact with it. When you are ready, touch the red button again. This stops the recording. 

Xcode7-RecordButton
 
Something similar to the following code will be generated in testExample method: 
 
func testExample() {
  // Use recording to get started writing UI tests.
  // Use XCTAssert and related functions to verify your tests produce the correct results.
          
  let app = XCUIApplication()
  let answerMeButton = app.buttons["Answer me"]
  answerMeButton.tap()
  app.buttons["Chicken"].tap()
  answerMeButton.tap()
  app.buttons["Egg"].tap()
}

Now, let's customize this code by adding some assertions. This is made by using the XCTAssert method:

func testExample() {
   // Use recording to get started writing UI tests.
   // Use XCTAssert and related functions to verify your tests produce the correct results.
          
   let app = XCUIApplication()
   let answerMeButton = app.buttons["Answer me"]
          
   answerMeButton.tap()
          
   XCTAssert(app.staticTexts["Chicken or the egg?"].exists)
   XCTAssert(app.staticTexts["Which came first, the chicken or the egg?"].exists)
          
   app.buttons["Chicken"].tap()
          
   XCTAssert(app.staticTexts["It was the chicken"].exists)
          
   answerMeButton.tap()
   app.buttons["Egg"].tap()
          
   XCTAssert(app.staticTexts["It was the egg"].exists)
}

You can run the test by using the Command + U key combination.  
 
After running the test, which of course in this case will be successful (fingers-crossed for always successful tests), you would see this picture: 
 
Xcode7-TestSuccessful
 
The source code of this sample application is available at our GitHub repository
 
I recommend watching the WWDC lecture introducing the new UI testing feature.

Telerik Test Studio

When choosing the right tool for UI testing your mobile apps, it’s important to consider the team that will be maintaining the test suite, both short- and long-term. For technical quality teams, the code-centric approach found in Xcode may be all you need, however for teams that do not have "developers in test," there are some great options, one of which is offered by Telerik.
   
Telerik Test Studio gives enables you to record a test via device or emulator and execute it across multiple devices. Beyond the added velocity for testers in the creation of tests, there are tools that assist in test maintenance such as Test Studio's Element Repository. This repository  gives you the power to easily update the find logic of your objects, when a change in the application under test occurs. You can find more information about the tool here

Stay tuned for more information about how UI for iOS and Telerik Test Studio work together. 
 
Happy testing!

Download UI for iOS by Telerik

Your First tvOS Application with Telerik UI for iOS

$
0
0
It's easy to run Telerik UI controls on tvOS. Here's how.

Mobile operating systems are multiplying rapidly those days. But only a few are able to capture people's hearts and pockets, while others sink in oblivion despite the fact that behind them are mighty companies. So, it is interesting to see how Apple manages to multiply its list of operating systems. Their current count is now four: Mac OS, iOS, WatchOS and the latest addition tvOS. tvOS is not exactly a mobile OS, it is designed for our living room and runs only on the latest  generation Apple TV. However, it looks more similar to iOS than WatchOS from a developer perspective. All core frameworks like UIKit, CoreGraphics and even SpriteKit are available.

Like true Apple fans and contributors to the Apple ecosystem, we were quite eager to see if Telerik UI for iOS will run on tvOS. Despite some small gaps (like TKCalendar depending on EventKit, which is not part of tvOS) it proved to be easy to run our controls on tvOS. 

Telerik UI for iOS on tvOS

A comparison list with the frameworks ​for tvOS is available here.

So, to test how Telerik UI for iOS runs on tvOS, we quickly stripped the EventKit dependance and… let’s now see how to create our first “hello world” application with UI for iOS on the tvOS. 

Starting with tvOS is easy, if you know how to develop with iOS on iPhone or iPad. Just follow the steps below:
  1. Open Xcode, choose “Create a new Xcode project” and select tvOS from the list. You can decide between Game, Single View Application and Tabbed Application. In our case, we will use Single View Application. Creating a new tvOS project
  2. Give your project a name and choose Swift as your language. Of course, you can use Objective-C, but we will use Swift for this post.
  3. Create your project.
  4. Go to the Project Settings page and add a reference to the UI for iOS library by using the Linked Frameworks and Libraries dialog. You should use the Add other button and locate the framework in Telerik UI installation folder. Linked Frameworks and Libraries
  5. Xcode 7.1 has an issue with finding frameworks, so you should do one more step: add the path to Telerik UI framework explicitly in the Framework Search Paths property. Framework Search Paths
  6. Since we are using Swift, we should add an empty Objective-C class to bring up the Create Bridging Header dialog. Click the “Create Bridging Header” button when prompted; after that you can safely remove the unnecessary Objective-C class and its files.
  7. Open the bridging header file, and add a reference to Telerik UI: Bridging Header
  8. Open the ViewController.swift file and replace the viewDidLoad method with the following one: 
    override func viewDidLoad() {
         super.viewDidLoad()
         // Do any additional setup after loading the view, typically from a nib.
             
         let calendar = TKCalendar(frame: CGRectMake(1000, 100, 800, 800))
         self.view.addSubview(calendar)
           
         let chart = TKChart(frame: CGRectMake(100, 100, 800, 800))
         chart.legend().hidden = false
             
         var items = [TKChartDataPoint]()
         items.append(TKChartDataPoint(name: "Apple", value: 17.9))
         items.append(TKChartDataPoint(name: "Samsung", value: 24.4))
         items.append(TKChartDataPoint(name: "Lenovo", value: 6.5))
         items.append(TKChartDataPoint(name: "Huawei", value: 5.1))
         items.append(TKChartDataPoint(name: "LG", value: 4.5))
         items.append(TKChartDataPoint(name: "Xiaomi", value: 4.5))
         items.append(TKChartDataPoint(name: "Others", value: 37.2))
             
         let series = TKChartPieSeries(items: items)
         series.selectionMode = TKChartSeriesSelectionMode.DataPoint
         series.selectionAngle = -M_PI_2
         series.expandRadius = 1.2
         series.style.pointLabelStyle.textHidden = false
         chart.addSeries(series)
             
         self.view.addSubview(chart)
             
         chart.select(TKChartSelectionInfo(series: series, dataPointIndex: 0))
    }
  9. Build and run the project, and you should see the following screen: Chart for iOS on tvOS by Telerik
Voila! This is how easily you can run UI for iOS on the tvOS.

Of course, you can’t interact with tvOS the same way you do in iOS. The only interaction device you have is the Apple TV remote. As we learn more about tvOS and its interaction features, we will optimize our controls accordingly.

As usual, the complete source code of this project is available at our public ​GitHub repository.

That project would need a UI for iOS build with the EventKit dependance removed. We are considering shipping such a build in a future version. Let us know in the comment of the blog or the UI for iOS Feedback Portal if you need such a build to run on the tvOS.

With Q3 2015 release, we will ship AutoCompleteBox and Gauges components, as well as the official version of the DataForm component. Following the official release of Xcode 7 and iOS 9 along with Swift 2.0, our controls will be fully optimized for Swift 2.0.

Download UI for iOS by Telerik

Understanding the Three Types Of Analytics

$
0
0

In God We Trust. All others bring data.

W. E. Deming

The quote above (in original form) comes from a Quora post made by an ex-Amazon Employee who used to do analytics at the retail giant. It’s actually a paraphrase of something written right around 56-58 AD:

Yea, let God be true, but every man a liar; ...

Romans 3:4 NKJ

Not much has changed in the last few thousand years, it seems.

In the Quora post, the ex-Amazoner goes on to tell a story about a project he worked on where Amazon was trying to determine which books were textbooks and which ones were not. They didn’t want to accidentally put standard books in the textbook store as it would cost them additional and unnecessary money to do so. When you consider the scale of books that Amazon deals with, and the fact that there is no simple way to accurately differentiate a Micro-Biology book from a piece of Twilight fan fiction, analytics is the only answer.

Analytics is defined as the ability to identify patterns in data, then take measureable action.

In Amazon’s case, they had to apply statistical concepts and rigerous analysis of the data. However, their work resulted in a better Textbook Store and, therefore, a better buying experience for students.

When the buying experience is better, people do more buying.

Unfortunately, Analytics is hard. Not only is it hard, but it’s also often reactionary. In other words, nobody cares about the data until there is a problem, and then people want to know why RIGHT NOW.

This is more true today than ever before. Why? Because we know more about people than ever before. Most people are carrying a mobile device that knows an awful lot them; their location, their friends, where they go on the Internet--even how fast their heart is currently beating.

If you’re doing mobile development, some or all of this data will flow into your application in one way or the other. The question is whether or not you are going to be able to identify patterns in that data, and, more importantly, know what actions to take.

In this article, I’ll break down the three core types of analytics that will be essential for creating successful mobile applications.

The Three Types of Analytics

In the webinar “Building An App In 60 Minutes,” Todd Anglin goes through the three different types of anlaytics that mobile app developers need to be able to adequately store and dissect:

  • Quantitative
  • Qualitative
  • Marketing

Check out this quick clip from the webinar…

Now, these are not definitive categorizations for all types of analytics, but rather a high-level grouping of the different kinds of data that developers are most often interested in collecting. The most popular and best known of these categories is Quantitative Analytics.

Quantitative

If you’ve ever had a website, you have most likely used quantitative analytics. These would be your standard Google Analytics or StatCounter data. It’s how many people are coming to your site, where are they going on your site and how long they stick around before leaving to go watch funny videos of people falling down on YouTube.

For mobile applications, quantitative analytics are non-negotiable. You have to have them.

For example, you may have a bug in your app that causes it to crash on every device after it’s installed. If you’ve ever downloaded an app, you know this happens more often than it should. In that case, one million downloads would result in one million one-star reviews. One-star reviews are not a good way to find bugs in your apps. At that point, the user has already bailed and is probably not coming back. Remember that wierd dandruff commericial about only having one chance to make a first impression?

Perhaps your app is internal and not going to an app store. You still want the same data. Usually it’s to justify the cost behind expanding on certain features of an application. For instance, lets say a certain department requests an expensive, time-consuming and soul-sucking enhacement to an existing application. Without quantitative analytics, there is no way to know whether or not there will be any ROI on that new feature. With those analytics, it’s easier to ensure you’re investing development time in building the right features and not just collecting technical debt.

Out of the box, Telerik Platform provides a quantitative analytics solution for applications.

new-analytics

You can actually use Telerik Analytics on any type of application: web, mobile, desktop and even Windows COM.

analytics-type

The
kind of quantitative information Telerik Analytics can give you is exhaustive. Here is one of my dashboards from an actual application I wrote.

my-dashboard

Yikes! I’m trending down 81%! Let’s take a look at some of this data closer. In my application, I have both desktop and mobile views. Notice, though, that nobody is visiting this site on a screen smaller than 1440 x 900

big-screens

That means that I can probably write​ off the need to do further development on the mobile aspect. Either that, or I need to make sure the application actually loads on a mobile device.

Analytics dashboards are completely customizable, and you can even do crash reporting and see live activity in the application. (I just don’t have any to show you because my app never crashes and nobody ever uses it.)

Qualitative Analytics

The second type of analytics allows users to have a much more direct line of feedback. These are qualitative analytics.

Remember the last time you went to Taco Bell? I mean before all the self-loathing set in.

One of the biggest regrets of my life is eating Taco Bell about 30 minutes ago

— Burke H✪lland (@burkeholland) June 10, 2015

The last time I ate at Taco Bell, they gave me a receipt and said, “Call this number and take this survey and you might win $500.” Now why would they offer me $500 to tell them what I think of their restaurant and food? Because they are collecting qualitative analytics, and these numbers are worth far more than a measly $500.

Qualitative analytics is feedback directly from users and customers to you. Often that feedback is delayed. You will get qualitative feedback whether you want it or not. If you don’t ask for it, you will get it in the form of one-star reviews or angry calls to customer service.

In the case of software, we have a unique opportunity to collect qualitative analytics immediately. Devices are connected (occasionally), so we can offer users or testers the ability to give instant feedback. The Telerik Platform also offers a completely qualitative analytics solution called App Feedback.

App Feedback

App Feedback enables users (usually testers) to use your application then give immediate feedback complete with annotation. Once App Feedback is enabled for your application, all the user has to do is shake the device and a screenshot will be taken of the current screen. The user can then tap the screen to drop a marker, then enter more detailed feedback.

feedback

That feedback then flows through to my App Feedback dashboard where I can take action on it, reply to it and have my replies go all the way back through to users on their devices.

Qualitative analytics help you iterate faster on your application, so you know about bugs and poorly designed features BEFORE you go to production. In other words, the more qualitative analytics you collect, the less quantitative analytics you will have to dissect when it comes to crash reports.

Marketing Analytics

The last type of analytics that Todd talks about, are marketing analytics. If you’re a developer, your eyes may glaze over or roll back in your head at the sound of the word “marketing.” However, marketing analytics can make some of the heaviest impact on whether or not your application is successful in it’s goal, especially if that goal is tied to revenue.

Marketing analytics can be thought of as a way to test certain parts of your application with different users to gauge the response. The most popular type of testing for marketing analytics is known as “A/B” testing.

A/B Testing

Amazon is a treasure trove of data stories. In his post, “Early Amazon Shopping Cart,” Greg Linden talks about his ideas to provide users with “Recommended Products” when they went to checkout. The idea is that buyers often make impulse buys right before a pre-medidated purchase. This is why there is a bunch of crap you don’t need right by the cash register in the grocery store.

In Amazon’s case, they were in a tricky spot. One of the biggest problems for online retailers is shopping cart abandonment. In a physical retail location, it’s difficult for you to walk your cart all the way to the cash register, and then change your mind and just abandon it. That’s probably culturally rude and you rarely ever see it done. Online, you can just bail whenever you feel like it.

Amazon executives were worried that showing people recommended products at checkout would distract from the primary goal, which was to get the customer to check out in the first place. So what did they do? The A/B tested it. A small segment of customers got recommended products and the rest did not. Amazon learned not only did buyers complete the purchase process, but they frequently bought the recommended products, as well, and Amazon rushed to roll the feature out to everyone.

The Truth Shall Set You Free

To successfully act on analytics, you have to have the data ​for which to identify patterns. If you are currently working with production code that has no or very rudimentary analytics, it’s the digital equivalent of hiring someone to do a job, then never checking back with them again. Did they do the job? Maybe, maybe not. But the only way you’re going to find out is the hard way.

You can add qualitative and quantitative analytics to your applications today with Telerik Analytics and Telerik Feedback. Do a little A/B testing, and you’re well on your way to being able to not just build a mobile app, but build the right mobile app.

Telerik Kendo UI Q3 2015 Beta Preview is Out

$
0
0

In case you are one of these people who love to experiment with early bits and be the first to get your hands on preview features and functionality in Kendo UI framework, I have news for you! The 2015 Q3 Beta Preview of the product is already out in the wild, and now is your opportunity to grab the preview and tinker with it.

And to make things even more adventurous and thrilling to you, ​I won't reveal any details about what's in the Q3 Preview, ​so you'll need to figure that out yourself. ​A ​couple of helpful pointers would be ​the Beta demos and ​the Q3 roadmap blog post.

If you are an active Kendo UI trial or commercial license holder, you can find the Q3 Preview in​ the Telerik Web Installer (Control Panel). ​

TelerikControlPanel

Take into account that it is also available for our Telerik UI for ASP.NET MVC, Telerik UI for JSP and Telerik UI for PHP products, as well, including wrappers for the corresponding server-side technology.

Here's the action plan for you:

  • Try the Q3 Beta Preview and explore our Q3 Beta demos and docs.
  • Expect the official bits in two weeks time (September 30).
  • Be on the watch for the Q3 Release Webinar following a month after the official release (early November). A webinar promotion will be relayed soon.

Where to Share Feedback?​

​We ​are eager to collect your input regarding this Beta Preview version, which will influence the final RTM release. After you play with the bits and explore the resources, ​you can voice it in our forumssupport system or directly in the comments of this blog post.

Getting Your Local Environment Set Up to Develop Mobile Apps

$
0
0

Remember when you were a junior developer and you were given your first project? You had your shiny new company computer and were told that a new piece of software had to be produced within a given time frame. How did you get started developing it? Maybe you had a corporate onboarding experience, and everything came set up on your computer. Maybe you were sent with a budget to the Apple Store and got a nice new Mac with nothing installed. In either scenario, at some point you have probably been in the situation where you had a software project to deliver, but did not have an environment ready to meet the requirements to deliver it. Initializing...install fest, right?

static1.squarespace.jpg

image courtesy of DaVinci Coders

The new mobile developer may find him or herself feeling the same sense of frustrated exhilaration when handed a mobile project to develop. Even a seasoned developer in the constantly changing mobile space might get a little confused when faced with the choices of development tooling for mobile apps. Can you use your current favorite toolset? Do you need to learn new software to create ​the app? Can your current machine even handle it?

To narrow down the swirling questions, here is a useful checklist:

  • What kind of mobile app will you be developing: native, hybrid or something else?
  • What is your current preferred method of development. Does your current setup facilitate mobile development?
  • Are you comfortable using the command line? Or do you prefer to work in a browser, using an IDE toolset like Visual Studio or Eclipse? Or, do you prefer using a text editor?
  • What is the app destined for--one particular device exclusively or a mix of Android, Windows Phone and iOS?

No matter how you answer the four questions in the checklist, the good news is Telerik AppBuilder can support your mobile app development requirements. In our recent webinar, "Let's Build an App in 60 Seconds," we discussed the ways AppBuilder can make your life a lot easier as a mobile developer.

Because the machine ​you're using for mobile development is different from the one your end users will use to access the final product, there is a curious disjunction between your work and your user's interaction with it. This calls for a somewhat complex setup that will possibly require:

  • A special configuration of your local machine
  • A virtual machine, if you are a Windows user needing to support iOS apps or a Mac user developing a Windows app
  • Hardware for debugging (simulators and emulators are helpful, but, eventually, you will need to test on-device)
  • A way to test on myriad end user devices

AppBuilder offers three primary ways of developing a mobile app: within a browser, using an IDE with AppBuilder plugins and via the command line. Once you choose your primary method of development, you aren't locked into using just one. For example, my typical workflow when building a hybrid mobile app is:

  1. Create the app using the AppBuilder command line, and push the code to Github periodically.
  2. Continue to develop on my local computer using Sublime Text with the AppBuilder plugin.
  3. Frequently check my work locally using the AppBuilder simulator.
  4. Deploy to device when more extensive testing is required, using the AppBuilder companion app.
  5. Build an app package for iOS and Android and deploy to device using a locally-stored provisioning profile.
  6. When almost ready to move to the app stores, create a project in the in-browser toolset in Telerik Platform and sync my Github repo. Polish the app's assets, such as icons and splash screens, and import them to Telerik Platform. Once the app store submission is ready, publish from Telerik Platform.

Let's take a look at these three modes of development:

Develop In the Browser

After signing in to your account on Telerik Platform, you can create an app in the browser:

Screenshot 2015-08-14 13.40.52.png

AppBuilder offers a wide variety of ways to scaffold your app, whether hybrid using a framework such as Kendo UI Mobile, or a Native app using NativeScript. You can start fresh or import code from a repository. Try the powerful ScreenBuilder toolset to scaffold a great-looking app:

Screenshot 2015-08-14 13.41.47.png

Use the in-browser simulator to get a view of what you are building, and test scenarios such as loss of connectivity and location changes. You can also use browser-based developer tools, such as the console, to debug.

Screenshot 2015-08-14 13.45.20.png

The in-browser toolset provides a powerful way for an individual or team to build a mobile app from start to finish.

Develop Using Your Favorite IDE

If you prefer not to work in a browser, you have plenty of other options.

Visual Studio users can use the AppBuilder Visual Studio Extension to be able to use this great environment.

vsix-overview-8.png

Sublime Text users can use the AppBuilder Sublime Plugin to ease development.

sublime-overview-2.png

The standalone Windows client offers a desktop app environment for app development.

winc_overview.png

Develop Using the CLI

Scaffolding an app on your local computer is extremely easy when working straight from the command line. Open your Terminal on a Mac machine, or the Command Prompt on a Windows machine, and use npm (Node Package Manager) to install AppBuilder locally:

$ npm install -g appbuilder

Type appbuilder -h to view all the commands available to you:

Screenshot 2015-08-14 15.11.23.png

A combination of a text editor and the CLI can get you from zero to app stores in a very efficient way. For the more advanced user who likes minimal tooling, this may the solution that will work for you.

Test On-Device

Once you have completed some development and are ready to start testing on a device, you will need to make sure your test devices are ready for the process. A streamlined way to test on-device is by means of the AppBuilder Companion App. This system is available for iOS, Android and Windows Phone, and ​enables you to distribute your app to testers ​using barcodes, without having to provision test devices.

If you need to test your app on a larger group of devices, you can provision your testers' devices within AppManager, a tool available in Telerik Platform, to create a test group of provisioned devices and distribute versions of your app prior to publication of the version to the app stores. Using LiveSync on AppManager is a particularly powerful way to distribute hot fixes to your app without requiring your test users to perform a fresh download.

Let's Get to Work!

A tremendous number of decisions about building a mobile app ​must be answered, even before you write a line of code. It's great there are tools available ​to simply let you do what you do best--code--while supporting your efforts throughout the app lifecycle.

Set Your Appointments with Calendar for Xamarin.Forms

$
0
0
Scheduling-based scenarios are quite popular for the mobile environment, in which ​the end-user is on the go and needs to check what’s next on his schedule, immediately, without ​accessing his desktop machine. 

In this blog post, we will guide you through the steps of using the RadCalendar component from the Telerik UI for Xamarin suite, explaining key concepts and terms. For this purpose, we will create a simple demo application using the RadCalendar.

Application Requirements, End-User Capabilities and Raw Design

Let’s say we need an appointment-visualizing application the enables users​ to view, create and delete appointments. To accomplish this, we will use the RadCalendar to visualize the appointments. Alongside the calendar, we will expose two buttons. One for creating and one for removing appointments. 
calendar-rawlayout

The creation/removal itself will be triggered from separate pages. 

Setting Up a Blank Solution with a Ready-to-Use Template

To set up a solution, we will start by creating a blank application. We will use the Blank App (Xamarin.Forms Portable) template provided by Xamarin. This template shares code using a portable class library. Let's name the project X_Calendar.
calendar-newproject

Visual Studio will create the basic structure of the solution for us, including three platform-specific projects and one portable class library.

calendar-solution

The portable project will hold everything that can be shared between the different platforms. The rest of the projects will use the platform-specific code, such as custom renderers. 

Installing NuGet packages

After having the set up solution, we can start installing the necessary NuGet packages. For every project in the solution, we need to update the Xamarin.Forms NuGet Package to the latest version.

The Android platform requires installation of the following additional packages:
  • Xamarin Support Library v4
  • Xamarin Support Library v7 RecyclerView
  • Xamarin Support Library v8 RenderScript
  • Xamarin Support Library v7 AppCompat
The last two are needed by the RadCalendar specifically. Xamarin Support Library v4 is needed by Xamarin.Forms in all cases.

Installing the packages can be done through the Package Manager Console. You can navigate to it from the main menu >> View >> Other Windows >> Package Manager Console.

calendar-packagemanagerconsole

In the console first select X_Calendar.Droid project:

calendar-PMC

Then, execute the following commands:
  1. Install-Package Xamarin.Android.Support.v7.AppCompat
  2. Install-Package Xamarin.Android.Support.v7.RecyclerView
  3. Install-Package Xamarin.Android.Support.v8.RenderScript
The console should report that every package is successfully installed.

Adding the Necessary References

Next, we can proceed with referencing the required assemblies in our solution. Each of the platform-specific projects should refer to the following:
  • Binaries consisting of the Telerik UI for Xamarin components
  • Binaries consisting of Managed Callable Wrappers for the native components
  • Binaries consisting of the Telerik renderers for the components
The names of the binaries consisting of Managed Callable Wrappers for the native components start with Telerik.Xamarin.[platformName]. The binaries consisting of the UI for Xamarin components start with Telerik.XamarinForms. Last but not least, renderers’ binaries are named after the native binary holding the respective UI component, followed by Renderer.[platformName]. They are part of the UI for Xamarin suite, so their full name is Telerik.XamarinForms.[nameOfBinary]Renderer.[platformName].

Having this information in mind, we will need to add references to the following binaries in our solution:
  • In the Portable project:
    • Telerik.XamarinForms.Input.dll
    • Telerik.XamarinForms.Common.dll
  • In the Android project:
    • Telerik.Xamarin.Android.Common.dll
    • Telerik.Xamarin.Android.Input.dll
    • Telerik.Xamarin.Android.Primitives.dll
    • Telerik.XamarinForms.Common.dll
    • Telerik.XamarinForms.Input.dll
    • Telerik.XamarinForms.InputRenderer.Android.dll
  • In the iOS project:
    • Telerik.Xamarin.iOS.dll
    • Telerik.XamarinForms.Input.dll
    • Telerik.XamarinForms.InputRenderer.iOS.dll
    • Telerik.XamarinForms.Common.dll
  • In the WinPhone project:
    • Telerik.Windows.Controls.Input.dll
    • Telerik.Windows.Controls.Primitives.dll
    • Telerik.Windows.Core.dll
    • Telerik.XamarinForms.Input.dll
    • Telerik.XamarinForms.InputRenderer.WinPhone.dll
    • Telerik.XamarinForms.Common.dll

What are Renderers and Wrappers?

Before registering the renderers, it may be a good idea to have few words about the UI for Xamarin suite and the provided renderers. What they are and where their place is?
Each renderer is simply a class deriving from Xamarin.Forms’ ViewRenderer class. This derived class updates the Xamarin component based on the native one and vice versa. In other words, the renderers, together with the callable wrappers, are the “glue” between the native components and the Xamarin UI. If you need to dig deeper into this, you can refer to Xamarin’s Custom Renderers as well as the Architecture articles.

Registering the Required Telerik Renderers

Having this in mind, we can proceed with coupling the provided renderers with the Xamarin UI. This should be done for each of the platforms separately.

Android

In Android we need to add the following code right after the using statements of the MainActivity class:

[assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(Telerik.XamarinForms.InputRenderer.Android.CalendarRenderer))]

The MainActivity.cs file should look similar to this:

[assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(Telerik.XamarinForms.InputRenderer.Android.CalendarRenderer))]
 
namespaceX_Calendar.Droid
{
    [Activity(Label = "X_Calendar", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    publicclassMainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
    {
        protectedoverridevoidOnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
 
            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(newX_Calendar.App());
        }
    }
}

iOS

We can continue to the iOS project. The following code should be added in the AppDelegate class:

[assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(Telerik.XamarinForms.InputRenderer.iOS.CalendarRenderer))]

The AppDelegate.cs file should look similar to this:

[assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(Telerik.XamarinForms.InputRenderer.iOS.CalendarRenderer))]
 
namespaceX_Calendar.iOS
{
    [Register("AppDelegate")]
    publicpartialclassAppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
    {
        publicoverrideboolFinishedLaunching(UIApplication app, NSDictionary options)
        {
            newTelerik.XamarinForms.InputRenderer.iOS.CalendarRenderer();
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(newX_Calendar.App());
 
            returnbase.FinishedLaunching(app, options);
        }
    }
}

Windows Phone

In the WinPhone project we need to add the following code in the MainPage.xaml.cs file:

[assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(Telerik.XamarinForms.InputRenderer.WinPhone.CalendarRenderer))]

It should look like this:

[assembly: Xamarin.Forms.ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(Telerik.XamarinForms.InputRenderer.WinPhone.CalendarRenderer))]
 
namespaceX_Calendar.WinPhone
{
    publicpartialclassMainPage : global::Xamarin.Forms.Platform.WinPhone.FormsApplicationPage
    {
        publicMainPage()
        {
            InitializeComponent();
            SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;
 
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(newX_Calendar.App());
        }
    }
}

Defining the Appointment Class and Collection

Before creating the necessary screens, we should define the Appointment class and the collection that holds our list of appointments.
 
Defining the Appointment Class 

As you would expect, the Appointment class should have
at least StartDate, EndDate and Title, so let's define it this way :

usingTelerik.XamarinForms.Input;
 
namespaceX_Calendar
{
    publicclassAppointment : IAppointment
    {
        publicDateTime EndDate
        {
            get;
            set;
        }
 
        publicDateTime StartDate
        {
            get;
            set;
        }
 
        publicstringTitle
        {
            get;
            set;
        }
    }
}

Defining the Appointments Collection

For this part, let’s define a static field which holds all the appointments visualized in the RadCalendar component:
   
namespaceX_Calendar
{
    publicstaticclassMyStaticFields
    {
        publicstaticObservableCollection<Appointment> Appointments;
    }
}

All three pages will interact with this field, which is why we decided to define it as static. The static classes provide easy access to resources from multiple points.

Creating the Raw Layout

After creating the blank application, referencing the correct binaries and registering the renderers we are done with setting up the solution. Now we can focus on implementing the earlier mentioned raw layout of the application. For this purpose, we will create a Forms Xaml Page, which will host a Grid panel with three rows--one for each button and one for the RadCalendar.
<?xmlversion="1.0"encoding="utf-8"?>
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:telerik="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
             x:Class="X_Calendar.AppointmentsPage">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition>
        <RowDefinition.Height>
          <OnPlatformx:TypeArguments="GridLength">
            <OnPlatform.iOS>30</OnPlatform.iOS>
            <OnPlatform.Android>50</OnPlatform.Android>
            <OnPlatform.WinPhone>70</OnPlatform.WinPhone>
          </OnPlatform>
        </RowDefinition.Height>
      </RowDefinition>
      <RowDefinition>
        <RowDefinition.Height>
          <OnPlatformx:TypeArguments="GridLength">
            <OnPlatform.iOS>30</OnPlatform.iOS>
            <OnPlatform.Android>50</OnPlatform.Android>
            <OnPlatform.WinPhone>70</OnPlatform.WinPhone>
          </OnPlatform>
        </RowDefinition.Height>
      </RowDefinition>
      <RowDefinitionHeight="*"/>
    </Grid.RowDefinitions>
    <ButtonGrid.Row="0"Text="Add Appointment"Clicked="AddButtonClicked"/>
    <ButtonGrid.Row="1"Text="Delete Appointment"Clicked="DeleteButtonClicked"/>
    <telerik:RadCalendarGrid.Row="2"x:Name="calendar"/>
  </Grid>
</ContentPage>

For the navigation between the different pages, we will use the built-in navigation mechanism. We'll need to use the NavigationPage. In the constructor of our application, we will set the MainPage to a NavigationPage like this:

publicApp()
{
    // The root page of your application
    MainPage = newNavigationPage(newAppointmentsPage());
}

In the code behind of our AppointmentsPage, we will also use the same navigation mechanism.

usingTelerik.XamarinForms.Input;
 
namespaceX_Calendar
{
    publicpartialclassAppointmentsPage : ContentPage
    {
        staticAppointmentsPage()
        {
            MyStaticFields.Appointments = newObservableCollection<Appointment>() { newAppointment() { StartDate = DateTime.Now.AddDays(-1), EndDate = DateTime.Now.AddDays(-1).AddMinutes(1), Title = "Call Steve"} };
            MyStaticFields.Appointments.Add(newAppointment() { StartDate = DateTime.Now, EndDate = DateTime.Now.AddMinutes(1), Title = "Tickets"});
            MyStaticFields.Appointments.Add(newAppointment() { StartDate = DateTime.Now.AddDays(3), EndDate = DateTime.Now.AddDays(3).AddMinutes(1), Title = "Travel"});
        }
 
        publicAppointmentsPage()
        {
            InitializeComponent();
 
            this.calendar.AppointmentsSource = MyStaticFields.Appointments;
        }
 
        protectedoverridevoidOnAppearing()
        {
            base.OnAppearing();
        }
 
        voidAddButtonClicked(objectsender, EventArgs e)
        {
            Navigation.PushAsync(newAddAppointmentPage(), true);
        }
 
        voidDeleteButtonClicked(objectsender, EventArgs e)
        {
            Navigation.PushAsync(newDeleteAppointmentPage(), true);
        }
    }
}

This completes the raw layout of our application.

Create a Page to Add an Appointment

Next, we will create a page ​to add an appointment. This page should allow the user to populate the properties of an Appointment​: StartDate, EndDate and Title.

To ​enable the user to fill in these properties, we can use two DatePickers and one Entry. To arrange them on the page, we will use a combination of StackLayouts like this:

<?xml version="1.0"encoding="utf-8"?>
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="X_Calendar.AddAppointmentPage">
  <StackLayout>
    <Label Text="Add Appointment Page"FontSize="30"VerticalOptions="Center"HorizontalOptions="Center"/>
    <StackLayout Orientation="Horizontal">
      <Label Text="Start: "/>
      <DatePicker x:Name="startDatePicker"HorizontalOptions="StartAndExpand"/>
    </StackLayout>
    <StackLayout Orientation="Horizontal">
      <Label Text="End: "/>
      <DatePicker x:Name="endDatePicker"HorizontalOptions="StartAndExpand"/>
    </StackLayout>
    <StackLayout Orientation="Horizontal">
      <Label Text="Title: "/>
      <Entry x:Name="title"WidthRequest="150"/>
    </StackLayout>
    <Button Text="Done"Clicked="DoneButtonClicked"VerticalOptions="Center"HorizontalOptions="Center"/>
  </StackLayout>
</ContentPage>

The code behind this page handles the button click event and, based on the user selection, creates an appointment.
   
publicpartialclassAddAppointmentPage : ContentPage
{
    publicAddAppointmentPage()
    {
        InitializeComponent();
    }
 
    voidDoneButtonClicked(objectsender, EventArgs e)
    {
        MyStaticFields.Appointments.Add(newAppointment()
        {
            StartDate = startDatePicker.Date,
            EndDate = endDatePicker.Date.AddSeconds(1),
            Title = title.Text == null? "(No Title)": title.Text
        });
 
        Navigation.PopAsync(true);
    }
}

Create a Page to Delete an Appointment

Now we proceed with creating a page that will enable the user to delete an appointment. To visualize all available appointments, it should be able to get them and list them in a ListView component. After that, a button click will delete the user selection. To achieve this, we will use a ListView and a Button components like this:

<?xmlversion="1.0"encoding="utf-8"?>
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="X_Calendar.DeleteAppointmentPage">
  <StackLayout>
    <LabelText="Delete Appointment"FontSize="30"VerticalOptions="Center"HorizontalOptions="Center"/>
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinitionHeight="50"/>
        <RowDefinitionHeight="*"/>
        <RowDefinitionHeight="50"/>
      </Grid.RowDefinitions>
      <LabelText="Select appointment to delete"/>
      <ListViewx:Name="list"Grid.Row="1">
        <ListView.ItemTemplate>
          <DataTemplate>
            <TextCellText="{Binding Title}"/>
          </DataTemplate>
        </ListView.ItemTemplate>
      </ListView>
      <ButtonText="Done"Clicked="DeleteButtonClicked"Grid.Row="2"/>
    </Grid>
  </StackLayout>
</ContentPage>

The code behind this page will handle the click of the button, which will delete the selected appointment like this:

publicpartialclassDeleteAppointmentPage : ContentPage
{
    publicDeleteAppointmentPage()
    {
        InitializeComponent();
 
        this.list.ItemsSource = MyStaticFields.Appointments;
    }
 
    voidDeleteButtonClicked(objectsender, EventArgs e)
    {
        MyStaticFields.Appointments.Remove((Appointment)this.list.SelectedItem);
        Navigation.PopAsync();
    }
}

​That's it! Now run the project and add a few appointments. Thanks to the underlying native Calendar components coming from UI for iOS, UI for Android and UI for Windows Phone, you get the look and feel appropriate for each platform:

calendar-all

You can find the complete project at GitHub. Of course, to run it, you need to download Telerik UI for Xamarin.

Happy coding!

How to Create ListView with Groups and Parallax Effect

$
0
0

When you view the screen of an app in Google Play, that’s exactly what you see–a meaningful transition from image to app bar, which happens as a response to user input–scrolling down. This particular transition is called a parallax effect, and this blog post will show you how to add it to your application.

The Android 5.0 Lollipop release–the most significant Android release ever–introduced Material Design, which refreshed the entire Android experience. An important part of the Material Design is the Responsive Interaction. It encourages deeper exploration of an app by creating timely, logical and delightful reactions to user input. Another important aspect is the use of meaningful transitions between view states in a way that presents the information according to what is most important for the user right now. One way to do this is by using the parallax effect.

Here, we ​will demonstrate the Parallax effect using a list of items, shown in groups by Telerik ListView for Android.


Parallax Effect with List View

We are going to use Android Studio for this post, but the same idea can be applied within your preferred IDE. Create a new app and add the aar files necessary for the ListView, part of Telerik UI for Android, to the libs folder of your application (the files are Common, Data and List). Then, add the following dependencies to your app’s build.gradle file:

compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile(name: 'Common', ext: 'aar')
compile(name: 'Data', ext: 'aar')
compile(name: 'List', ext: 'aar')

The design reference is necessary for the recently introduced Android Design Support Library, which contains a lot of helpful widgets for achieving the expected Material Design behaviors. One of these widgets is the CoordinatorLayout, which provides an additional level of control over touch events between child views. It has to be the first element inside the main layout of your activity:

<android.support.design.widget.CoordinatorLayout   
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
</android.support.design.widget.CoordinatorLayout>

For many of the features of material designs app bar concepts, namely scrolling gestures, the Design Library provides the AppBarLayout. It depends heavily on being a direct child of the coordinator layout, so we'll add it as a direct child to the layout that we just added:

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="240dp"
    android:fitsSystemWindows="true"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
</android.support.design.widget.AppBarLayout>

The height we have set reflects the maximum height this layout will consume when the image is expanded. Our coordinator layout will have one more child, which will be the scrollable view–in our case, ​the ListView:

<com.telerik.widget.list.RadListView
    android:id="@+id/myList"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

Pay attention to the layout_behavior attribute we have set. This is also a requirement of the AppBarLayout–to have a sibling whose scrolling it will "listen" to. We are also going to need a Toolbar and an ImageView to collapse when we scroll, but to do the collapsing, we will add a CollapsingToolbarLayout inside the AppBarLayout we already have:

<android.support.design.widget.CollapsingToolbarLayout
    android:id="@+id/collapsing_toolbar_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    app:contentScrim="?attr/colorPrimary"
    app:layout_scrollFlags="scroll|exitUntilCollapsed">
</android.support.design.widget.CollapsingToolbarLayout>

The layout_scrollFlags attribute is a requirement of the AppBarLayout, ​because it needs to know how to scroll its children, depending on the scroll events it receives. The possible values include scroll (to scroll off screen), enterAlways (downward scrolls return the view), enterAlwaysCollapsed (the view will enter on its minimal height, if declared) and exitUntilCollapsed (the view collapses before it exits). Now we are ready to add the Image and the Toolbar as children of the CollapsingToolbarLayout:

<ImageView
    android:contentDescription="@string/content_description"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:scaleType="centerCrop"
    android:src="@drawable/telerik"
    app:layout_collapseMode="parallax"/>
 
<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    app:layout_collapseMode="pin"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>

These views should define their layout_collapseMode-s so they respond in accordance with the CollapsingToolbarLayout’s events. The value pin means the Toolbar will remain pinned, while the parallax value for the ImageView speaks for itself. 

Now let’s go the code for the activity ​using this layout. ​We will need a few lines to set up the toolbar as a support action bar:

setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
ActionBar actionbar = getSupportActionBar();
if(actionbar != null) {
    actionbar.setDisplayHomeAsUpEnabled(true);
}

And another few lines to set up the ​ListView with its grouping:

RadListView listView = (RadListView)findViewById(R.id.myList);
ListViewDataSourceAdapter adapter = newListViewDataSourceAdapter(getData());
adapter.addGroupDescriptor(newFunction<Object, Object>() {
    @Override
    publicObject apply(Object object) {
        Entity entity = (Entity)object;
        returnentity.category;
    }
});
listView.setAdapter(adapter);

The getData method simply returns a populated list of Entity objects. The group descriptor defines grouping for the list by the value of the category of the Entity. And that's it​; when you run the app, you should have the behavior from the image in the beginning of the post. Here’s the source code of the app.

Exporting HTML From Web App to Image

$
0
0

Getting data off the screen using basic web building blocks such as HTML and JavaScript can be a daunting task. However with the right tools, adding export features to your application can be as simple as a few lines of code.

Exporting HTML From Web App to Image

Building rich applications that include charts, maps and schedules can empower users by giving them the ability to visualize data. And, having a visually rich app can often leave users asking to take visual elements off the screen to be used elsewhere. Moreover, being able to export elements from an application to image or PDF opens up new possibilities such as social sharing, embedding in reports or even satisfying SOX audit requirements.

With the right tools, you can easily get data off the screen using web building blocks such as HTML and JavaScript. Let's find out how.

Choosing Your Tools

Kendo UI Professional, Telerik UI for ASP.NET MVC and Telerik UI for ASP.NET AJAX are all capable of WYSIWYG exporting HTML to popular image formats, SVG and PDF. This is because they all use the Kendo Drawing API to make the magic happen. The export functionality isn’t exclusive to Telerik UI controls either; any HTML element, including the entire page, can be WYSIWYG-exported by the tools.

Project TypeExport Tool
.NET Web FormsClient Export Manager
HTML / MVCKendo Drawing API

Exporting from ASP.NET Web Forms

The RadClientExportManager control for ASP.NET AJAX enables you to export whole pages or specific HTML elements to image, PDF and SVG in a WYSIWYG manner. In addition, muti-page PDF exporting options are available for further document customization.

Let’s take a look at some code and see how the RadClientExportManager is used in a project. In this example we’ll use the multi-page PDF feature to export recipes from a RadMultiPage.

export pdf cookbook

<telerik:RadMultiPagerunat="server"ID="RadMultiPage2"SelectedIndex="0"CssClass="innerMultiPage">
  
    <telerik:RadPageViewrunat="server"ID="PageView1"
        CssClass="recipePage">
            ... recipe ... 
    </telerik:RadPageView>
     
    <telerik:RadPageViewrunat="server"ID="PageView2"
        CssClass="recipePage pageBreak">
            ... recipe ... 
        </telerik:RadPageView>
         
    <telerik:RadPageViewrunat="server"ID="PageView3"
        CssClass="recipePage pageBreak">
            ... recipe ... 
        </telerik:RadPageView>
     
    <telerik:RadPageViewrunat="server"ID="PageView4"
        CssClass="recipePage pageBreak">
        ... recipe ... 
        </telerik:RadPageView>
 
</telerik:RadMultiPage>

We start by adding the RadClientExportManager control the page. ​Because we’ll be exporting to multiple pages, the PageBreakSelector property must be set to the CSS class .pageBreak to tell the client export manager where each new page begins. We’ll also include settings for paper size, margins and select portrait orientation.

<telerik:RadClientExportManagerrunat="server"ID="RadClientExportManager1">
<PdfSettingsPageBreakSelector=".pageBreak"
  MarginRight="10mm"
  PaperSize="A5"
  Landscape="true"
  MarginBottom="10mm"
  MarginTop="10mm"
  MarginLeft="10mm"/>
</telerik:RadClientExportManager>

Next, we’ll create a JavaScript function ​locating the desired HTML element, and pass it to the RadClientExportManager. Using a jQuery selector, we’ll get the element ​to be exported, $telerik.$(".innerMultiPage").

<script>
    functionexportAllRecipes() {
        //Find the client export manager
        varcem = $find("<%=RadClientExportManager1.ClientID%>");
         
        //call export PDF and pass the element using a jQuery selector
        cem.exportPDF($telerik.$(".innerMultiPage"));
    }
</script>

The last step is to add a button so the client can trigger the export. Setting the OnClientClicked event to the exportAllRecipes function will invoke the function on the client.

<telerik:RadButtonrunat="server"
    OnClientClicked="exportAllRecipes"
    Text="Export All Recipes to PDF"
    AutoPostBack="false"
    UseSubmitBehavior="false">
</telerik:RadButton>

Clicking the buttons will prompt the user to download the exported data to a nicely formatted PDF file, built from the application.

pdf exported

You can see more RadClientExportManager demos by visiting the UI for ASP.NET AJAX demo site, or start a 30-ay free trial .

Exporting from HTML or ASP.NET MVC

Using the Kendo Drawing API, exporting HTML to image or PDF from a web application requires just a few lines of JavaScript. Just as the aforementioned RadClientExportManager, the Kendo UI Drawing API is capable of screenshot-quality exports from within a web application. Everything from basic HTML to the rich data visuals available in Kendo UI framework, including custom chart visuals, can be taken outside the application for sharing, embedding and emailing.

Let’s look at how to export a Kendo UI map element using the Drawing API. In this example, we’ll export a map ​containing a custom visuals layer on top. Since the custom layer of visuals is contained within the map element, it, too, will be exported, along with the map itself.

map-export

First, we’ll create a function responsible for doing the export.

function exportMap() { }

Inside the exportMap function, we’ll need to get the HTML element we want to export. We can do this using a jQuery selector to select the map element by id $("#map").

//Get the HTML to export
varelementToExport = $("#map");

Using the drawing.drawDOM function, we'll draw a DOM element into a drawing.Group, which you can then render as PNG, SVG, PDF and even multi-page PDF. In this example, we’ll export the image to PNG by calling exportImage. Once the export is complete, we’ll prompt the user to save the file using kendo.saveAs.

// Convert the DOM element to a drawing using kendo.drawing.drawDOM
kendo.drawing.drawDOM(elementToExport)
.then(function(group) {
    // Render the result as a PNG image
    returnkendo.drawing.exportImage(group);
})
.done(function(data) {
    // Save the image file
    kendo.saveAs({
        dataURI: data,
        fileName: "example.png"
    });
}); //end exportMap

The last step is to bind a button allowing the user to trigger the export function.

//Bind the export button click
$("#export-button").kendoButton({ click: exportMap });

With the click of a button, the user can export the map from a browser.

You can see this sample in action by visiting our Kendo UI Dojo or start a 30-day free trial of Telerik UI for MVC, and try it in your next MVC app.

Conclusion

Adding the ability to export from app to image and PDF further enhances the client experience. Now users can see charts, maps and other visuals in an application and quickly share those items via social media, email and more. With Telerik UIs, you can implement HTML export functionality with relative ease, no matter the web-stack of choice.

Introducing Nova from Kendo UI

$
0
0

Times (and tastes) change, which is why we felt a new contemporary flat theme was in order; hence, Nova was born!

We've all heard the phrase, "don't judge a book by its cover." Yet the reality is that mobile apps are universally judged by their appearance and first few seconds of user experience. Developers who use Kendo UI know that gorgeous themes and widgets are a key ingredient in making this framework so great. That's why today I'd like to introduce you to a new Kendo UI theme we affectionately call "Nova."

From Flat to Nova

Over two years ago, Kendo UI was among the first to introduce the concept of a universal flat theme for skinning your web and mobile apps. This theme was simply called "Flat" and is still widely used today. Upon its release, our internal tests showed up to a 30-percent increase in app performance over native styling. This made switching to a flat UI a no-brainer in many cases.

Times (and tastes) change, which is why we felt a new contemporary flat theme was in order; hence, Nova was born!

kendo ui nova theme

Interested in other (unofficial) flat Kendo UI themes? Take a look at kendoflatthemes.com

New Features in Nova

More than just a new color scheme, the Nova theme is no longer strictly bound to the native concepts of our previous themes. This means we can do some cool things such as adding a pager overlay on top of a series of images:

nova pager overlay

To use this feature, all you have to do is add the km-scrollview-overlay class to your ScrollView element, like so:

<div data-role="scrollView" class="km-scrollview-overlay">
    <div data-role="page">Foo</div>
    <div data-role="page">Bar</div>
</div>

There is also a nested vertical tab strip that is activated like a drawer:

nova nested vertical tab strip

To activate this, add the km-vertical-tabstrip class to the TabStrip placed in a Drawer:

<div data-role="drawer">
    <div data-role="tabstrip" class="km-vertical-tabstrip">
    </div>
</div>

Nova also has optional color schemes for your app navigation (light, accent, and dark):

nova color schemes

...which you use by adding the appropriate class (km-light, km-accent, or km-dark) to your navbar element:

<header data-role="header">
    <div data-role="navbar" class="km-light">
    </div>
</header>

There is much more as well, all documented in separate Nova sections of the Kendo UI docs:

Be sure to consult the full Kendo UI mobile demo site that is a "kitchen sink" of everything Nova!

Converting to Nova

It couldn't be much easier to migrate your existing Kendo UI SPA to Nova. Simply enter "nova" as the skin name when you initialize your Kendo UI app, like so:

var app = new kendo.mobile.Application(document.body, { skin: 'nova' });

If you are developing a hybrid mobile app using Kendo UI framework and Cordova, you should also take a good look at the Telerik Platform. The Telerik Platform provides an instantly productive environment for developing cross-platform mobile apps using Cordova/PhoneGap, along with a verified plugins marketplace, advanced on-device debugging, and the best device simulator on the market. You can get your free trial right here.

Interested in getting started developing with Kendo UI Mobile? Take a look at kendouimobileguide.com

Likewise if you are an Angular developer, you may be interested to know that the Telerik Platform and Kendo UI fully support Angular development! Take a look at this tutorial for developing mobile apps with Angular and Kendo UI.

More than Mobile

Nova is about more than hybrid mobile apps, too! With the latest release of Kendo UI , we introduced support for the Nova theme in our Kendo UI Web and DataViz offerings, as well. Now you can use the Nova theme with our responsive grid and scheduler widgets!

kendo ui grid with nova

Nova is also part of the Kendo UI theme builder, so you can customize the look and feel to your heart's content.

Now go out and create a great app leveraging the power of Kendo UI and the beauty of Nova!

Time for Another Telerik DevCraft Release Webinar

$
0
0

Wait, what? Is it time again for yet another feature-packed Telerik DevCraft Release? Why, yes it is! The DevCraft Q3 2015 Release is here. The official bits drop on September 30, and we’ve got plenty of great stuff in store to show you.

The Telerik DevCraft Q3 Release Webinar, October 14, 2015

Join Developer Advocates Michael CrumpEd Charbeneau and Sam Basu on October 14, 2015 for the DevCraft Q3 2015 release webinar. We’ll take a detailed look at what is included in this release, as well as how it fits into your next application–whether​ for web, desktop or mobile! We are also offering two time slots ​to choose from–we love developers, wherever you are in this big wide world:

What’s New and How Will It Help Me Deliver My App On Time?

Starting with the web, we have a brand new SpreadSheet control for Kendo UI framework, Telerik UI for ASP.NET MVC and Telerik UI for ASP.NET AJAX that brings data management in your business applications to the next level with core Excel-like functionality. We’ve included an enhanced Visual Studio Experience (using templates/in existing projects) with Scaffolding capabilities for Grid, Chart and Scheduler widgets in Telerik UI for ASP.NET MVC, making it a breeze to create data-bound applications with full CRUD functionality. We’ll also deliver a preview version of AngularJS 2.0 integration for Kendo UI framework, as well as beta support for Web Components. ​Also included are enhancements to our Chart and Gantt controls, as well as an extended Nova Theme delivered in Q2 for Web and DataViz.

For the desktop, we’ve added a brand new TimeSpanPicker component for WPF, ​and enhanced our DataLayoutControl for WinForms. Also, the DesktopAlert control for WPF is now official! 

You didn’t think we’d stop there, did you? We have lots of mobile improvements, and we are excited to announce the community preview version of the vastly anticipated Telerik UI for Universal Windows Platform suite. This will enable developers to build Windows applications with the new UWP runtime that reaches any device running Windows 10! The DataForm control for UI for iOS/Android is now official and includes support for Xamarin.Forms. The DataForm component enables you to create your UI with classes instead of markup. Here is a blog post on it. We’ve also added two new controls for Telerik UI for iOS: Gauge and AutoCompleteBox.

With Q2, we officially released the Report Server, and in Q3 we are adding ​the ability to schedule automated report tasks and leverage easy user authentication with Active Directory Integration. Consider all your report generation, management and deployment issues solved!

As you can tell, this is a packed release, and we are excited to unpack the DevCraft bits for you!

Prizes

We have several great prizes lined up to be given away in both webinars. All you have to do is stay until the very end for your chance to win.

Here are the prizes up for grabs:

  1. Microsoft Xbox One
  2. Surface Pro 3

Limited only by official Telerik sweepstakes rules. (U.S. Only)

What Are You Waiting For? Register Now!

With enhancements across the board, from web to desktop to mobile to report server, you can see that our teams have been busy at work. We’d love for you to join us and get a chance to win two of the hottest gadgets around. How cool would it be to use your Surface 3 and the new Telerik UI for Windows Universal Platform controls to build a Windows app that runs everywhere, including your new Xbox One!

Thanks so much for reading, and feel free to register now before it is too late!

Introducing Telerik UI for WinForms Q3 2015

$
0
0

In this release of Telerik UI for WinForms, we are happy to announce yet another brand-new control–RadDataLayout, the official version of RadDiagram and many more goodies in the whole suite.

RadDataLayout

After the recently introduced RadLayoutControl, which was very well accepted by our users, the logical extension of it was to tie it with data. RadDataLayout, provides the layout capabilities of the layout control and in addition, it can automatically create the needed items and editors for your data object. From there, you can easily arrange them with drag-and-drop, and your end users will be able to rearrange the editors ​as they see fit.

 Introducing Telerik UI for WinForms Q3 2015 001

RadDiagram

With this release, we would like to announce the official version of RadDiagram. The control is now stable and packed with a lot of features. Here are some highlights of what’s new in this release for RadDiagram:

  • DataBinding support
  • Text tool
  • Information tool
  • Settings pane
  • Localization
  • Performance improvements

 Introducing Telerik UI for WinForms Q3 2015 002

RadCalendar and RadDateTimePicker

A highly requested functionality for supporting Arabic calendars is now here. As of Q3, 2015 RadCalendar and RadDateTimePicker now support Shamsi, Hijri and Umulqura calendars.

Introducing Telerik UI for WinForms Q3 2015 003

RadGridView

A very popular feature in RadGridView is its column group view definition layout, which allows you to create complex column layouts. In this release, we revamped the functionality and the underlying algorithm to ​enable even more layout capabilities. ​We've also added a new functionality to the control’s Property Builder​ that enables you to create the desired columns layout with drag-and-drop.

Introducing Telerik UI for WinForms Q3 2015 004 

RadDock

Some highly requested features were added to RadDock, such as pinned tabs, preview tab and new docking guides for ToolWindows. With the latter present, you can choose whether to dock the ToolWindows as DocumentWindow or as ToolWindow.

 Introducing Telerik UI for WinForms Q3 2015 005

 

RadChartView

RadChartView now features a FastLineSeries, which is a variation of the LineSeries that significantly reduces the drawing time of a large number of data points.

Introducing Telerik UI for WinForms Q3 2015 006

RadTreeView

A new addition to the control is the export to excel functionality via TreeViewSpreadExport. This export provider uses our SpreadProcessing libraries, which allows exporting to xlsx, csv, txt and pdf files. We have also greatly improved the control performance with large amount of data.

Introducing Telerik UI for WinForms Q3 2015 007

RadListView

Export via our SpreadProcessing libraries was also added to RadListView for all view modes.

 Introducing Telerik UI for WinForms Q3 2015 008

RadPropertyGrid

RadProperty grid received an export functionality, again using the SpreadProcessing library.

Introducing Telerik UI for WinForms Q3 2015 009

Last, but not least, we have created a new demo application mimicking a medical reservation system. You can find it in the integration examples in our demo application. Here are some screen shots of it:

 Introducing Telerik UI for WinForms Q3 2015 010

To get your hands on the latest build go to your Telerik account or download a free trial. As always feedback is welcome.

Spreadsheet and Modern Rendering in UI for ASP.NET AJAX

$
0
0
You should definitely read this blog post if you are looking for Spreadsheet solutions or appearance and stability improvements in the Q3 2015 release of the Telerik AJAX suite. ​The blog ​will also be interesting to everyone ​looking for a Spreadsheet solution and will allow you to take part in ​its Beta program. ​The article also exposes the top new features in the Telerik AJAX controls Q3'15 and provides handy links to their demos, documentation and more.

So let me dive into highlights and explain what the benefits are for you:

Spread​sheet (Beta)

You can use the Telerik Spread​sheet UI component to deliver an Excel-like look and feel ​to your web apps. The UI is very intuitive because of its similarity to MS Excel and Google Sheets. The control also features built-in Excel XLSX import/export, keyboard navigation, editing, and much more.

ASP.NET AJAX RadSpreadsheet
   
If you would like to learn more, check out this blog post or give this live demo a spin. ​The official release is scheduled for Q1 2016 so that you have enough time to play with the ​Beta and share your feedback in the feedback portal, the dedicated forum or the support ticketing system.

Modern vs Classic Rendering

With this release, you gain modern rendering (RenderMode="Lightweight") in about 99% of the controls. The latest controls that obtained simplified markup, semantic rendering and easy-to-customize skins in Q3’15 are: ColorPicker, ImageEditor, FileExplorer, PivotGrid, Splitter and SocialShare.

Regarding the above here come the questions:

What Will ​Happen ​With the Classic ​Rendering?
Will it Be Discontinued and When?

Our plans are to develop only the Lightweight rendering since it makes the controls more responsive, lightweight and easy to customize. All new controls, skins, features and support for new browsers will be developed only for the modern rendering.

At the same time we will not discontinue the stable Classic rendering for at least a year (until Q3 2016) and we will provide critical fixes for it.

Responsive Rendering

Along with the modernization of the rendering, we continue to work on and improve the responsive behavior of the controls. The newly introduced elastic capabilities in the ColorPicker, FileExplorer, ProgressArea, SocialShare and TileList controls will help you build apps tailored to any device's screen size. Look at the Mobile Support and Responsiveness help article, if you are interested in learning more.

Theme Builder

A common scenario is to customize and tweak the overall appearance of the controls to fit to your specific web site/app colors and requirements. Until Q3 2015 this was possible only for the Classic rendering of the controls through the Visual Style Builder. Now you can do so for the Lightweight rendering as well! ​

For example, if you want to create a new skin or to customize an existing ​one for the ​Lightweight rendering of the AJAX controls, ​you can ​rely on the new Theme Builder app.

Theme Builder Overview
   
For all Twitter Bootstrap fans, I want to share the good news that we are working on a new special feature (the third option in the Theme Builder) that will allow you to import Twitter Bootstrap themes, to read their color information, and to apply it to the Telerik Bootstrap skin. This will ensure that the Telerik AJAX ​controls will use a similar color scheme as your Bootstrap components when both reside on the same page.

Note that the Import Bootstrap Theme functionality is currently in Beta and has limited capabilities. We want to ​collect more input ​from ​you, our fellow developers, before bringing new functionality prior the official launch. That's why I kindly invite you ​to share all your ​requirements, scenarios and custom Twitter Bootstrap themes with us, by dropping us an e-mail at webforms@telerik.com, in the feedback portal, ​via a ticket or a forum post.

Accessibility Improvements

Section 508The new functionality introduced in Q3 is just the beginning of our major plan to improve the AJAX suite in 2016 to follow the latest trends in the industry regarding accessibility. Right now, you can take advantage of the following new features that will help you to develop better accessible web apps:

  • WAI-ARIA Support for the TabStrip and Multipage based on the W3C specification
  • WAI-ARIA role attributes are applied to RadGrid’s form textboxes, checkboxes, filter boxes and expand/collapse buttons
  • Other JAWS related improvements

Outlook-Inspired Sample App

With the sole purpose ​of making your development easier, shortly after the release we are going to launch  the ​new ​version of ​the popular ​Telerik Web Mail sample app. It offers a redesigned modern look influenced by the Outlook.com site and leverages the responsive capabilities of the Telerik AJAX controls. You can use it as a starting point to create your own mail client applications as well as to see the controls interoperability in action.
    Telerik Outlook-inspired Sample App
  

Important Improvements to Existing Controls

  • Real Excel-like filtering in RadGrid–provides a list of all unique values of the column with a search option and conditional filtering (Equal To, Greater Than, Less Than and Other)
  • Gantt–Client ​Task ​Templates demo and Column Resizing demo
  • Navigation–Client-side binding and templates, Content Template
  • Scheduler–Year View​, a handy feature that indicates the appointments across the whole year

Last but ​Not Least

  • We introduced official support for .NET 4.6 and Microsoft Edge in Q2 2015 SP1.
  • With Q3 2015, the IE7 support has been dropped in accordance with Microsoft’s plan to do it in the beginning of 2016. The benefit is performance improvements of up to 30% for some controls. You can find more information in this blog post.
  • The Mobile Editor ​became official and you can test it on your mobile phone devices here.

Useful resources

Viewing all 4135 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>