• Stars
    star
    475
  • Rank 92,465 (Top 2 %)
  • Language Pascal
  • License
    MIT License
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cross-platform library for Delphi

Kastri

logo

From Delphi Worlds

Twitter Facebook Instagram

Compatible with Embarcadero Delphi. Please note: Only the last two point releases of major releases (e.g. at present that includes Delphi 10.4.2 and Delphi 11) are "officially" supported.

Development of Kastri can be helped along with Github Sponsorship, so please consider sponsoring today!

Alternatively, you might like to make a donation via PayPal:

paypal

Please star this repo by clicking the Star box in the top right corner if you find it useful!

If you're looking to learn Delphi, please visit this link

Kastri

  • Is a cross-platform library which builds upon the existing RTL, FMX and VCL libraries in Delphi
  • Supports a number of newer APIs that you won't find in FMX/RTL, and "backfills" for missing APIs
  • Is structured in a way so as to avoid creating unnecessary dependencies
  • Follows strict coding standards to ensure consistency and readability
  • Is kept as simple as practicable
  • Is named after the place in Greece where Delphi once stood

Playground

Playground is a separate repository that serves as a testing ground for features that may or may not be included in Kastri. Please visit the Playground for features/demos that are on the bleeding edge!

Delphi 11 changes

With the introduction of Delphi 11, there have been some changes related to Android. You may notice new jar files in the Lib folder where the name is the same as an existing jar, with a suffix of 2.0.0 (or greater) e.g. dw-kastri-base-2.0.0.jar. Jars with a 2.0.0 suffix will work only with Delphi 11 (and possibly later). If a jar does not have a corresponding jar with a 2.0.0 (or greater) suffix, it should also work with Delphi 11. Please also see the Demos section below.

Due to the above changes to Delphi 11, the existing demos that were created with Delphi 10.4 or earlier may require the Android Libraries fix

Intro video

This is a link to an intro video for Kastri

How To Use Kastri

For the most part, with Kastri there are no components to install. Simply clone the repo (Fork is a highly recommended Git client), or download/unzip and ensure that your Project (recommended) or IDE paths point to the folders of the units that you use.

The Native Controls suite (Kastri FMX) is a set of components that can be installed into Delphi and used at design-time

Pull Requests

Pull requests are welcome, however before making any, please read the Coding Standards readme and ensure that the change adheres to the standards, and that the Description section of the request is filled out, noting the purpose and reasoning for the change.

In regards to coding standards, in particular observe things like naming, ensuring fields/methods are kept in alphabetical order (which makes them easier to find as the number of methods grow), and that structured statements follow the standard.

Support

Issues page

If you encounter an issue, or want to request an enhancement, please visit the issues page to report it.

Slack Channel

