CastleSoft

Quality Software for all your devices.

RAD Studio 10 Seattle Screenshots

If you haven't seen Embarcadero RAD Studio 10 Seattle, take a look at these screenshots.


IDE XE8 Productivity

Windows 10 Notifications

fireui300

The TNotificationCenter component works with Windows 10 notifications for VCL and FMX apps.

Windows 10 Styles

Beacons Proximity

Windows 10 VCL and FMX styles including common dialogs give apps the modern look and feel of Windows 10.

Windows 10 Styles

EMS

Windows 10 VCL and FMX styles including common dialogs give apps the modern look and feel of Windows 10.

Common Dialogue Styling

VCL Styling improvements, including support for styling common dialogs and the TWebBrowser component

Brand New Windows 10 VCL Controls

castalia300

New VCL UI controls for Windows 10 include RelativePanel, ToggleSwitch, and SearchBox.

Enhanced Multi-Monitor Support

castalia300

Create the perfect IDE layout for maximized developer efficiency.

FireDAC NoSQL Driver for MongoDB

castalia300

MongoDB, the most popular NoSQL database can be used with FireDAC including API mapping, data manipulation, and new RTL support for JSON and BSON formats.

iOS Control Enhancements

castalia300

New platform presentation for iOS ScrollBox and enhancements to the ListView control.

iOS 64-Bit Debugging

Build and debug iOS 64-bit and Universal apps on device.

Filterable Object Inspector

castalia300

Boost developer productivity by quickly filtering down to the properties you need.

Integrated Style Designer Enhancements

castalia300

Improved integrated FireMonkey Style Designer and enhancement to the TStyleBook component to support a collection of styles for various platforms.

Integrated IDE Productivity

castalia300

Over 20 IDE productivity features are now directly integrated with the IDE providing an increase in quality and stability.

GetIt Library Expanded

castalia300

Get new open source and component packages directly from the IDE including BeaconFence!

FireMonkey for Windows 10 – Control Hints

castalia300

Control hints, platform native rendering of TEdit and TMemo, ZOrder enhancements, MultiView updates for Windows 10, Switch controls, and clipboard support for images.

Standard C++11 for Win32

castalia300

Bring your existing windows apps to C++11. Easily switch between the new 32-bit Windows C++11 compliant compiler and the classic bcc32 compiler in the same project for Windows apps.

Build Android Services

castalia300

Build Android service apps that can execute background tasks on the Android OS.

RAD Studio 10 Seattle

The Ultimate Application Development Platform for Windows 10, Mac, Mobile, and IoT

Embarcadero® RAD Studio™ 10 Seattle is the fastest way to build and update data-rich, hyper connected, visually engaging applications for Windows 10, Mac, Mobile, IoT and more using Object Pascal and C++. Quickly and easily bring your apps and customers to Windows 10 with a wide range of Windows 10 enabling features such as new Windows 10 VCL Controls, VCL and FMX UI Styles, and UWP (Universal Windows Platform) services like notifications.

Support larger projects with more platforms, with double the available IDE memory and project capacity. Be more productive than ever with multi- monitor support and dozens of new IDE features designed to help you code faster. RAD Studio 10 enables developers to deliver applications up to 5x faster than other tools and build even faster across multiple desktop, mobile, cloud, and database platforms including 32-bit and 64-bit Windows 10, Mac OSX, iOS, and Android.

What's New in RAD Studio 10 Seattle >

With RAD Studio 10 Seattle, the new IDE memory expansion makes it a must-have upgrade.

Scott van der Linden
Project Manager (Tool Development) – WorleyParsons

Securing Your App with Touch ID

By 

One of my favorite features of the iPhone is Touch ID, introduced by Apple with the release of the iPhone 5s a couple of years ago. touch-id-iconTouch ID adds biometric authentication to your device so users can touch the home button to unlock their device instead of using a pin code.

Since its initial release, Apple has added a few new ways to use Touch ID, including integrating it as an essential part of Apple Pay and adding an API for developers to use Touch ID in their apps. In this blog post we’re going to discuss how you can leverage Touch ID to create secure user authentication. We’ll include a fallback to store the password in Keychain and authenticate our users against that in cases where the device doesn’t support Touch ID.

