Intents on Android using API 26 to open PDF documents.
Recently, the Google Play store updated its requirements so the target API level of 26 was used to get new apps submitted. While this was reasonably easy to achieve through updating the AndroidManifest.Template, the change to the newer API changed the behaviour of my application.
Before the update, I would download a file to the CachePath and then share to a public folder. I would then get a URI for the public folder path file and share via Intents. Following the update, this no longer worked. After a little research, I discovered this was due to the changes in the Android security system, that actually, make a lot of sense. Rather than sharing the file outside the application, you now provide tempory access to it via the Intent. To achieve this, you need to setup a Provider, (this is done via XML) and then programmatically provide the path as a ‘content://’ URI, set flags for allowing read / write access via the intent and share it.
The video shows how to achieve this and demo’s the working code. To help, below are some of the XML blocks you will need upon the way.
Add this to the AndroidManifest.template in the source code root folder, before the </application> tag. This is then used to build all Android apps.
Delphi Boot Camp add’s YouTube and Facebook streams to service demand.
Today was very exciting in the Embarcadero offices. Developers have been registering for Delphi Boot Camp in their thousands, with over 1000+ registering in the last weekend alone.
Having all this interested in Delphi is awesome, but also has raised quite a challenge for the team delivering Boot Camp due to physical viewing limitations in GoToWebinar. The decision was taken last week that we should add additional ways to stream this out to the 1000’s who were going to attend and Jim McKeeth started off looking into YouTube and Facebook streaming.
This morning, all attendees received an update email with the multiple streaming options included. During the first of the two live daily sessions we have seen huge numbers viewing on both Facebook and YouTube.
If you couldn’t get into GoToWebinar, either try the second session or watch the replay on YouTube later, keep an eye on community for the replays.
If you did watch the Boot Camp on YouTube, thank you to everyone who joined in with such fun discussions. (my personal favourite question was “So can I talk to Dolphins with this?” – I’ve seen some cool delphi apps, but that would be a nice hardware integration project) Please let us know what you think about these medias for the future.
You can also use the Starer Edition to qualify for upgrade pricing to RAD Studio or Delphi Pro / Enterprise or Architect editions. And with the mobile add on pack included along with the bonus pack, now is a great time to do that.
Join Embarcadero experts and leading community MVP’s for 5 workshops from Monday 5th September to Friday 9th September.
Focusing on getting stared and using the FMX framework to create cross platform ready code, Delphi Boot Camp is a great way to learn new skills and ask leading experts direct questions on application development.
Introduction to Delphi: The IDE and Your First App
Getting to Know the Delphi Language
Building Effective User Interfaces with FireMonkey
The final part of the Boot Camp is the programming book! Delphi is the home to modern Object Pascal programming and you can get up to speed with the modern Delphi / Object Pascal language with the help of Marco Cantu’s awesome handbook.
Part of the very fast FireDAC database component library is TFDFileStream,a class that allows high performance access to trace files, (TFDMoniFlatFileClientLink), text data file reading (TFDBatchMoveTextReader / TFDBatchMoveTextWrtiter), SQL Script file reading (TFDScript) and data serialization to file (TFDMemTable etc). Well, it seems it was too good to keep hidden and with the release of 10.1 Berlin, this has been moved from FireDAC.Stan.Util to System.Classes and has been renamed to TBufferedFileStream.
Accessing the Address Book on iOS and Android is a common request for many developers building line of business applications; quickly followed by “and how do I dial a phone number from code“. In this post I will explore how to explore the mobile Address Book using a common code base that works on iOS and Android using TAddressBook. (list to samples and documentation at the bottom of this article)
The TAddressBook lives under Services section of the tool palette and consists of two and has very little in the way of Component properties. It does however have two events that are very useful, and a number of run time methods to call.
The two events provide notification when the address book has been changed (outside the application) and the result of the application asking for access to the address book.
I’m currently working on a new blog post showing how to integrate a popular REST API. One of my tasks is to convert JSON to Delphi Objects, so I need to define the Delphi class structures to work with so I can use the TJSON.JSONToObject that I covered previously. I decided to see if anyone had done work to convert JSON into Delphi classes.
The JSON to Delphi Project is a Delphi FMX application that has a simple UI that allows you to modify the automatically created JSON class names which is pretty useful and the code worked first time when copied into my sample. (although I have more playing to do)
The JSON to Delphi tool is definitely a useful resource to work alongside the REST Debugger that you can find in the BIN directory of your RAD Studio install.
On the whole moving to 64bit (on iOS or Windows) is beautifully simple to achieve! It can be just as simple as adding the Delphi 64bit Windows target platform in the project manager and rebuilding the project.
My experience from talking to many developers who have moved up is that normally there are a few things to check in your code but typically its not a massive task to get compiling and ready to test.
A lot has been recorded on moving from Windows 32bit to Windows 64bit Delphi and this should be a useful summary if your just planning now moving up from older versions of Delphi to Delphi 10. If you are building iOS applications, then you will need to use the 64bit build now to get into the AppStore. Thankfully, Delphi has made the task of using 64bit very simple across all platforms and protected us from the headaches non Delphi Developers have had on the whole.
Lets start with this short video from David I who covers some the foundations in 7 minutes!
There are a number of classes that help along the way but there are two specific categories of classes and that is what I want to cover in this post.
LiveBindings and List v Link
Sometimes you want to fill a list with values; sometimes you want to keep a list of values updated; this is in essence the difference between using List (e.g. TBindList, TBindGridList) and Link (e.g. TBindListLink, TBindGridLink)
TBindList will fill a list with values, if the data/objects linked to changes then the data will not update unless you manually tell the list to re-populate using the bindings FillLists property.
TBindListLink however will keep the list in sync.
Before you continue… look at the samples
I recommend playing with the “OneOfEach” sample in the samples directory.
Try changing the fish name in the TBindGridLink and seeing how it updates over the other tabs where the FishFacts data is used.
What is a Binding Source and how is it different to the Control?