The Delphi Worlds Slack workspace has a channel (#kastri) devoted to discussing Kastri. There you will find Dave Nottage (when he is available) and other developers who are passionate about Kastri to discuss how to use Kastri, what is in it etc.

Sponsors of Kastri have access to the private #sponsors channel where they receive priority support.

If you would like to join the Delphi Worlds Slack workspace, please visit this self-invite link

What Is In Kastri?

Demos

You'll find demo applications in the Demos folder, including those associated with articles posted on the Delphi Worlds blog

Note: Most demos have a readme associated with them, and they may have vital configuration information that should be applied when using the feature(s) in your own projects

Delphi 11 users please note: Some of the demos that have Android support have been updated in line with changes in Delphi 11, and now have separate project (.dproj) and group project (.groupproj) (where applicable) files, which have been suffixed with D11. For demos that do not have a suffix of D11 in the name, you may need to open Project Manager and for each Android target you wish to use, right-click the Libraries node and click Revery System Files to Default before building the project.

API imports

In the API folder you will find imports for a number of iOS, macOS, Android and Linux APIs that are either not included with Delphi, serve to complete missing APIs, or are imports for Java code contained in Kastri. Most of these are used in the Kastri Features and/or demos however some are included due to interest from developers.

Core units

Units in the Core folder contain code of a wealth of cross-platform related implementations. Units that have platform specific code are suffixed with one of:

  • .Android.pas
  • .iOS.pas
  • .Linux.pas
  • .Mac.pas - can be for both iOS and macOS
  • .Posix.pas - for Posix-based platforms (iOS, macOS, Android, Linux)
  • .Win.pas

Implementations include:

  • DW.OSLog - logging code that serves to replace Log.d, which relies on FMX, and cannot be used in an Android service
  • DW.OSDevice - code that returns information that is mostly device-specific
  • DW.OSTimer - leaner, less complex implementation of a timer. Also does not rely on FMX, so can be used in an Android service

Features

The Features folder contains more feature-rich cross-platform implementations of APIs. These are structured in such a way so as to shield your cross-platform code from the platform-specific implementation. There are demos for each of the features in the Demos folder Features include (amongst others):

AdMob

Support for Google Ads on Android and iOS

AndroidPDF

PDF Renderer for Android

AppUpdate

In-app updating of the application. (Android only)

AudioPlayer

Play audio files on Android, iOS and Windows. Specifically constructed to allow synchronization of audio and visual display.

Barcode

Based on Google ML Vision APIs, it allows you to scan an image and detect barcodes within it

Biometric

Android and iOS implementations of biometric functions, namely: Fingerprint recognition on Android, and Fingerprint and FaceID on iOS

Camera

Android and iOS implementations of native camera support

Connectivity

Android, macOS, iOS and Windows implementations of code for checking network connectivity of a device

Files Selector

Uses native APIs to allow users to select one or more files on the device, for Android and iOS

Firebase

Android and iOS implementations of Firebase Cloud Messaging using their native libraries

Geofencing support on Android

Works a little like the regions support does for iOS with TLocationSensor. Set up geographical regions (each region is a location with a specified radius), and events fire when the user passes in/out of those regions

Location

Android and iOS framework made specifically for location updates when the application is in any state (e.g. even when it is not running)

NFC

Near-Field Communication implementations for Android and iOS

Notifications

Framework that is alternative to TNotificationCenter (that ships with Delphi) for Notifications on Android and iOS

Proximity

Support for the proximity sensor on Android and iOS, including switching the screen on/off e.g. when the user puts the device to their ear

Share Items

A more feature-rich alternative for the Share Sheet implementation provided with Delphi, for Android and iOS

SMS

Support for sending SMS messages on Android and iOS

Speech Recognition

Android and iOS implementations for speech-to-text services. On Android, the actual speech API is used, rather than via Intents

Symbol Scanner

Scanning of codes specifically for popular scanning devices such as Zebra, Symbol and Honeywell (Android)

Text To Speech

Allows your device to speak from the supplied text. Support for Android, iOS, macOS and Windows

Universal Links

Allows users to follow links to content inside your app from your website.

Planned Features

In addition to the features listed above, several other features are planned for Kastri, namely:

Google SignIn

A simplified variation on Grijjy's excellent Google SignIn implementation, with added support for iOS

Media Manager

For accessing photos/videos stored on the device via the albums on Android and iOS. This feature is currently in the Playground.

Simple backend framework for managing push tokens

A simple REST backend for managing push tokens and sending messages that can be customised to your needs. Complements the existing Firebase Cloud Messaging support.

The above features take time and resources to develop. Your help via sponsorship can help make them a reality!

License

Kastri is licensed under MIT, and the license file is included in this folder.

More Repositories

1

KastriFree

Free version of the Kastri library
Pascal
194
star
2

Codex

Codex is an add-in for RAD Studio. This repository is currently just for the installers and for reporting issues
Pascal
61
star
3

PushClient

A cross-platform method of using Firebase Cloud Messaging (FCM) to receive push notifications
Pascal
44
star
4

Playground

Stuff I'm working on that I *may* make public
Pascal
40
star
5

DeviceLens

36
star
6

HowTo

A collection of "How To" examples, usually when using the Kastri library
35
star
7

Mosco

macOS app that helps developers, especially those using Delphi
Pascal
29
star
8

TOTAL

Pascal
26
star
9

PushIt

Tool for testing Firebase Cloud Messaging, written in Delphi
Pascal
24
star
10

JID

Jar Import for Delphi
Pascal
21
star
11

DelphiPatches

20
star
12

OpenWeatherDemo

Demo app for the article as published on the Delphi Worlds blog
Pascal
18
star
13

Slumber

App for testing HTTP/HTTPS calls
Pascal
18
star
14

Tools

Compiled binaries of Delphi Worlds companion tools
13
star
15

MultiPlatformWebServer

Template for building web server functionality on supported platforms
Pascal
12
star
16

MiscStuff

9
star
17

VOIPDemo

Temporary repo where help is sought to resolve issues
Pascal
8
star
18

Multicaster

A framework for developing applications that implement UDP broadcasting
Pascal
8
star
19

BASS

Condensed version of the Delphi support for the BASS library
Pascal
7
star
20

MoscoExpert

Add in for Delphi that works with the macOS companion app
6
star
21

MediaManager

Library for accessing media on iOS and Android
5
star
22

Babel

Lightweight, cross-platform library which helps translate text into the target languages.
Pascal
4
star
23

MockLoc

Delphi app for mocking locations on Android
Pascal
4
star
24

CodingStandards

Delphi Worlds Coding Standards
3
star
25

GenDeployProj

A command line tool for generating a .deployproj file from a .dproj in Delphi projects
Pascal
3
star
26

ExpertTool

Utility for managing Delphi experts
Pascal
2
star
27

Things

Library of stuff Dave has documented
1
star