Xamarin Studio with TouchID Design

Supporting Older Devices

Sign Up

If the device has Touch ID, we won’t need to sign the user up since the device can authenticate them for us. But to ensure we support devices such as iPhone 4, 4S, and the iPhone 5, we’ll want to ensure we’ve got a fallback in place. To do this, we’ll use Keychain to store and validate the user credentials.

I like to use UserDefaults for storing usernames to read back information when the app launches and populate the username UITextField for the user. It’s small touches like this that make an app feel more polished and help achieve higher ratings on the app store.

1
2
3
var hasLoginKey = NSUserDefaults.StandardUserDefaults.BoolForKey("hasLogin");

if (!hasLoginKey)

    NSUserDefaults.StandardUserDefaults.SetValueForKey(new NSString(tbxUsername.Text), new NSString("username"));


Saving the Password

It’s important to note that we don’t want to use UserDefaults here since it’s not a secure approach to saving your data. Instead, we’ll use Keychain, which is iOS’s built-in secure storage service that allows us to store passwords, keys, certificates, and more. My colleague René Ruppert has developed a helpful wrapper for storing passwords on iOS with Keychain that you can grab here and is what I’ll be using.

To save the password, we simply call ‘SetPasswordForUsername’. In this case, I have my serviceId set to ‘MySecureApp’.

1
Helpers.KeychainHelpers.SetPasswordForUsername(tbxUsername.Text, tbxPassword.Text, serviceId, Security.SecAccessible.Always, true);

Once we’ve done that, it’s time to set ‘hasLogin’ to true and synchronize the UserDefaults.

1
2
NSUserDefaults.StandardUserDefaults.SetBool(true, "hasLogin");

NSUserDefaults.StandardUserDefaults.Synchronize();

Validating the User Credentials

We’re now ready to validate the credentials provided by the user. To do this, we get the password from the Keychain and check that it matches the password provided. We then repeat the process with the username. If CheckLogin returns true, then we can continue loading new views.

1
2
3
4
5
6
7
8
9
static bool CheckLogin(string username, string password)
{
    if (password == Helpers.KeychainHelpers.GetPasswordForUsername(username, serviceId, true) &&
        username == NSUserDefaults.StandardUserDefaults.ValueForKey(new NSString("username")).ToString())
    {
        return true;
    }
    return false;
}

Adding Touch ID

Implementing user authentication with Touch ID is painless and only involves a tiny amount of code since iOS does most of the heavy lifting for us. Below is all the code required to get started.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Lets double check the device supports Touch ID
if (context.CanEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, out error))
{
    var replyHandler = new LAContextReplyHandler((success, error) =>
        {
            InvokeOnMainThread(() =>
                {
                    if (success)
                    {
                        var newVC = new UIViewController();
                        PresentViewController(newVC, true, null);
                    }
                    else
                    {
                        var alert = new UIAlertView("OOPS!", "Something went wrong.", null, "Oops", null);
                        alert.Show();
                    }
                });
        });
    context.EvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, "Logging in with Touch ID", replyHandler);
}
else
{
    var alert = new UIAlertView("Error", "TouchID not available", null, "BOOO!", null);
    alert.Show();
}

Wrapping Up

Not all apps require a backend service for user authentication, and iOS provides lots of options for authenticating locally. If you wanted to take this one step further you could look at integrating 1Password authentication into your app. I’ve created a completed version of the demo project on GitHub, to which I’ll be adding 1Password support to in a separate branch that you can find here. Additionally, be sure to read through our full documentation on integrating Touch ID.

After 20 years the time has come to say goodbye...

Today we begin a new chapter in the life of CastleSoft.

In May this year we celebrated our 20th Anniversary. During those years we have developed solutions in a 
variety of languages which have included: C, C++, Java, Delphi, and C#.  In fact, we have used Delphi for 20 of those years with great success.

But today we say goodbye to Delphi as we focus on C# development for Web, Mobile and Desktop development on an ever expanding array of devices and platforms.

We would like to thank Embarcadero for their great product and support over the last 20 years.



Coming Soon to RAD Studio ... Enhanced Designer Experience!

POSTED BY  ON IN TIPS, TRICKS AND TECHNIQUES

Easily hide non-visual components, filter the properties and events of the Object Inspector, and the Structure View has new matching icons for components.

ObjectInspectorSearch_HideNonVisComponents_IDE


Get "More Coding in Delphi" ebook by Nick Hodges FREE!

Get the next version of RAD Studio, Delphi or C++Builder as soon as it is available plus Nick Hodges’ ebook “More Coding in Delphi” as a free bonus when you purchase RAD Studio, Delphi or C++Builder XE8 and an Update Subscription before August 30, 2015.

Special upgrade offer for owners of XE3 and earlier!

With the purchase of the upgrade and Update Subscription, you can save up to 45% off the regular price of XE8 and get immediate access to the next major release when it becomes available!

Learn More >

Rapid Mobile App Prototyping with Xamarin.Forms

By 

Creating mobile app prototypes is an important part of the design process. It’s extremely useful for developers and test users to be able to interact with a prototype in order to experience how the app will behave when it’s complete, but building prototypes can be daunting due to the large amount of time it takes. This is especially true when you’re asked to make prototypes for more than just one mobile platform, which happens more often than not. With Xamarin.Forms, though, it’s quick and easy to create user interfaces that are shared across Android, iOS, and Windows Phone.

Wireframes vs. Mockups vs. Prototypes

These terms often get used interchangeably in the mobile world. In order to understand why you might use Xamarin.Forms for prototyping, let’s go over the differences between these design terms.

Login_Wireframe

Wireframes

Wireframes are a static, low-fidelity representation of design. They’re usually in black and white, with blue sometimes used to show links and/or buttons. Wireframes should be created before mockups or prototypes, since they’re the backbone of your mobile app’s design.

Bottom Line: Wireframes are quick to create and are typically used as documentation for your project.
 

MockupsProfile_Mockup

Mockups are a static, high-fidelity representation of designs. These full-color images should look almost exactly like the final product in terms of color, icons, buttons, etc. Mockups represent the structure of information and demonstrate the basic functionalities of your app in a static way.

Bottom Line: Mockups are quicker to create than prototypes and are great for gathering feedback on the design in its entirety.

Prototypes

Prototypes are a middle to high-fidelity representation of the final product that simulates user interaction. It’s more likely that your prototypes will be middle-fidelity, meaning they won’t have to be as accurate as mockups when it comes to the design of your app. Prototypes should allow testers to interact with the app in a way similar to the final product.
Prorotype_Image
Bottom Line: Prototypes are expensive to create but are good for allowing stakeholders to preview the mobile app in its entirety.

Xamarin.Forms for Prototyping

Prototyping can be expensive and time consuming, but Xamarin.Forms lets you create prototypes for all three platforms by writing code in XAML or C# just onetime, greatly reducing this pain. Xamarin.Forms also allows you to put real appsonto real devices to show off your prototypes. It empowers you to rapidly create a prototype and then put your prototype onto iOS, Android, and Windows devices so that your client or stakeholder can experience the user interaction of your app. That’s a pretty powerful tool in the design and development process.

So… Let’s code!

We are going to use the Swarm mobile app by Foursquare for our prototyping example. Here are a few screens that we should be able to easily create prototypes for:
Swarm_Screenshots

Initial Setup

Create a new Xamarin.Forms app. I’m going to name mine “SwarmPrototype”. Now, add a new Forms ContentPage XAML file named “LoginPage”.

In your App.cs file, modify the existing App() method so that our LoginPage shows up as soon as the app starts. We will also wrap the LoginPage in a NavigationPage and change some navigation bar properties.

1
2
3
4
5
6
7
8
9
public App ()
{
  // The root page of your application
  MainPage = new NavigationPage(new LoginPage())
  {
    BarBackgroundColor = Color.Transparent,
    BarTextColor = Color.White
  };
}

This gives us a NavigationPage, which provides some simple navigation properties so we can easily move from screen to screen through our prototype. The navigation bar will have white text to represent the screenshots above.

Login

Let’s head over to our LoginPage.xaml now. You can see it has automatically given us a content page in which we will need to add some content. First, add a StackLayout with 200 padding on top and an orange background.

1
2
3
4
5
6
7
8
<ContentPage.Content>
  <StackLayout
    Padding="0,200,0,0"
    BackgroundColor="#FFA733"
    VerticalOptions="FillAndExpand"
    Spacing="20">
  </StackLayout>
</ContentPage.Content>

Now, inside of our stacklayout, which is oriented vertically by default, we want to add a label, two entries, and three buttons. The label and the two entries will look like this:

1
2
3
4
5
6
7
8
9
10
11
12
<Label
  Text="Log in with your Foursquare account"
  TextColor="White"
  HorizontalOptions="Center"/>
<StackLayout
  HorizontalOptions="FillAndExpand"
  Spacing="0">
  <Entry
    Placeholder="Username"/>
  <Entry
    Placeholder="Password"/>
</StackLayout>

As you can see, we have a label and then two entries inside of another stacklayout. The reason I put those two entries inside of a new stacklayout is so that I could make sure the Spacing=”20″ in our main stacklayout didn’t apply to those elements. Here’s the rest of the XAML for the LoginPage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<StackLayout
  Orientation="Horizontal"
  HorizontalOptions="CenterAndExpand"
  Spacing="30">
  <Button
    x:Name="buttonCancel"
    Text="Cancel"
    TextColor="White"
    BackgroundColor="#FFA733"
    BorderRadius="15"
    BorderColor="White"
    BorderWidth="2"
    HeightRequest="40"
    WidthRequest="150"/>
  <Button
    x:Name="buttonLogin"
    Text="Log in"
    TextColor="#FFA733"
    BackgroundColor="White"
    BorderRadius="15"
    HeightRequest="40"
    WidthRequest="150"/>
</StackLayout>
<Button
  x:Name="buttonForgot"
  Text="Forgot your password?"
  TextColor="White"
  BackgroundColor="Transparent"/>

One Last Thing

Now we have a static login page, which is a great start, but prototypes are meant to be interactive; we want the app to navigate when the user clicks the “Log in” button. In the LoginPage.xaml.cs file, we’re going to add an event handler for that button as well as a line of code to hide the navigation bar on the LoginPage.

1
2
3
4
5
6
7
8
public LoginPage ()
{
  InitializeComponent ();
  NavigationPage.SetHasNavigationBar (this, false);
  buttonLogin.Clicked += async (object sender, EventArgs e) => {
    await Navigation.PushAsync (new ActivityFeedPage ());
  };
}

In the event handler, we use the Navigation property (given to us by the NavigationPage we set up in our App.cs file) to Push a new ActivityFeedPage. You will have to add a new ContentPage XAML file named “ActivityFeedPage” for this to work.

Our login page is now good to go! If we run the app we can see that, even though we only wrote one XAML file, it looks and feels native on Android and iOS.
Login_Screenshots

Keep on coding!

I urge you to take a look at the Xamarin.Forms guides and to try creating the next two pages on your own. If you’re having trouble, take a look at the completed project on my GitHub. I will also be doing a more extensive guest lecture on this topic through Xamarin University on September 24th. Get yourfree 30-day trial so you can join me for this awesome rapid prototyping session!

Bringing Xamarin.Forms Apps to Tablets

By 

When I was developing My Shoppe, a pre-built app template for shops, I only focused on the look and feel for the phone form factor, since I knew that I could add optimizations to the app to spruce it up for tablet owners later. Xamarin.Forms makes it simple to detect what type of device my users are running and provides a few nice helper methods to extend the app for a better tablet experience. Here are a few tips to get you started with optimizing your Xamarin.Forms apps for these larger form factors.

MyShoppeFamily

Adding Tablet Support

The first thing to do is ensure that tablet support is enabled for the app, which each platform handles a little bit differently. On iOS, it’s simple to adjust what type of devices an app can be run on: simply click on the properties for the iOS project and under iOS Application is a setting called Devices. This controls the final output of the app for either iPhone/iPod, iPad, or Universal. For My Shoppe, I switched from iPhone/iPod over to Universal to ensure the app has a proper phone and tablet form factor when running on either of the devices instead of a 2x zoom button when running the app on the iPad.

devices

Android handles tablet support a little differently since Android works with pixels in correlation to densities, and any app can be scaled correctly up to a larger screen. There are a few different options that can be added to the Android manifest to filter the app out of Google Play. By default, there are no adjustments that need to get My Shoppe running on tablets correctly.

Optimizing with Device.Idiom

Simply enabling tablet support isn’t enough, and I wanted to finely-tune specific areas of the app to make using My Shoppe on tablets an excellent user experience. Xamarin.Forms provides many different ways to add platform-specific tweaks to layouts through different properties the Deviceclass exposes. You may already be familiar with Device.OS orDevice.OnPlatform that can be used to add OS level tweaks, but we can useDevice.Idiom to detect if the current device is a phone or tablet. When building a layout for tablet, I often like to switch StackLayouts from vertical to horizontal and display different images when my users are on a tablet. This can be accomplished easily:

1
2
3
4
5
6
7
8
9
10
if (Device.Idiom == TargetIdiom.Phone)
{
    MyStack.Orientation = StackOrientation.Vertical;
    HeroImage.Source = ImageSource.FromFile("hero.jpg");
}
else
{
    MyStack.Orientation = StackOrientation.Horizontal;
    HeroImage.Source = ImageSource.FromFile("herotablet.jpg");
}

In My Shoppe, I performed these optimizations to take advantage of the additional screen size, and in all of my grid layouts I added additional padding and spacing directly in my XAML:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<Grid VerticalOptions="FillAndExpand">
  <Grid.ColumnSpacing>
    <OnIdiom x:TypeArguments="x:Double"
             Phone="20"
             Tablet="40"/>
  </Grid.ColumnSpacing>
  <Grid.RowSpacing>
    <OnIdiom x:TypeArguments="x:Double"
             Phone="10"
             Tablet="20"/>
  </Grid.RowSpacing>
  <Grid.Padding>
    <OnIdiom x:TypeArguments="Thickness"
             Phone="10, 10, 10, 0"
             Tablet="20, 20, 20, 0" />
  </Grid.Padding>
  <!-- Grid Content -->
</Grid>

SpacingOptimizations

Leverage MasterDetailPage

Simple platform tweaks are great and can go a long way, but there’s certainly more that can be done to optimize the UX on tablets. I decided that users would see a different page based on the type of device they were using when they tap to see all shop locations. On a phone, the flow wouldn’t change, as a full list of locations would appear and they could drill down to details. On tablets, I decided to navigate to a MasterDetailPage that has a full flyout menu where the locations could be listed and the shop details would be displayed side by side. I accomplished this by re-directing the app to different screens based on the Idiom that was detected. I was still able to leverage all of the existing code in the Store list page by propagating the click event up to the MasterDetailPage to swap out the Detailed information.

Propagate the event

On my original StoresPage I added a new Action that could be used to propagate the event to the MasterDetailPage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public partial class StoresPage : ContentPage
{
  public Action<Store> ItemSelected { get; set; }
  public StoresPage ()
  {
    InitializeComponent ();
    //Fill in Binding Context...
    //Handle item selected to navigate to new page or propagate event
    StoreList.ItemSelected += async (sender, e) =>
    {
      if(StoreList.SelectedItem == null)
        return;
      var store = e.SelectedItem as Store;
      if (ItemSelected == null)
      {
        await Navigation.PushAsync(new StorePage(store));
        StoreList.SelectedItem = null;
      }
      else
      {
        ItemSelected.Invoke(store);
      }
    };
  }
}

New Tablet Page

I created a new MasterDetailPage that set the StoresPage to the Master and a temporary Detail page asking the user to select a shop. Next, I simply subscribed to the ItemSelected action and swapped out the Detail page:

1
2
3
4
5
6
7
8
9
10