Planet Object Pascal

October 31, 2014

The Wiert Corner - irregular stream of stuff

jpluimers

Last week, I viewed to webinars. A smaller one Geek Fest – Automating the ForgeRock Platform Installation about Ansible installation of Unix machines, and the first 70% of the last day ofCodeRage 9 | Free Development Event by Embarcadero.

Both had a bad experience because of GoToWebinar has a really bad user experience.

  1.  When a GoToWebinar connection terminates, the GoToWebinar client closes. You loose everything in the Q&A log. You need to hope someone else saved the Q&A log so you can see the public questions, but the private comments you made are gone.
  2. It is impossible to install the Windows client when you are behind a McAfee Web Gateway that filters downloads and HTTPS traffic. After trying for about 15 minutes, we gave up and reverted back to a Mac over another connection. It meant we could not use the conference room and had to cram many people behind a small MacBook screen.
  3. The Mac OS X client does not allow you to resise the Q&A log, so even on a 4k display, you can see like 10 lines of Q&A.
  4. When there are many attendees, the refresh rate slows down from sub second to once per 5-10 seconds, this is really bad when watching demos of software: a big aim of webinars.

When terminating, the only thing GoToWebinar allows you to do is give feed back (too bad they don’t allow for detailed feed back). So I gave it 0 out of 5 stars.

–jeroen

PS: I could save the below Q&A logs. If you have other logs, please let me know so I can publish them. I’m especially interested in Have You Embraced Your Inner Software Plumber Yet? by David Schwartz – The Tool Wiz

These are the  CodeRage 9 – Object Pascal Sessions I could save the Q&A log of:


Filed under: Appmethod, Chrome, Delphi, Delphi XE7, Development, FireFox, Internet Explorer, Power User, Software Development, Web Browsers Tagged: GoToWebinar

by jpluimers at October 31, 2014 06:24 AM

October 30, 2014

The Wiert Corner - irregular stream of stuff

jpluimers

Session:

Creating Beautiful Animations in your Desktop and Mobile Applications

The session demonstrates how to create beautiful timeline-based animations in Object Pascal using the Mitov Software’s AnimationLab.

Level: All
Boian Mitov – Mitov Software

Q&A:

Welcome to CodeRage 9 – Object Pascal Track! Track Schedule: http://www.embarcadero.com/coderage/coderage-9-op-sessions

Audience Question

  • Q: It’s unfortunate that GoToMeeting only shows about 1 frame a second, which doesn’t do justice to the animations that the author is trying to show.
  • A: :-( They look great here.

Audience Question

  • Q: about Codesite have there been session in previous Coderage ?
  • A: I believe so.

Audience Question

  • Q: Of COURSE the animations look great over there. You are seeing them at a much faster frame rate than GTM transmits!
  • A: :-D

Audience Question

  • Q: WOW! Great components Boian, In the FireMonkey edition, can any descendant of TShape, such as Raize new Radiant components?
  • A: It works with any component via LiveBindings.

Audience Question

  • Q: Please, tell about Mitov.Runtime library.
  • A: Contact Boain for more information

Audience Question

  • Q: Is your SignalLab able to be used on Android and iOS?
  • A: Not yet, but coming soon.

Audience Question

  • Q: I dont find info about Mitov.Runtime on the homepage. Where can we find more info about it?
  • A: Email Boian. It isn’t published yet.

Audience Question

  • Q: Is there some video capture possibilities now, harvesting the activity together with speech to make videos from lessons etc. etc. (Like those made to prepare this lesson)
  • A: Perhaps.

Audience Question

  • Q: Do you support XE7?
  • A: Absolutely.

Audience Question

  • Q: Do you support XE7?
  • A: in Prerelease. Just finishing documentation.

Audience Question

  • Q: What are the different effects in the Physics engine?
  • A: Mass and drag (like fluid) effects only. Feel free to suggest other effects

Audience Question

  • Q: In the past ~2007 I had tried to use Myour lab for signal processing like FFT with scopes etc. but found it was not able to get support. Looks like that time in the past and Mitov now is a mature company and doing well.
  • A: Hope so.

Audience Question

  • Q: Is open wire in firemonkey
  • A: Yes, supports both VCL & FireMonkey, so works with non-visual too.

Audience Question

  • Q: Did I hear right – no iOS support?
  • A: Correct. Just don’t have an iOS device to develop and test on. Looking for it come in about a month.

Audience Question

  • Q: Thanks for great demo!
  • A: :-)

Audience Question

  • Q: Thank you!
  • A: :-)

http://www.embarcadero.com/radoffer

http://www.embarcadero.com/coderage/coderage-9-exhibit-hall

Audience Question

http://cc.embarcadero.com/reg/delphi

The registered user download page

Audience Question

Audience Question

Audience Question

Audience Question

  • Q: Yes, got a refreshing today :-)
  • A: :-)

Audience Question

  • Q: yes its in the list
  • A: :-)

Audience Question

  • Q: There is nothing special in converting from VCL to FireMonkey from XE6 to XE7… that’s why…
  • A: :-)

Audience Question

  • Q: thanks
  • A: :-)

Audience Question

  • Q: ^ mida xe7
  • A: Thanks!

Audience Question

Audience Question

–jeroen

via: CodeRage 9 – Object Pascal Sessions.


Filed under: Appmethod, Delphi, Delphi XE7, Development, Software Development

by jpluimers at October 30, 2014 09:05 PM

jpluimers

Session:

Advanced RTTI in Object Pascal

Runtime Type Information RTTI has always been a core feature of Delphi. But until recently, it was complex and limited. Now, RTTI is significantly more powerful, and yet much easier to use as well. This session describes in detail all of the changes that have been made and demonstrates the new capabilities with several examples including field inspection, method invocation, and custom attributes.

Level: Intermediate
Ray Konopka – Raize Software

Q&A:

 Q: I’ve put all of today’s chat logs at my http://wiert.me blog indexed at http://www.delphifeeds.com/

A: Great, thanks so much!

Audience Question

Q: If I should advise another tool nice for both program development, database development, project administration and brainstorming, it would be Mindjet Mind Manager 2014 Plus with Spigit Engage :-)

A: Nice

Audience Question

Q: Wirth what version of Delphji was extended RTTI introduced?

A: Delphi 2010

Audience Question

Q: Is there some literature on marshaling vs php on Linux servers? I now use a tool in Jedi JVCL for serializing using html/xml alike structures.

A: You can use RTTI

Audience Question

Q: Grate stuff, I can build new computer language by it!

A: :-)

Audience Question

Q: Is it possible to retrieve RTTI for strict private members?

A: Follow up with Ray via email.

Audience Question

Q: Using RTTI to access (private) fields directly would violate proper OO design. It would be better to have only the public fields, properties and methods being exposed/emitted by default.

A: Just because you can, doesn’t make it a good idea. Sounds like just the public properties are exposed by default.

Audience Question

Q: Can I use the adv. RTTI with any of my existing classes ? Like serializer for my classes ?

A: Should be able to.

Audience Question

Q: Is it possible to get class helper functions with RTTI ?

A: Not sure.

Audience Question

Q: Is it possible to get class helper functions with RTTI ?

A: Probably. Would need to experiment and see.

Audience Question

Q: The example of RttiMethod would work nice if you spell Create correctky, but perhaps you should have som try except to catch misspelled method names :-)

A: Good idea.

Audience Question

Q: Really great talk, Ray!

A: :-)

Audience Question

Q: Is there any way to add a field to an object? If no, what the best way to simulate?

A: maybe, with an agregate. Depends on what you are trying to solve.

Audience Question

Q: what is the immediate use of RTTI if i have the source code and can access all controls and data structures in code?

A: There are a lot of uses.

Audience Question

Q: support for records as well or just the classes ?

A: Records should have RTTI in the latest Delphi.

Audience Question

Q: I’ve used RTTI to design a flexible “security” system for applications– give administrators the ability to hide menu items, buttons, controls. Very useful for that.

A: :-)

Audience Question

Q: So essentially, it should be possible to create/add properties on-the-fly to classes/records based on scripts? this would be so powerful!

A: Not in the traditional sense. You would still need to manage the data, the object wouldn’t.

Audience Question

Q: field rtti for records was in 2010, for record methods came with like XE2 or later, rtti for record properties unfortunately still missing afaik :(

A: Good to know, thanks.

Audience Question

Q: Great Job Ray.

A: :-)

Audience Question

Q: If the application I am working on, should I care at all about RTTI?

A: Depends on what you are doing. Delphi uses for the designer.

Audience Question

Q: If you really need properties to be called from a script, then you should take a look at any of the Delphi Scripting engines: DWScript, TMS ScriptEngine, etc….

A: :-)

Audience Question

Q: Is there a list of projects in http://www.raize.com/Sessions/?

A: Please send me an email and I can provide: rkonopka@raize.com

Audience Question

Q: Could you give the download link for the source code of your Effectively Using Generics in Object Pascal session again?

A: http://www.raize.com/Sessions/DelphiGenerics.zip

Audience Question

Q: Links for source code?

A: You can email Ray rknopka@raize.com

Audience Question

Q: Links for source code?

A: http://raize.com/Sessions/AdvancedRTTI.zip

–jeroen

via: CodeRage 9 – Object Pascal Sessions.


Filed under: Appmethod, Delphi, Delphi XE7, Development, Software Development

by jpluimers at October 30, 2014 08:05 PM

jpluimers

Downloads:

CodeRage 9 Files!

This year I presented Push notifications with Android. Here are the files mentioned in the session!

Session:

Android Push Notifications

Want to send push notifications to your clients or employees? This session goes over setting up GCM, installing push notifications into your application, and calling GCM to push those messages to your app.

Level: Intermediate
Jeff Lefebvre

Q&A:

Audience Question

  • Q: Are you going to release the videos on youtube? I would recommend it if you weren’t. Youtube has become the place where people search for training.
  • A: As for previous CodeRage events, CodeRage 9 replays will be available within 1-2 weeks after the conference concludees on the CodeRage website at http://www.embarcadero.com/coderage.

Audience Question

Audience Question

  • Q: Ummm DailyDeveloper – eh? Sory about that!
  • A: :-)

Audience Question

  • Q: CodeRage is also an anagram for CodeGear
  • A: I didn’t know that. Nice.

Audience Question

Audience Question

  • Q: On my Android SDK Manager I didn’t see anything of Google and some other options shown in your demo y\under Extras. Am the installation too old?
  • A: If you run the update once and then restart again it should offer you more options.

Audience Question

  • Q: great presentation! thanks
  • A: Yeah, I really enjoyed it too!

Audience Question

Audience Question

  • Q: Is it possible to show the last slide with links ?
  • A: There you go.

Audience Question

  • Q: Are there any limitations in terms of how many notifications can be sent, commercial use, etc?
  • A: AFAIK there is no limit.

Audience Question

  • Q: Why there are no build in componnets in Delphi for push notifications for iOS and Android?
  • A: There are push notification components in XE7

Audience Question

Audience Question

  • Q: What is a diffrence beetwen push notification from XE7 and GCM ?
  • A: The XE7 push notifications go through Kinvey, Parse or App42 BaaS providers and still use GCM, but abstracts out the complexity.

Audience Question

Audience Question

  • Q: Seems like push notifications could be a way to register historic places, like cots where people lived 150 years ago before emigrating to US in order to put them on historic maps whee the places today has other names
  • A: Sure

Audience Question

  • Q: Would be for research where places was, like finding leftovers in terrain and want to register that in a database together with name of place
  • A: If you wanted to.

Audience Question

  • Q: thanks jeff
  • A: no problem :)

was a pleasure! Now back to work lol

Audience Question

  • Q: What do I get if I renew maintenance?
  • A: You get another year of updates. Not sure about Rapid SQL, but you should get most of the other stuff. Talk to sales and they can give you the details.

Audience Question

  • Q: If people have a stair around they should probably go some trips up and down to increase blood circulation in legs :-D I’ll do that now :-D
  • A: Blood circulation is a good thing, I’d agree with you there.

Audience Question

  • Q: Was that a TLikable class?
  • A: Absolutely.

Audience Question

  • Q: Is Jim McK a codemonkey
  • A: Yes, I am a Code Monkey. ;-)

Audience Question

  • Q: I would advise those who like the Rapid SQL to upgrade to DBPower studio
  • A: Nice.

–jeroen

via:


Filed under: Android, Android, Appmethod, Delphi, Delphi XE7, Development, Mobile Development, Power User, Software Development Tagged: android, Push notifications

by jpluimers at October 30, 2014 06:47 PM

jpluimers

Session:

Understanding Distributed Version Control

This session helps developers who have been working with a Centralized Version Control System such as SVN to understand and use Distributed Version Control such as GIT or Mercurial. This session focuses primarily on GIT, but applies to Mercurial. We also cover how to use GIT from the RAD Studio IDE.

Level: Beginning
Robert Love – State of Utah

Q&A:

Audience Question

  • Q: Can you say why you chose GIT over Mercurial?
  • A: Years ago I ran across a great blog post comparing both, as I had a hard time picking one. http://importantshock.wordpress.com/2008/08/07/git-vs-mercurial/ Ultimately I had to use GIT first on an Open Source project and got used to it, so I use it primarlly. I still have a few things I use that are with Hg. Overall one is not better than the other.
  • Q: Note the / is actually the slash, not the reverse slash (the \ is the back-slash, not a reverse slash either).
  • A: Thanks :-)
  • Q: Any way to speed up the refresh rate of GoToWebinar? A lot of what Robert Love shows can’t be seen as the webinar doesn’t keep up.
  • A: I can’t see a way to do this – Robert Love
  • Q: On my side, the GoToWebinar viewer refreshes like every 5-10 seconds, and I’m on a symmetric 50/50 megabit fiber connection.
  • A: Sometimes GoToWebinar gets slow, especially this time of the day. Sorry.

Audience Question

http://robstechcorner.blogspot.com/2014/10/introduction-to-git.html and

Audience Question

  • Q: In SVN there is a revision number, is there something simular in git? We commonly put the SVN revision number in the version information on our executables, is there something simular one can do using git to identify what revision the program was built from?
  • A: Git has a hash number that tells you the revision, but it isn’t an incremting number.
  • Q: I favour Github over BitBucket especially for repositories containing documentation as GitHub allows you to have Markdown files referring relative locations to images and other URLs without getting broken. BitBucket has struggled for years to support that and still doesn’t.
  • A: :-)
  • Q: Since Github only supports Git (few hosters support Mercurial), that basically forced me to the Git side of DVCS.
  • A: :-)

Audience Question

  • Q: Git has also a far easier way of importing SVN than Mercurial: Git has it built in.
  • A: :-)

Audience Question

  • Q: The Distributed (briefcase) model works for Open Source projects, because noone is being paid any money. Example: One published Request is picked up by 10 developers, and when they all commit their Versions, usually only one is used, and the other nine’s work is completely/laregly wasted. So … I guess I don’t find this distributed model very compelling.Great Presentation though
  • A: If isn’t compelling, don’t use it. Git also has much better support for branching, merging, etc.

Audience Question

Audience Question

  • Q: is it possible RAD will support TFS?
  • A: I think I saw a plug in for that.

Audience Question

Audience Question

  • Q: Most of the demos I’ve seen have tidy demos involving text files, where merging seems relatively easy, as it would be with a .pas file – how do you find merging DFM files? (Which I’ve occasionally found tricky in SVN) Does Git/HNG make this easier?
  • A: Nothing handles DFM well if someone is changing the same area of the file. Git does pretty well if the changes are in different parts of the DFM.
  • Q: BitBucket has the huge advantage of freely hosting private repositories. On GitHub you need to pay for that.
  • A: Yes

Q: DVCS know about the changes to a file (and have the whole change tree locally) so are far better at merging van a state based system like SVN (though SVN has gotten better over the years)

Audience Question

  • Q: Version Control under Tools>Options is only available in XE7?
  • A: SVN has been there for a while, but Git is XE7

Audience Question

  • Q: I use SVN, and can see some nice things about SourceTree vs SVN. Did I miss why GIT might be better than SVN?
  • A: There are a lot of differences and advantages to Git.

Audience Question

  • Q: I work on sparetime with an ideal organisation that has its own server and today we have a svn repository. Seems like with git you miust o\upload souircecode to open soiurce repositories. I wonder is it possible to set up our own git server for own use?
  • A: Yes, absolutely. You can host your own private server or a private repository on other servers.
  • Q: Version numbers should not depend on the kind of repository one uses. It makes you technically dependant on the repository. So version numbers should come from your build integration.
  • A: :-)
  • Q: Git and Mercurial are great for working while not always being on-line.
  • A: :-)

Audience Question

  • Q: Duplicate work isn’t a function of the source control. Manage that through a bug tracking system.
  • A: :-)

Audience Question

  • Q: SourceConnexion not available for XE6 or XE7.
  • A: Send them an email and ask them to update.

Audience Question

  • Q: DVCS know about the changes to a file (and have the whole change tree locally) so are far better at merging van a state based system like SVN (though SVN has gotten better over the years)
  • A: :-)

Audience Question

  • Q: I’ve missed the Bluetooth as well as this current session – will it be available for download ?
  • A: Yes, 1 – 2 week.s
  • Q: The whole trick with any version control mechanism is to split work in such a way that you make the merges to be in disparate pieces of your code base (even when in the same file). Even though Git and Mercurial are far better at merging than for instance SVS, SVN and TFS, each merge is a risk.
  • A: Sure

Audience Question

  • Q: re: SourceConneXion – we have a license for it and tried to use it, but it’s not even close to what we need. No any support for XE6&7
  • A: Sorry.

Audience Question

  • Q: For info, there is also Gitlab (https://about.gitlab.com/) if you want to host your own repositories. Fairly good and fairly feature rich
  • A: Thanks.

https://www.youtube.com/watch?v=5oUVJ1HWUVY

  • Q: Thanks for the great session. Well paced and well explained.
  • A: Your Welcome

Audience Question

  • Q: Do you have a tip for us how to treat common folders shared among projects?
  • A: GIT has a feature called SubModules that can do this.

http://www.embarcadero.com/coderage/coderage-9-exhibit-hall

Audience Question

  • Q: where does the name ‘CodeRage’ come from?
  • A: I believe “Rage” is to party or other excitement. So CodeRage is a Code Party or Code Excitement

–jeroen

via: CodeRage 9 – Object Pascal Sessions.


Filed under: Appmethod, BitBucket, CVS, Delphi, Delphi XE6, Delphi XE7, Development, DVCS - Distributed Version Control, git, GitHub, Mercurial/Hg, Software Development, Source Code Management, SourceTree, Subversion/SVN, TFS (Team Foundation System)

by jpluimers at October 30, 2014 06:19 PM

jpluimers

Session:

Bluetooth Classic and LE Programming with VCL and FMX

Level: Intermediate
Diego Navarro – Embarcadero

Q&A:

Audience Question

Audience Question

  • Q: can you please paste links int the chat window
  • A: Which link? I don’t have them in text if they are from the video, so I am just typing them in.

Audience Question

Audience Question

Audience Question

  • Q: On PC’s there is a CAMERA ICON on the upper right. of the Webinar window. I just snapshot the interesting pages and follow links later.
  • A: Good tip David!

Audience Question

Audience Question

Audience Question

Audience Question

  • Q: There is currently no common Bluetooth low energy Application Program Interface (API) for Android devices available
  • A: TBluetoothLE

Audience Question

Audience Question

  • Q: The sensor tag use BLE that is implemented in BT4.0. To work with Android you need Android with BT4.0 and OS 4.3+ (older version of Android doesn’t support BT 4.0)
  • A: Correct. :-)

Audience Question

  • Q: Can the Sensor tag be used with Android?
  • A: Yes, of course

Audience Question

  • Q: What is the accuracy of the gyroscopic sensor of SensorTag?
  • A: It’s really nice, the same chip is used in a lot of other devices, it’s not just a toy :)

Audience Question

  • Q: There is currently no common Bluetooth low energy Application Program Interface (API) for Android devices available
  • A: Yes, there is, since Android 4.3

Audience Question

  • Q: How can we find “custom” services from a Arduino Bluetooth LE Shield ? My app find the device but no services
  • A: It depends if the device is advertising the services.

Audience Question

  • Q: Got that now — apparentyl my Nexus 7 (2013) has it — so I’m OK
  • A: Good.

Audience Question

  • Q: Got that now — apparentyl my Nexus 7 (2013) has it — so I’m OK
  • A: yep, you Nexus 7 is fine for Bluetooth

Audience Question

  • Q: Can last connected device data be stored and be restored when app reboot?
  • A: it’s not useful, you can start doing a new startDiscover to get the devices around.

Audience Question

  • Q: Can I send binary data trough bluetooth?
  • A: Yes, right, you can, but Bluetooth LE is not intended for that, the bandwidth is so small, around 1 kB/s (LE)

Audience Question

  • Q: Can you provide a link where we could download the source code of your demo?
  • A: Diego will provide a download link for the sensor tag. You can find the rest with the samples folder.

Audience Question

  • Q: Working on Android with TBluetoothLE component i noticed that subscribe characteristic work only with the device/sensor that support notification property and not indication property. It is possible? Is something that will be available on update1? Thanks
  • A: That should be working.

Audience Question

Audience Question

  • Q: Do you know if the BLE component works with BT devices implemented Mesh technology?
  • A: Need to check. Unsure.

Audience Question

  • Q: How can we get the UUID of the device found?
  • A: Not recommend. Look for devices that implement the service you need.

Audience Question

  • Q: DavidI, where can I see your awesome video,”codemonkey”? I want to see it again. It’s parsonal question..
  • A: This is Jim. I’ll try to find an opportunity to show it again today. It isn’t available anywhere but here yet.

Audience Question

  • Q: Mesh technology is kind of distributed network of BT devices that connect each other to spread the BT messages to devices that can be out of range.
  • A: It should work.

Audience Question

Audience Question

  • Q: One hint: don’t forget to add “bluetooth” to the uses permissions on android.
  • A: Good tip.

Audience Question

  • Q: Can we find or uses non advertised “custom” services?
  • A: You need to know about the UUID and sservices and then you can connect and use them.

Audience Question

Audience Question

  • Q: Will order a sensor and give this a try $25 — spent more on lunch most days. :-) Digikey, Newark and Mouser carry them if you need some help finding one. Also the TI store.
  • A: :-)

Audience Question

  • Q: The radio rate is 2Mb/sec. I suspect mesh is limited or impractical. The spec doc should make it more clear. Only 354 pages — happy reading. Link above.
  • A: :-)

Audience Question

  • Q: Diego Navarro blog address?
  • A: Stay tuned to Delphi.org and I will make sure and link to his post when it is available.

Audience Question

  • Q: In proprietary mode, the CC2541 radio supports data rates up to 2 Mbps, and has extensive baseband automation, including auto-acknowledgment and address decoding. The RF Core controls the analog radio module and the RF transceiver state. In addition, it provides an interface between the MCU and the radio which makes it possible to issue commands, read status, and automate and sequence radio events. It has 1 KB of dedicated RAM, which holds the 128-byte transmit and receive FIFO. This chapter describes the proprietary mode operation of the CC2541 devices and features in the LLE program. For Bluetooth low energy operation, see Chapter 24.
  • A: Thanks!

Audience Question

  • Q: this just gets better and better every time I see it
  • A: Thanks!

Audience Question

  • Q: Great presentation! especially the TI sensor implementation .
  • A: Yes, I agree.

Audience Question

  • Q: DavidI, I am sad that I can’t find the page of “http://delphi.org/CodeMonkey”. It causes 404 error.
  • A: Yes, it isn’t available yet. I’ll have the video online soon. For now it is just for CodeRage attendees. BTW, this is Jim McKeeth. ;-)

Audience Question

  • Q: We all have our pet projects in delphi. Here’s mine. Halloween light show with sound in my front yard controlled by delphi DMX Lighting system platform I created.
  • A: Nice

Audience Question

–jeroen

via: CodeRage 9 – Object Pascal Sessions.


Filed under: Appmethod, Delphi, Delphi XE7, Development, Software Development

by jpluimers at October 30, 2014 04:55 PM

jpluimers

Session:

InterBase Keynote

If you need to manage distributed data over multiple locations then don’t miss the product address for InterBase! The next generation of InterBase is coming soon and will be super charged with a powerful new change tracking engine that makes managing distributed datasets a whole load easier!

Level: All
Stephen Ball – Embarcadero

Q&A:

Audience Question

  • Q: Off topic: Has their been any reports of issues with Yosemite and virtual machines (VMWare)? I am planning on updating my OS X this weekend.
  • A: I know Parallels has released an update to work with Yosemite. It is pretty common that you need a new version to support a new OS. I’d check with VMWare to see if they have an update or what they recommend. I haven’t updated yet because I’ve been so busy with CodeRage and everything, but plan to upgrade both Parallels and OS X next week.

Audience Question

  • Q: just changed
  • A: Sorry.

Audience Question

  • Q: Paralles 9 still works on Yosemite. However, 10 is supposed to work more efficiently.
  • A: Good to know.

Audience Question

  • Q: I’m using Parallels along with Yosemite and Windows 10 without any problems!
  • A: Nice.

Audience Question

  • Q: No problem. Looks like he was on the first slide whole time.
  • A: There was an intermediate slide but the screen was hung. My falt. Sorry.

Audience Question

  • Q: Parallels 9 have issues with Windows 10 and Yosemite. You must upgrade to Parallels 10.
  • A: Good to know.

Audience Question

  • Q: if i need to database 1 million news stories aday and proive a search functionality on headlines and story bodies where you can do word seach or phrase search for over 100 people, is interbase a good solution or is a noSQL better?
  • A: InterBase gives you User Defined Functions for searching. So there are ways to add search. There are other advantages too.

Audience Question

  • Q: does IB support #memory tables as in SQL ?
  • A: Not Memtables, but you can use FireDAC and InterBase supports Temporary Tables. So it depeds on your use case.

Audience Question

  • Q: meant caching tables within the engines
  • A: The caching algorythems optimize to use the memory you provide the database to keep the tables in memory.

Audience Question

  • Q: Excellent!! never looked at IB seriously, will join th BETA. thanks for the great presentation
  • A: :-)

Audience Question

  • Q: I have sampled audio/Seismic streams and stored on IB — several hundred and several thousand samples per second for 24 hours — that’s several GByte per day. A decent Linux server lets this work fine.
  • A: :-)

Audience Question

  • Q: perfect – looking forward to the Beta
  • A: :-)

Audience Question

Audience Question

  • Q: btw someone know any map to “translate” mac keyboard to windows i toke me 1 hour to find backslash
  • A: Some of the Virtual Machine software suppors that. Beyond that I am not sure.

Audience Question

  • Q: The barcode really does work if your tablet is handy. Only caught the second one though. It was the first one I wanted. Oh well — waiting for the replay!
  • A: We will ahve the replays in a week or two. You’ll get an email.

Audience Question

–jeroen

via: CodeRage 9 – Object Pascal Sessions.


Filed under: Appmethod, Database Development, Delphi, Delphi XE7, Development, InterBase, Software Development Tagged: InterBase

by jpluimers at October 30, 2014 04:30 PM

jpluimers

Session:

Working with PDF and Office Documents using VCL and FireMonkey

In this session, we take a deep look into the all-new multi-format document processing toolset for Delphi from Gnostice. We take a brief look at architectural details of the product and then go into using the product. You’ll get to see real code examples for viewing, printing, converting and processing documents in Delphi VCL and FireMonkey on Desktop and mobiles devices. You’ll also see examples of document processing using the new Gnostice REST-based document server.

Level: All
Girish Patil – Gnostice

Q&A:

Audience Question

  • Q: i wish there was a C++ to Delphi converter at least for porting code. So when I get a API sample from someone that’s in C++ i could just convert it to delphi and tweek it from there.
  • A: It would be nice.

Audience Question

  • Q: WIll this work as a document viewer for iOS and Android apps?
  • A: Yes, the native viewer for iOS will, but not yet for Android.

Audience Question

  • Q: How do you recommend controlling duplex and tray selection when printing several documents in one batch?
  • A: Currently not possible, unless you use the printer object.

Audience Question

  • Q: Is Android support in the works?
  • A: yes

Audience Question

  • Q: those it compress the final result PDF? can we teak it ?
  • A: there is compression. Working on improving it.

Audience Question

  • Q: If systools is needed for xe7 but isn’t in sourceforge, it only required creating a xe7 package. The source is compatible
  • A: nice

Audience Question

  • Q: If I wanted to create an app on the Mac, using FireMonkey, what would be the correct choice on the Website? ie: would “XtremeDevSystem Delphi Subscription 8″ be the correct choice?
  • A: That would be a good choice, but the XtremeDocumentStudio would do too

Audience Question

  • Q: It would be nice to have a LITE pdf viewer for firemonkey, that could read from files or streams.
  • A: There is a view, print and convert edition as well that you could look into.

Audience Question

  • Q: Can PDF’s be saved in PDF/A format?
  • A: Something in the works right now. Expect it early 2015

Audience Question

  • Q: Will it be compatible with C++Builder any time soon?
  • A: It is now.

Audience Question

  • Q: how about excel documents
  • A: Currently supporting the wordprosseing formations. Spreadsheets are coming next year.

Audience Question

  • Q: For sensitive data, you show phone and email, can you remove sensitive pages from documents such as Financial info pages from a document.
  • A: You would need to use two functions: Search to find the information and then delete page on that page.

Audience Question

  • Q: Is Signing and Verification supported?
  • A: Signing is supported. Verification is not. Signing requires the PDF toolkit project.

Audience Question

  • Q: Is there any plans for a document composer or editor?
  • A: Yes, that is planned. Plan to cover everything related to documents.

Audience Question

  • Q: does your viewer have the ability to touch or click contained words for event processing. ie. click a contained drawing number and lookup a database entry
  • A: There are mouse events that tell you where the click was in reference to the page, but doesn’t report what was clicked on. Full interactivity in the viewer is planned. Form filling and annotation support is coming.

http://www.embarcadero.com/coderage/coderage-9-exhibit-hall

Audience Question

  • Q: XE7 update1 is comming soon right? If so, does installing the update require reregister the product ?
  • A: You need a valid license and to be a registered user to install Update 1 when it is available.

Audience Question

  • Q: I am, just want to know if that require reregistering or not
  • A: Oh, does not require re-registering. I didn’t catch that the first time. Installing the update does not increment your registration count. If you do exceed your registratiosn though, you can submit for a registration limit increase.

Audience Question

  • Q: thanks
  • A: Sure.

Audience Question

  • Q: TurboPower Async pro Fax components where not upgraded :(
  • A: OK.

–jeroen

via: CodeRage 9 – Object Pascal Sessions.


Filed under: Appmethod, Delphi, Delphi XE7, Development, Software Development

by jpluimers at October 30, 2014 03:12 PM

jpluimers

Session:

NestedDataSets in ClientDataSets

A column of a ClientDataSet can contain a dataset, a tabular structure containing one or more columns and zero or more records. This presentation continues Cary Jensen’s CodeRage series on ClientDataSets by looking at this power field type.

Level: All
Cary Jensen – Jensen Data Systems, Inc.

Q&A:

Audience Question

  • Q: Would nested datasets akso be usable for defining new, lacking records in different tables
  • A: Yes. In the presentation I demonstrate creating nested dataset structures where no underlying database already exists

Audience Question

  • Q: Would nested datasets be something similar to a view made from lot of tables with ‘from table1 left join t on (table2.key=table1.key) left join …………
  • A: No. That would create a single table with values from two tables. A nested dataset is a dataset nested within a field of another dataset. With nested datasets you actually have two or more different tables

Audience Question

  • Q: Is there an easy way to exncrypt the data in a file that was written out using clientdataset or FDMemTable to for instance XML or JSON type file? Would one need to stream it and then encrypt/decrypt the stream upon writing/reading?
  • A: You got it right in you suggestion. To encrypt, you write from the CDS or FDMemTable to a stream, encrypt the stream, and then write that stream. You do the same in reverse to load the encrypted data

Audience Question

  • Q: ClientDataSet can be connected to 3rd party datasets using the provider component.Is FDMemtable limited to Firedac datasets ?
  • A: FDMemTables are currently designed for FireDAC datasets

Audience Question

  • Q: If I have a many to many relationship using an intersection table in between (Table A 1-n Table AB n-1 Table B). How do I write this out using the nested datasets?
  • A: To a file, call SaveToFile on the top-level CDS

Audience Question

  • Q: How am I going to get you to sign your new book !!! Having got you to sign your back back in London Delphi Deve Days !! LOL
  • A: We’ll just have to get you back to a Delphi Developer Days :)

Audience Question

  • Q: Nice presentation Carry
  • A: Thank you

Audience Question

Audience Question

  • Q: You show both the MidLevelCDS and the ThirdLevelCDS owned by the TopLevelCDS. Would/should the ThirdLevelCDS be owned by the MidLevelCDS instead?
  • A: The ownership is a detail, and has no effect on the master-detail linkage

Audience Question

  • Q: Audio: Still some artifacts, but clearer than it was
  • A: :-)

Audience Question

  • Q: I am routinely impressed with Cary’s knowledge and communication skills. Both contribute to my enthusiasm for Object Pascal! THANKS
  • A: :-)

Audience Question

  • Q: Great Presentation! I used this technique in a moblie application. It takes a little longer to load, initially, but once the data is loaded, no more round trips are required – which makes the app MUCH more robust.
  • A: :-)

Audience Question

  • Q: I was thinking about an a customer exists, but a certain order is lacking, could that lacking order record be inserted?
  • A: Not only can it be inserted into the detail table nested dataset, that record will be inserted by the TLD by a call to ApplyUpdates.

Audience Question

Audience Question

  • Q: An example on this compressing/encypting/saving and then loading/decrypting/uncompressing would be great.
  • A: Yes it would. Thanks.

Audience Question

  • Q: where do you find the latest version of the Turbo Power stuff
  • A: Source Forge

Audience Question

  • Q: Great Presentation! I used this technique in a moblie application. It takes a little longer to load, initially, but once the data is loaded, no more round trips are required – which makes the app MUCH more robust.
  • A: http://blog.kassebaum.eu/?p=379

Audience Question

  • Q: Is there a possibility in future that tclientdataset becames deprecated?
  • A: I doublt it, at least not anytime in the near future

Audience Question

  • Q: There are multiple flavors on SourceForge (…”New”)
  • A: Great.

More information on the special offers http://www.embarcadero.com/radoffer

Audience Question

Audience Question

  • Q: Confirmed – The link works
  • A: :-)

Audience Question

  • Q: Hope systools also would be part of the pacoage
  • A: That one might get some attention later. ;-)

–jeroen

via: CodeRage 9 – Object Pascal Sessions.


Filed under: Appmethod, Delphi, Delphi XE7, Development, Software Development

by jpluimers at October 30, 2014 03:09 PM

jpluimers

Session:

ClientDataSets and FDMemTables Compared

ClientDataSets are in-memory tables that have been in RAD Studio since Delphi 3, but there’s a new kid in town, the FireDAC FDMemTable. This presentation, by ClientDataSet expert Cary Jensen, compares and contrasts these in-memory table classes, providing you with guidance on which to use and when.

Level: All
Cary Jensen – Jensen Data Systems, Inc.

The Q&A log:

Welcome to CodeRage 9!

  • Q: Thanks for organizing this. Hi from The Netherlands
  • A: Hello and thanks for joining us!

Audience Question

  • Q: yes a great thing, greetings from Germany too!
  • A: You are welcome. Thanks for being here.

Audience Question

  • Q: Ill agreewith Neterhlands and Germany its 3 tuff days for you but very useful for us developers of all levels , hello and thanks from Swesen
  • A: Thanks and you are welcome!

Audience Question

  • Q: Good morning, David
  • A: You get Jim today. David is in the C++ track.

Audience Question

  • Q: Hello, I missed Allen Bauer’s session yesterday. Any links for demos and contact details for him, if possible?
  • A: Replays will be available for CodeRage sessions that you may have missed within 1-2 weeks of the conference conclusion on the CodeRage website.

Audience Question

  • Q: From Spain. Thanks you very much. Hello, smart thinks !
  • A: :-D You are welcome! Thanks for being here.

Audience Question

  • Q: Hi, Jim
  • A: Hi Cary!

Audience Question

  • Q: Ready with bells on. :)
  • A: Nice.

Audience Question

  • Q: Morning Chaps :)
  • A: Good morning!

Audience Question

  • Q: Thx for reviving the XE7 trial key
  • A: Certainly.

Audience Question

  • Q: Good morning. I’m from Indonesia.
  • A: Morning!

More information on the special offers http://www.embarcadero.com/radoffer

The virtual exhibit hall http://www.embarcadero.com/coderage/coderage-9-exhibit-hall

Use the 10% off discount code “THINGS”

Audience Question

  • Q: Can one inmemory object contain updates to several tables in one, or do I need to update one table at a time.
  • A: Use nested datasets to include more than one table. CDS and FDMemTable differ. I discuss this later

Audience Question

  • Q: Are the CDS andf FD XML file formats compatible?
  • A: Not really

Audience Question

  • Q: If I want to use either in different threads, do I need to implement my own locking/protection, or are there any features that make this same and easy?
  • A: You need to implement your own synchronization. If the threads are created after the dataset is created, and the dataset is treated read-only, there may be no problems

Audience Question

  • Q: Better wording -> If I want to use either dataset in different threads, do I need to implement my own locking/protection, or are there any features that make this safe and easy?
  • A: Same answer as above. We can talk about this in Q&A

Audience Question

Audience Question

  • Q: did the CDS developers ever fix the performance problem encountered when adding lots of rows?
  • A: I don’t think so

Audience Question

  • Q: Are there plans to add support for TDatasetProviders to FDMemTable? It means otherwise a complete re-write of the existing DataSnap stack…
  • A: No. FDMemTables will likley support different mechanisms. FireDACJSONReflect is one of those

Audience Question

  • Q: You know what would be cool? A book dedicated to FDMemTables.
  • A: Yes. I wonder who might write that :)

Audience Question

  • Q: Thanks. My main use of CDS at the moment is as self-contained data containers inside a mobile app (ios and Android) which can take data via Datasnap and store locally to a file when offline. Biggest dataset is say 5000 records which includes some memo fields. Do you think there would be noticeable performance improvements using FDMemTables? (Sorry, tough question I know). Some filtering currently takes 2-3 seconds for example.
  • A: FDMemTables are often demonstratable faster than ClientDataSets, so there might be a performance enhancement

Audience Question

  • Q: If updating a tclientdataset based app to FDMemtable based, can I during update have both datasets involved on server or client?
  • A: Yes

Audience Question

  • Q: I cannot understand what Jensen is saying! :(
  • A: :-( It is difficult.

Audience Question

  • Q: Your new book does it contain information on FDMemTable or is it just on ClientDataSets?
  • A: It is exclusively ClientDataSet, and will be the last edition of that book since FDMemTable is gaining more of the features from ClientDataSet. It brings it up to XE7.

Audience Question

  • Q: The previous book was not electronically available. Will the new version be available in ebook format ex. through Amazon Kindle?
  • A: It will be Kindle

Audience Question

  • Q: I have very large applications using DataSnap and ClientDataSets in a Multi-Tier structure. Is It viable to change this structure to use FDMemTable?
  • A: It is, but wait for FDMemTable to expand.

Audience Question

  • Q: FDS binary output file size is 2x times larger than CDS binary output file size
  • A: thx

Audience Question

  • Q: I think you said you currently can’t move data from a CDS into a FDMem, is that right?
  • A: Not via the XML data property, or the XML file. You would need to read and pump the individual records. Maybe use the FD Batch move. They are different internally.

Audience Question

Audience Question

  • Q: How it’s working refrshing data on client side when using FDMemTable ? You show geting all DataSet and Aplying Updates but what with refreshing ? I need to get all DataSet again ?
  • A: You should be able to refresh the current record. Not sure. There are a lot of similarities between the two.

Audience Question

  • Q: Can we get discount on the new book .. if we bought the previous version :)
  • A: That isn’t possible through Amazon. The book will be reasonable priced.

Audience Question

Audience Question

  • Q: Really liked the first edition and refer to it a lot so looking forward to buying print and electronic copies of 2nd
  • A: :-D

Audience Question

  • Q: When making the video from this speech, is it possible to remaster the Q&A part by reanswering the questions so it is possible to understand what is said? (If Cary understand what he said)
  • A: We will

Audience Question

  • Q: DDD is great!
  • A: Thanks!

Audience Question

  • Q: I’ve been looking for a good solution to store complex configuration data specific to the working of the application. I’ve looked at XML files, JSON files, Client Datasets , IB2Go and would also now consider the FDMem tables. Can you suggest anyone over the others?
  • A: Using ClientDataSet or FDMemTable with nested datasets is a nice solution. FDMemTable supports JSON, which is more concise than XML

–jeroen

via: CodeRage 9 – Object Pascal Sessions.


Filed under: Appmethod, Delphi, Delphi XE7, Development, Software Development

by jpluimers at October 30, 2014 01:00 PM

jpluimers

Interesting:

A Dark Pattern is a type of user interface that appears to have been carefully crafted to trick users into doing things, such as buying insurance with their purchase or signing up for recurring bills.

We developers have a big responsibility. Martin Fowler and Erik Dörnenburg (both ThoughtWorks) did a great presentation about that at the GOTO Aarhus 2014 Conference.

A quote:

“The developer who wrote that code is every bit as responsible as the person who told them to do it. You have a choice. You have a responsibility to ensure that your users are well treated and to reject dark patterns,” says Fowler. “We have a whole profession of people writing software and doing enormous things to change the way we live in the world.”

Please watch the video: Our Responsibility to Defeat Mass Surveillance – Erik Dörnenburg and Martin Fowler – YouTube.

–jeroen

via


Filed under: .NET, Delphi, Development, Software Development, Usability, User Experience

by jpluimers at October 30, 2014 11:00 AM

October 29, 2014

twm’s blog

Avira Antivirus E-Mail “security”

The current Avira Antivirus has got a module it calls “Internet scurity” which in turn has an option for e-mail security.

What it does is capturing all connections to POP3, IMAP and SMTP servers and scanning them for viruses. That sounds good until you find, that your e-mail client stopped working even though you haven’t changed anything in it’s configuration.

Why is that? It’s because of this e-mail “security” feature. If you are using encrypted transport (START TLS or SSL/TLS), Avira cannot read the traffic and blocks it! This is so stupid, there must be an award for it somewhere.

To work around this, you can of course

  • disable the e-mail security feature
  • disable transport encryption

The first has the drawback that Avira now complains that your computer is not secure. The second has the drawback that your e-mails can be read by everybody who can access your connection to the server. So both options aren’t really solutions. If Avira forces you to do that (e.g. if the following doesn’t work for you because your mail server does not have alternative ports for encrypted connections), your computer is actually less secure than without Avira e-mail “security”.

Then there is the third option: Don’t use the default SMTP (25), POP3 (110) and IMAP (143) ports but use different ones, e.g. the ones that are reserved for encrypted transports:

  • SMTPS: 465
  • POP3S: 995
  • IMAPS: 993

Unfortunately that means your mail servers must support these protocols / ports. E.g. if you are using postfix you have to change / uncomment the following lines in the /etc/postfix/master.cf file:

smtps     inet  n       -       -       -       -       smtpd
#  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes

And, or course, restart postfix.

The same applies to your POP3 or IMAP server.

If you can’t do that and your e-mail provider doesn’t support this, tough luck!

In addition, you must change the configuration in your e-mail client. In Thunderbird that’s pretty much straight forward:

WARNING: I will not fix your computer if you break it even if you followed my instructions. It’s your own responsibility. Making a mistake in the Thunderbird configuration will prevent it from receiving and/or sending e-mails.

  • Open the account settings dialog.
  • Select “Server Settings”.
  • Under Connection Security, select SSL/TLS (preferred) or STARTTLS, depending on what your server supports.
  • The port number will change automatically. If it doesn’t or your server does not use the default ports for encrypted transport, change the port number.
  • Select “Outgoing Server (SMTP)” (it’s down, below “Local Folders”).
  • Edit the entry you want to change (usually there is only one).
  • Change Connection Security to SSL/TLS (preferred) or STARTTLS, depending on what your server supports.
  • The port number will change automatically. If it doesn’t or your server does not use the default ports for encrypted transport, change the port number.

Now test it and have fun.

by dummzeuch at October 29, 2014 04:59 PM

The Podcast at Delphi.org

Voice Enable Your Android Apps

During CodeRage 9 I revisited adding voice support to Android apps. There are some updates from my previous skill sprint coverage on the topic and my original post on launching Google Glass apps via Voice.

You can download the Samples and Components on GitHub. It covers voice recognition, text to speech and launching apps on Google glass with your voice. The examples also cover Android Wear.

Voice Launching Google Glass Apps

  • Add a Voice Trigger XML file:
  • Modify the Android Manifest Template:
    • Add an Intent Filter
      • <action android:name=”com.google.android.glass.action.VOICE_TRIGGER”/>
  • Add Meta Data for Filter
    • <meta-data android:name=”com.google.android.glass.VoiceTrigger”
             android:resource=”@xml/my_voice_trigger” />

Custom Glass Voice Trigger

  • Change XML to from Command to Keyword.
  • Use arbitrary text for voice trigger.
  • Use the Development permission:
    • <uses-permission
      android:name=”com.google.android.glass.permission.DEVELOPMENT”/>
    • Added to android manifest template
  • Not allowed for app store distribution
    • Usable for in-house or ad-hoc use

Additional Prompts on Google Glass

  • Collect additional Voice recognition input when app is launched.
    • Add an Input Prompt to the Voice Trigger XML
      • <?xml version=”1.0″ encoding=”UTF-8″?>
      • <trigger command=”TAKE_A_NOTE”>
      •     <input prompt=”What shall I say?” />
      • </trigger>
  • In FormCreate get speech guesses from Intent Extras
    • SharedActivity.getIntent.getExtras. getStringArrayList(TJRecognizerIntent.JavaClass.EXTRA_RESULTS);

Voice Recognition on AndroidAndroid/Google - Speak Now

  • Prompts user for voice input
  • Returns up to 5 “guesses”
  • Works offline too
    • (only returns 1 guess)
  • Reusable component for download.
  • Requires RECORD_AUDIO & INTERNET permissions.
  • Sends audio to Google’s servers.
  • Uses context to select words.
  • Pronounce punctuation (period, comma, etc.)
  • Works on Android phones & tablets
  • Works on Google Glass
  • Works on Android Wear
  • Doesn’t work on iOS (no exposed API)

Using TSpeechRecognition Component

  • Properties
    • Language: en-US
    • Prompt: Speak now
    • AlwaysGuesses: True
  • Methods
    • Listen
    • ListenFor
  • Events
    • OnRecognition
    • OnRecognitionEx
    • OnCommand

Text-To-Speech on Android

  • Converts Text to spoken word.
  • Reusable component based on Jeff Overcash’s translation.
  • Code shows example of handling Java Listener events.
  • Works on Android phones & tablets
  • Works on Google Glass
  • Doesn’t work on Android Wear (no speaker)
  • iOS Support is possible . . . . (needs implementation)

Using TAndroidTTS Component (component name may change)

  • Just one procedure: Speak

A Note About iOS

  • iOS does not expose voice recognition API
    • (Need to use 3rd party)
  • iOS 7 supports Text to Speech API
    • AVSpeechSynthesizer
    • Just haven’t implemented in component yet

Google Glass Voice Trigger Sample

The replay video will be available here later.

Download the XE7 Trial today and check out the special offers.

by Jim McKeeth at October 29, 2014 01:06 AM

October 28, 2014

The Podcast at Delphi.org

Fire UI and the Multi-Device Designer

During CodeRage 8 I had a session on Fire UI and the Multi-Device Designer. You can also check out my previous post on creating a custom FireUI view for the Moto 360.

Fire UI is made up of three parts:

  1. Behavior Services – Runtime & design time platform design information
  2. Multi-Device Designer – Unified project – Tweak UI for platforms
  3. TMultiView Component – Adaptive layout

Behavior Services at Design Time

  • Examples:
    • TTabControl.TabPosition
      • Bottom on iOS, top otherwise
    • Font.Size & Font.Family
    • Many controls have Size.PlatformDefault = True
    • TMultiView mode

Behavior Services at Runtime

  • TBehaviorServices class in FMX.BehaviorManager.pas
  • IDeviceBehavior defines
    • GetDeviceClass: TDeviceInfo.TDeviceClass;
    • GetOSPlatform: TOSPlatform; // Windows, OSX, iOS, Android
    • GetDisplayMetrics: TDeviceDisplayMetrics;
  • IFontBehavior defines
    • GetDefaultFontFamily & GetDefaultFontSize

OS Specific example

 var
  DeviceBehavior: IDeviceBehavior;
begin
  if TBehaviorServices.Current.SupportsBehaviorService(?
    IDeviceBehavior, DeviceBehavior, Self) and
    (DeviceBehavior.GetOSPlatform = TOSPlatform.iOS) then
    // behavior specific to iOS
end;

Display metrics example

var
  DisplayMetrics: TDeviceDisplayMetrics;
begin                        // self is a form in this case
  DisplayMetrics := DeviceBehavior.GetDisplayMetrics(Self);
  if DisplayMetrics.AspectRatio > x then
    // AspectRatio specific behavior
end;
type
TDeviceDisplayMetrics = record
    PhysicalScreenSize: TSize;
    LogicalScreenSize: TSize;
    AspectRatio: Single;
    PixelsPerInch: Integer;
    ScreenScale: Single;
    FontScale: Single;
end;

More Information

Check back later and I’ll have the video replay available too.

Download the XE7 Trial today and check out the special offers.

by Jim McKeeth at October 28, 2014 04:18 PM

Firebird News

Node C++ driver node-firebird-libfbclient updated to version v0.0.11

Node C++ Module for Firebird is updated in git repository and is already pushed to npm It can be compiled now with node v10.x  , There is work in progress for node v11.x nan is now a dependency If you want to install it from git sudo npm install -g  xdenser/node-firebird-libfbclient or from npm with […]

by mariuz at October 28, 2014 02:57 PM

Firebird release strategy for 2015-2016 #fbconf14

We start to publish presentations from Firebird Conference 2014. The first presentation is “Firebird release strategy in 2015-2016“, by Dmitry Yemanov, core Firebird architect  

by mariuz at October 28, 2014 02:25 PM

Castle Game Engine news

Reshared post from Michalis Kamburelis:

Original Post from Michalis Kamburelis:

Frogger 3D for Android and Linux :) My 0h gamejam game, slightly extended --- with shadows, better 3D, touch support, infinite cylinders, water etc. Because I can :) Download from https://sourceforge.net/projects/castle-engine/files/frogger3d/

Source code on github: https://github.com/michaliskambi/frogger3d

October 28, 2014 04:03 AM

October 27, 2014

Firebird News

Mark Rotteveel Firebird Conference presentations + source code #fbconf14

Here are his  Firebird Conference Jaybird and Jooq presentations + source code:   1:http://prezi.com/jqlzg6rkdhg_/jaybird-status-update/ 2:http://prezi.com/-oggns1ehvmv/querying-firebird-with-jpa-and-jooq/ 3:https://github.com/mrotteveel/talk2014  

by mariuz at October 27, 2014 07:57 AM

October 24, 2014

Firebird News

#fbconf14 is the official twitter stream for Firebird Conference 2014

You can watch the twitter stream from Firebird Conference 2014 : #fbconf14

by mariuz at October 24, 2014 02:51 PM

October 23, 2014

twm’s blog

Fighting Secure Boot

I have bought an Acer Extensa notebook after reading the under 300 Euros notebooks test in the latest c’t magazine where it came up as the winner regarding battery life and the rest wasn’t too bad either. I chose the 4 GB model so it won’t thrash the hd all the time. The Extensa comes preinstalled with Windows 8.1 and – as so many computers nowadays comes without an install medium and also without a user’s manual. (The link given in the short setup guide for downloading the manual http://go.acer.com/?id=17833 leads to a non-functional site. Not very user friendly in my book.)

Now, what is the first thing you do, when you get a new computer which comes pre-installed with an operating system but does not come with an install medium? I for one, make a backup, preferably an image backup of the whole hard disk using Clonezilla. Since this is my image backup tool of choice I carry it with me on a USB stick almost all the time (Hey, I work in IT, so it’s pretty much normal to carry USB sticks and other stuff. ;-) ). So I plugged that USB stick into the notbook and booted it up. It went straight into the Windows 8.1 setup screen. :-(

So I tried to get a boot menu. Perusing Google told me that Acer notebooks use F12 for the boot menu. Unfortunately this didn’t work. Windows 8.1 setup again. :-(

Next, I tried to get into the BIOS, or whatever the UEFI stuff nowadays calls this tool. The usual DEL key didn’t work but after several reboots and key presses I ended up in some windows boot menu that allowed me to boot from an USB stick. Only, it didn’t. It told me there was a secure boot failure and stopped.

Turning the computer off and on again, this time I apparently got the BIOS setup key right: F2 (I didn’t work the first several times I tried it, why?) I got something called “Insydeh” which looked like a BIOS of old. And there it was: An option to turn off “secure boot”, only it was disabled. I could only switch to BIOS mode which I didn’t want to. WTF?

Google to the rescue again: To turn off secure boot, you first must set a supervisor password. So I did that, came back to the secure boot screen and lo and behold, the option to turn it off was enabled now. After turning it off, I could clear the supervisor password and the option was still enabled. Another setting I changed was the F12 boot menu. It was disabled by default so I enabled it.

Save and reboot, press F12 and – voila – a boot menu which finally allowed me to boot clonezilla from my USB stick. The backup is running now.

Praise Microsoft for requiring PC manufacturers to have an option to turn off secure boot if they want to be Windows 8 compliant (I wonder whether that will still be a requirement for Windows 10, though.). But curse Microsoft and the bloody PC manufacturers to come up with the pretty much useless secure boot feature at all. It’s my computer, I paid for it, so it should be my choice to install whatever operating system I want on it!

by dummzeuch at October 23, 2014 06:26 PM

The Wiert Corner - irregular stream of stuff

October 22, 2014

The Wiert Corner - irregular stream of stuff

jpluimers

It is always nice to see one of the compiler engineers write down how something was implemented.

In this case, Barry Kelly explains in comp.compilers on Implementing Closures in Delphi 2009. The post is about 4.5 years old, but still very relevant.

About 9 months earlier, he participated in a Reddit thread about a similar topic. Worth reading too!

–jeroen

via: Implementing Closures – Google Groups.


Filed under: Delphi, Delphi 2009, Delphi 2010, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development

by jpluimers at October 22, 2014 05:00 AM

October 21, 2014

Firebird News

Firebird 3 Launch Campaign!

Firebird 3 is on the fast track to be released very soon, and all FirebirdSQL developers should help Firebird Project to release v 3.0 as soon as possible. You can help Firebird in the following areas: Beta-testers! Firebird 3 must be thoroughly tested with real-life databases and applications – with your applications and databases! Download […]

by mariuz at October 21, 2014 01:08 PM

Firebird Conference 2014 schedule is available #fbconf2014

Firebird Conference 2014 schedule is available. Only few days left! Hurry up, registration is still open!

by mariuz at October 21, 2014 08:07 AM

The Wiert Corner - irregular stream of stuff

jpluimers

Every once in a while you see a question with some great code in the answers.

This is such a time: image – How to make a water effect on TImage or anything? – Stack Overflow.

–jeroen


Filed under: Delphi, Development, Software Development

by jpluimers at October 21, 2014 05:00 AM

October 20, 2014

הבייט הלבן

העז המנופחת של Microchip

מי שמוריד את סביבת הפיתוח הרשמית והחינמית MPLAB X, של חברת Microchip, מקבל איתה בין השאר את הקומפיילר XC8 בגרסה שמבצעת (כך מספרים לנו) רק אופטימיזציות בסיסיות. כדי להפיק קוד יעיל באמת, הלקוחות נדרשים לקנות גרסה משופרת. עד כאן סביר ולגיטימי, נכון? אבל איזה מעשה מפוקפק עושה Microchip כאשר ההבדל בביצועים בין הגרסה הרגילה למשופרת […]

by עידו גנדל at October 20, 2014 10:31 PM

Daniel Magin's Logfile

PAServer Manager and Mac OSX Yosemite and Delphi XE7

After updating Mac's to Yosemite there was no way to start a PAServer over the PAServerManager.

Solution go to Spotlight an Type in "PAServer 15". Then you start direct the PAServer without the PAServerManager. BTW i ask me really why the PAServerManager will not save the settings after reboot.

Bildschirmfoto 2014-10-20 um 17.33.44

You can also start PAServer 15 from Terminal Session with:

  1. /Applications/PAServer\ 15.0.app/Contents/MacOS/paserver

On one of my Mac's i get after starting the PAServer  with Yosemite and the brand new Xcode a codesign error on Deploy Process.

Solution send a export before starting PAServer

  1. export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate"
  2. /Applications/PAServer\ 15.0.app/Contents/MacOS/paserver

Bildschirmfoto 2014-10-20 um 17.32.18

by admin at October 20, 2014 03:35 PM

October 19, 2014

Firebird News

Video: How to use the Firebird Trace API and FB TraceManager in high load scenarios

The following video discusses best practices for using the Firebird Trace API and FB TraceManager in high load scenarios. CLICK HERE to watch the ~24 min video. Enjoy!

by tsteinmaurer at October 19, 2014 12:19 PM

October 17, 2014

Castle Game Engine news

Reshared post from Michalis Kamburelis:

New game done using our engine :)

Original Post from Michalis Kamburelis:

I'm presenting a small game called "Hotel 'Nuclear'" that I did during last weekend (two days, one game, zero sleep) TSG compo (gamejam).  Of course using my Castle Game Engine :) You're welcome to download it from http://sourceforge.net/projects/castle-engine/files/hotel_nuclear/ , developers are also welcome to checkout source code (to you also need "Castle Game Engine" from SVN, see http://castle-engine.sourceforge.net/engine.php ).
 
Short post-mortem (I actually have some useful conclusions at the end :) follows. I decided to write it down, while it's still fresh in my mind :)

GENERAL FEELING:

This is not my perfect creation --- although I am proud of what I achieved, there was simply not enough time to really do what I imagined. I finally picked a project that cannot be finished by 1 person in 2 days :) Which is Ok for me, since I still achieved a lot.

Actually I feel that this is my largest compo game (a lot of programming stuff, a lot of graphic stuff...). To be honest, after every compo, I think "this was the largest work I managed to do during 2 days". Which is very cool. Even if part of this impression is just me being dead-tired, I'm also pretty sure that I'm getting awesome-and-more-awesome with every compo :) The engine (as most of you know, "Castle Game Engine" is my own beloved open-source game engine) also grows because of compo games. Even though I explicitly want to work on a specific game, not on the engine, during the compo. But often some good engine-wide work happens by the way (and, while game-specific code is sometimes quick & hacky, the engine code remains clean & perfect :). And my crazy Blender/GIMP skills also get nicely refreshed every time :)

WHAT WORKED:

- The "core" mechanics work (ghost captures human/alien, changes into them, opens doors, dies in incorrect room, gets keys, opens locked doors, there are hints on doors about keys, somewhat resembling logical puzzles). I think I had a good work plan for programming-related tasks.

- The core graphics are in place. Corridor, room, animations. But look bad, more about this later.

- The game is playable. But it was playable too late, when the Sunday was ending, and there was no time to tweak it.

- Technically were Ok: game works fast, on standalone and Android. "Castle Game Engine" rules! :)

- We have random hotel floors, which was my core "technical" goal. Success :)

- As usual, the built-in "WalkAttack" AI available in Castle Game Engine was a great time-saver. Even when not perfect, it gives you an extremely quick (nearly 0 code) working creature AI in a free 3D worl.

WHAT IS A "TECHNICAL" GOAL MENTIONED ABOVE?

With compo games, I usually have

1. some "gameplay/graphics/feeling" goal (roguelike forest - "Orcs and Volcanoes", fear in 3D - "Darkest Before the Dawn", beautiful - "Little Things", dangerous world - "Mountains Of Fire") and

2. some "technical" goal (level editor and 2D mixed with 3D - "Orcs and Volcanoes", Android - "Darkest Before the Dawn", go crazy with shaders and screen effects - "Little Things", split screen and controls - "Mountains Of Fire").

I found that this works for me. I have to visualize that "this particular game will be great (mostly gameplay/graphics/feeling goal)", but I also have to visualize "this work will make the engine better (mostly technical goal)".

This time the "gameplay/graphics/feeling" goal was "weird hotel in space with logical puzzles". I was thinking about many things, including "Doctor Who" "God Complex" episode.

The technical goal was "random generation of 3D stuff".

THINGS THAT ARE NOT FAILURES, BUT DO NOT MAKE A SUCCESS EITHER:

- Graphically, a lot of stuff is very unfinished (1. lighting is bad --- bleak on corridor, nonsense spheres in rooms, while the purpose was to showcase small local point lights in somewhat dark setting, 2. animations are just tests --- knight and archer from opengameart.org representing human and martian..., 3. room interior lacks textures... although, AD3, it was a good decision to leave it as is).

I feel that I could do these things, but there was no time.

- Gameplay: while it works, it needs more stuff to make it really interesting. E.g. special ability of human/aliens. Better AI (they cannot leave the room now! Bad, I planned to use our waypoints/sectors for it). Maybe sometimes you can be killed (e.g. martians hunt humans?), maybe sometimes you can shoot (again, martians shoot humans? :), maybe sometimes keycards are in different places... I had lots of ideas to experiment and make the gameplay more varying. No time to implement and test them.

- More hints on the doors were planned, to make it more a logical puzzle, interesting and playable with really large floors. I managed to implement most important ones ("the key xxx is here", "the hint on the room to the left IS A LIE" etc.). More were planned.

FUTURE AND THOUGHTS (aka: "notes to future self") :

1. Make the graphics crude, but focus on showcasing the main thing first.

For example, with "Mountains Of Fire", the "focus" (core idea) of graphic was "black vs red colors". With "Little Things", it was shaders and painting-like look. For this game, I should have said to myself "the core look depends on bright lamps in a long, dark corridor". Good: I did make the corridor perspective (all those views on a long corridor work :), bad: I did not set up nice lighting.

Instead of playing around with texturing etc, I should have focused on lighting, as the lighting was my core graphical vision here.

CONCLUSION 1: decide what is the main feature of your graphical look, and make it happen soon, this rules over everything else.

Do not tweak textures. Do not tweak 3D meshes. Do not make any animations, there is really no time for it (for me at least) during the compo. Spend more time on choosing (and brutally adjusting) downloaded stuff from http://opengameart.org/ and http://www.blendswap.com/ .

2. Gameplay must be playable much sooner. With previous compo games, I spent Sunday evenings designing specific levels, and gameplay mechanics was somewhat ready (or at least "during testing"). This time, there was no level design. There was a lot more coding and graphical stuff instead. And the gameplay was finished very late (near the end of Sunday), which prevented from tweaking/rethinking it.

I think that the idea "Sunday noon is the deadline for working gameplay" is a good idea.

But how could I have applied it here? If I would just force myself on Sunday noon, I could have resigned from random hotel generation, and instead make 2-4 pre-staged hotel floors in Blender. Looking back, it would be the right choice.

Or I could invent a different gameplay, playing around only with room interiors. Which means "change your whole idea". Problem: this happens on Sunday morning, when you're already getting sleepy, and thinking is difficult :) Looking back, having a backup plan, with only half of stuff ready, would be nice... But that's not really doable for me, to have a backup 50% plan and still commit 100% to the original plan... So, solution: at Sunday 12:00 drink lots of cofee, and invent new gameplay if necessary!

CONCLUSION 2: gameplay must be ready on Sunday noon. If not: cut down on technical stuff, make smart workarounds in graphics. "Short and playable" is your goal on compo, not "long and boring". Also, drink coffee at Sunday noon and if necessary, just change your whole gameplay idea.

-----

As (almost) always, the graphics in this game use various assets from http://opengameart.org/ and http://www.blendswap.com/ . Thanks go to many contributors on these sites. Details are in AUTHORS.txt files in sources.

October 17, 2014 10:44 PM

Firebird News

More mini-interviews with speakers at Firebird Conference 2014

More mini-interviews with speakers at Firebird Conference:Jiri Cincura, Roman Simakov, Pavel Cizar and Jonathan Neve

by mariuz at October 17, 2014 12:56 PM

October 16, 2014

Firebird News

Good news for .Net Provider : Dapper – a simple object mapper for .Net can be used with Firebird

Good news  for Firebird .NET Data Provider: a issue in the Dapper github repository seems to be fixed    

by mariuz at October 16, 2014 03:24 PM

Database Workbench 5.0.4 released

Upscene Productions is proud to announce the availability of the next release of the popular multi-DBMS development tool: ” Database Workbench 5.0.4 “ This release fixes bugs found by customers and a fix for using Database Workbench under Wine. “There is so much new in Database Workbench 5, I don’t know where to start”, says […]

by Martijn Tonies at October 16, 2014 09:44 AM

October 15, 2014

DelphiTools.info

DWS Web Server update

A new version 2014.10.15 of the DWS Web Server is available. This version contains a variety of improvements and fixes, along with a new sample for JS libraries. Here is the download link for the installer: DWSWebServer 2014.10.15 (1514 kB) And here is the list of changes: added support for .p2js libraries and marking functions with “export”…

by Eric Grange at October 15, 2014 05:00 PM

Firebird News

The Lazarus team is glad to announce the release of Lazarus 1.2.6

The Lazarus team is glad to announce the release of Lazarus 1.2.6. This release was built with fpc 2.6.4. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Fixes_for_1.2.6_.28Merged.29 http://wiki.lazarus.freepascal.org/User_Changes_2.6.4

by mariuz at October 15, 2014 04:36 PM

Release candidate 2 of .Net Provider for OleDb

We are pleased to announce the second release candidate of our .NET Data Provider for interaction with Firebird and Interbase via IBProvider. By now, we have implemented all the functionality of System.Data.OleDb. If you want to transfer your .NET projects for FB/IB to the new level of functionality and quality, we recommend you to start […]

by Andrew Merkulov at October 15, 2014 01:48 PM

Node Firebird Pure Java Script driver 0.2.0 is released with many features and fixes

New version v0.2.0 supports added auto-reconnect added sequentially selects events (attach, detach, row, result, transaction, commit, rollback, error, etc.) performance improvements supports inserting/updating buffers and streams reading blobs (sequentially) pooling database.detach() waits for last command better unit-test best of use with total.js – web application framework for node.js Many thanks to Peter Širka for his contributions […]

by mariuz at October 15, 2014 06:50 AM

The Wiert Corner - irregular stream of stuff

jpluimers

The Delphi MESSAGE directive is a very powerful one, you can generate compiler hints, warnings and errors with it, even fatal ones that abort compilation.
The compiler will return error codes H1054 (hint), W1054 (warning), E1054 (error) or F1054 (fatal error), which in the documentation are known under the catch-all x1054.

You need to take a bit of care with message directives, especially with the quotes. For instance

{$Message Error 'Not implemented'}

gives you the error below, but continues compiling:

[DCC Error] E1054 Not implemented

However, if you forget the single quotes

{$Message Error Not implemented}

it gives you error E1030  (not x1054), which is a bit confusing as it is a catch-all for invalid directives:

[DCC Error] E1030 Invalid compiler directive: 'message'

Here is a full example of all the message directives and compiler reactions you can get:

program Message_Directive;

{$APPTYPE CONSOLE}

{$R *.res}

begin
  {$MESSAGE 'Boo!'}
  {$Message Hint 'Feed the cats'}
  {$messaGe Warn 'Looks like rain.'}
  {$Message Error 'Not implemented'}
  {$Message Fatal 'Bang.  Yer dead.'}
{
[DCC Hint] Message_Directive.dpr(8): H1054 Boo!
[DCC Hint] Message_Directive.dpr(9): H1054 Feed the cats
[DCC Warning] Message_Directive.dpr(10): W1054 Looks like rain.
[DCC Error] Message_Directive.dpr(11): E1054 Not implemented
[DCC Fatal Error] Message_Directive.dpr(12): F1054 Bang.  Yer dead.
}
end.

–jeroen

via: MESSAGE directive (Delphi) – RAD Studio.

PS: for a full list of Delphi hint/warning/error compiler messages, see Marc Durdin’s excellent post  Delphi XE2’s Hidden Hints and Warnings.


Filed under: Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development

by jpluimers at October 15, 2014 05:00 AM

October 14, 2014

Lazarus Team Anouncements

Lazarus 1.2.6 Release

The Lazarus team is glad to announce the release of Lazarus 1.2.6.

This release was built with fpc 2.6.4.

Here is the list of changes for Lazarus and Free Pascal:
http://wiki.lazarus.freepascal.org
http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_b...

October 14, 2014 03:18 PM

Firebird News

Firebird 3 Beta 1 tagged

The source code of Firebird 3.0 Beta 1 is now tagged, meaning that we can expect the beta 1 release to be available very soon.

by Cantu at October 14, 2014 11:45 AM

The Wiert Corner - irregular stream of stuff

jpluimers

Delphi and 3rd party tools keep some of the settings in your %AppData% directory. Much more convenient than the registry as they are easier to read and modify when needed (also easier to damage <g>). We’ll start with an overview where various versions of Delphi store their configuration files, then show how the Favourites on the Welcome Page are stored, then end with an overview of BDS, Company Names and Product Names.

Configuration files

Depending on the Delphi version, the files are under one of these directories:

  • %AppData%\%CompanyName%\BDS\#.0 %AppData%\%CompanyName%\RadStudio\#.0
  • %AllUsersProfile%\Application Data\%CompanyName%\RadStudio\#.0

%AppData% is for user specific settings; %AllUsersProfile% for system global settings. BDS stands for Borland Developer Studio, the official name for the (then new) Gailileo IDE foundation that was the successor of the old IDE architecture used from Delphi until 7. In practice, I’ve never seen any file stored under the RadStudio directory within %AppData%.

Registry paths.

Note the registry key paths used for configuring Delphi are constructed in a way similar to the directory names:

  • HKEY_CURRENT_USER\Software\%CompanyName%\BDS\#.0
  • HKEY_LOCAL_MACHINE\Software\%CompanyName%\BDS\#.0

Note the registry only uses BDS, not RadStudio. Both %CompanyName% and # depend on the BDS versions. So further below are two lists: one mapping the BDS version to CompanyName, the other to Delphi version. But first about the files in the Delphi settings directory, so we can start looking at how favourites are stored.

BTW: Though not covered any further here, Delphi 2-7 had different registry roots as mentioned in a SO comment by Remy Lebeau:

  • HKEY_CURRENT_USER\Software\Borland\Delphi\#.0

  • HKEY_LOCAL_MACHINE\Software\Borland\Delphi\#.0

Delphi settings directory files

These are the files you usually have in the directory %AppData%\%CompanyName%\BDS\#.0:

myFavorites.xml: the Favourites in your Welcome page

Back to the Favourites that you can organize in your Welcome page. These are stored in myFavorites.xml which has a remarkably simple XSD structure (both links are to Pastebin as WordPress regularly screws up XML). Normally the XML is on one line, but with an online tool like Free Online XML Formatter – FreeFormatter.com you can put everything into a human-readable form. Delphi can work with both. This allowed me to move my source directory tree from C:\Develop to another directory in a small search/replace manner.

CompanyName mapping

  • CompanyName=Borland (from BDS 1 until BDS 5)
  • CompanyName=CodeGear (from BDS 6 until BDS 7)
  • CompanyName=Embarcadero (BDS 8 and up)

You see that CodeGear only lived for a short period of time. There is quite a bit confusion on the internet about this, just look at these searches to get a feel for that:

BDS number to product version mapping

I’ve included the table below as the data is not in the table I referenced from Found a table with Delphi Conditional defines over the Delphi versions/compiler platforms/bitness.

The # depends on the BDS/Galileo version number which started with Borland Development Studio 1.0 a.k.a. C# Builder 1.0.

For each product version, I noted which products were added/removed compared to the previous one.

  1. C# Builder (contained only C# Builder)
  2. Delphi 8 (added Delphi .net)
  3. Delphi 2005 (added Delphi win32)
  4. Delphi 2006 (added C++ Builder)
  5. Delphi 2007
  6. Delphi 2009
  7. Delphi 2010
  8. Delphi XE
  9. Delphi XE2 (added Delphi win64)
  10. Delphi XE3 (added C++ Builder win64, OS X x86 and iOS x86/arm through FreePascal)
  11. Delphi XE4 (replaced FreePascal with native Delphi compiler for iOS x86/arm)
  12. Delphi XE5 (added Android ARMv7)

I verified most of these from either my own Delphi / C# Builder installations or from the uDelphiVersions unit in WMI Delphi Code Creator.

And at the time of writing, I’m guessing BDS 12, and wondering if BDS 13 will be skipped like Delphi 13, jokingly or not like mentioned in The Oracle at Delphi » What happened to version 13?.

–jeroen


Filed under: Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, History, Software Development

by jpluimers at October 14, 2014 05:00 AM

October 13, 2014

DelphiTools.info

DWS WebServer with JavaScript CodeGen

The pre-compiled 2014.10.13 version of the DWScript WebServer is now available! This version includes the Pascal to JavaScript CodeGen! Here is the download link for the installer: DWSWebServer 2014.10.13 (1541 kB) This version also includes all fixes and improvements in DWScript, but the main attraction is the Pascal to JavaScript compiler, which bundles a limited version of SmartMobile…

by Eric Grange at October 13, 2014 01:30 PM

Firebird News

Compiling IBASE sql driver for Qt 5.3 on openSUSE 13.1

For this howto you will need to have firebird development package already installed on the system and also Qt 5.3.

by mariuz at October 13, 2014 07:36 AM

jed-software.com

XE Plus Pack – Free License details

Grab your free license details for Delphi XE Plus Pack.

http://www.jed-software.com/xepp.htm

 

License Details

Name: XE Plus Pack - Free License
Key: 02B537-8A808F-EFE83C-00E6EE-8BA946-3076F6-052F5F-CFC103-022F85-A28C71-006084

 

How to register

Download the trial version: http://www.jed-software.com/files/XEPlusPackTrial.zip

Use the Help | Register XE{x} Plus Pack… menu item to register.

 

Further install and help is available from http://www.jed-software.com/xepp_support.htm or email, support@jed-software.com.

 

Important info

  1. Only works for Delphi XE version.

 

by JED at October 13, 2014 06:20 AM

October 10, 2014

The road to Delphi

VCL Styles Utils – Now supports the TTaskDialog component

I’m very pleased to introduce a very exciting new feature to the VCL Styles Utils project. This is the support for style the TTaskDialog component and all the TaskDialog based Message dialogs. This control available since RAD Studio 2007 is a wrapper for the Task Dialogs introduced in Windows Vista and allows to create very rich and flexible dialogs.

Take a look to some sample dialogs.

2014-10-09 09_48_43-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_41_40-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_42_31-Greenshot

2014-10-09 09_47_41-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_47_52-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_48_07-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_48_19-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_48_31-VCL Styles Utils - TTaskDialogs Demo

And now enabling the VCL Styles and just adding the Vcl.Styles.Hooks unit to your project…..

2014-10-09 09_57_33-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_58_01-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_58_28-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_58_55-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_52_55-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_54_40-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_55_11-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_55_40-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_56_04-VCL Styles Utils - TTaskDialogs Demo

2014-10-09 09_56_42-VCL Styles Utils - TTaskDialogs Demo

You can download a sample application from the project repository.
Also a compiled demo is available here.

If you found any bug please use the issue page of the project.

For a quick tutorial of how use the TTaskDialog component check this great Inofficial TTaskDialog Documentation.

Rodrigo.


by Rodrigo at October 10, 2014 12:54 AM

October 09, 2014

Firebird News

ANN: CopyCat Developer 3.07.0

Microtec is pleased to announce a new release of our database replication engine, CopyCat Developer ! CopyCat Developer is a set of Delphi / C++Builder components providing customizable replication for Firebird, Interbase, Microsoft SQL Server, MySQL, NexusDB, SQLite, PostgreSQL and Oracle, including heteogenous replication between different database types. Have a look at our site for […]

by jonneve at October 09, 2014 09:19 PM

twm’s blog

mounting a Samba share

The Linux mount command can also access Samba (Windows) shares, but in contrast to the smbclient command it does not do a Netbios based lookup for machine names. So while

smbclient //server/share

will work, the corresponding

mount -t cifs //server/share /mnt/point

will tell you that it can’t resolve the host name (unless you add the host to your hosts file or it can be looked up via dns).

This StackExchange answer pointed me in the right direction:

There is a command for actually doing that lookup. It’s called nmblookup.
It returns the IP address of the server like this:

nmblookup server
192.168.1.234 server00>

While this is fine for manually looking it up, if you want to mount a share multiple times or in shell script, this won’t do because you need the IP address only, not the suffix after it.

It gets even worse if the machine in question has more than one IP address:

nmblookup server2
192.168.1.234 server200> 192.168.2.234 server200>

Bash to the rescue (I found that solution via this StackOverflow question and this article.)

#!/bin/bash
MACHINE=$1
shift  # Remove machine name from argument list

SHARE=$1
shift  # Remove share name from argument list

# nmblookup the machine
RES=$(nmblookup $MACHINE)
#echo "RES=\""${RES}"\""

# remove everything but the ip address
# note that this will not return anything meaningful
# if nmblookup returns an error (e.g. cannot find the machine)
IP=${RES%% $MACHINE*}
#echo "IP=\""${IP}"\""

# Mount smbclient share (passing any arguments on to smbmount
mount -t cifs -r //${IP}/${SHARE} "$@"

Put this code into a file, e.g.

/usr/local/bin/mount-win-share

and call it like

mount-win-share server share /mnt/point

If you add additional parameters or options, they will be passed on to mount.

by dummzeuch at October 09, 2014 04:19 PM

October 08, 2014

twm’s blog

Creating a new RAID 5

Another reminder to myself, so I don’t forget it again.

Warning: Use this on your own risk! You might lose all the data stored on any of the hard disk drives if you make a mistake!

To create a new raid, all the disks must be partitioned first.

To actually create the RAID we need the tool mdadm which is not installed (on Ubuntu Server) by default.

apt-get install mdadm

This will also install a few dependencies, in particular it will install a mail transfer agent (MTA, postfix in my case). This MTA needs to be configured so it can send e-mails to the administrator (root).

Creating the raid is as easy as typing:

mdadm --create /dev/md0 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1

Mdadm might detect that the disks have already been used in a different raid and will warn you. It then gives you the option to continue creating a new array or not.

Create an ext3 file system on the newly created RAID device with the label “daten1″:

mkfs --type=ext3 -L daten1 /dev/md0

This takes quite a while.

To automatically start the RAID, it must be added to mdadm.conf:

mdadm -Es | grep md[0-9]  >>/etc/mdadm/mdadm.conf

Note that this will append to mdadm.conf, so if you execute it multiple times you will get duplicate entries. So make sure to check the file afterwards.

To mount the partition, it must be added to /etc/fstab like this:

/dev/md0    /mnt/daten1   ext3    defaults,noauto

noauto means that it should not be mounted automatically on boot. This is a safeguard against boot failures on headless servers. If any of the automatically mounted devices fails. We don’t reboot our servers very often so we will just ssh into it after reboot and mount the partition manually with

mount /mnt/daten1

To check the RAID status, use

cat /proc/mdstat

by dummzeuch at October 08, 2014 10:18 AM

Using parted to partition a drive

This is just a reminder to myself so I don’t forget again.

Warning: Use this on your own risk! You might lose all the data stored on any of the hard disk drives if you make a mistake!

On Linux hard drives > 2 GB must be partitioned with parted and a partition table in gpt format.

Create a new gpt partition table (deleting the entire drive!):

parted /dev/sdX mklabel gpt

Create a new partition spanning the entire drive and using optimal alignment:

parted -a opt /dev/sdX mkpart primary 0% 100%

Set a partition’s raid flag:

parted /dev/sdX set 1 raid on

by dummzeuch at October 08, 2014 09:52 AM

DelphiTools.info

DWScript news and sneak peek

Below is a quick summary of changes in the SVN since the last post. There is also a mini-sneak peek of things to come! Recent changes Language changes Arrays can now be concatenated with the ‘+’ operator (same as XE7), note that it is supported for static arrays too, but a concatenation of static arrays results…

by Eric Grange at October 08, 2014 09:12 AM

October 07, 2014

Firebird News

New Firebird interface (cloop) – Cross Language Object Oriented Programming

Adriano wrote on Firebird-devel and twitter : I put in my github account the first version of cloop – Cross Language Object Oriented Programming. – https://github.com/asfernandes/cloop This first version is limited to void and int datatypes, supports C, C++ and Free Pascal, and the makefile works only in POSIX. Some files in src/tests/test1 are autogenerated. […]

by mariuz at October 07, 2014 09:53 AM

Mini-interviews with speakers Firebird Conference 2014 speakers roundup

Alexey Kovyazin wrote on linkedin Firebird group : We started series of mini-interviews with Firebird Conference 2014 speakers: Ann Harrison: http://www.firebirdsql.org/en/news/mini-interview-with-ann-w-harrison-53224/ Paul Reeves: http://www.firebirdsql.org/en/news/mini-interview-with-paul-reeves-53229/ Mark Rotteveel: http://www.firebirdsql.org/en/news/mini-interview-about-firebird-conference-2014-with-mark-rotteveel-53233/ Stay tuned for more interviews! Don’t miss the last chance to register at Firebird event of the year: Prague, October 24-25: http://www.firebirdsql.org/en/firebird-conference-2014/

by mariuz at October 07, 2014 07:47 AM

The Wiert Corner - irregular stream of stuff

jpluimers

Calling Randomize too often can make your Random numbers even less random.

Sometimes having the Randomize call in a unit initialization section is not practical.

Hence this little method that I think I first wrote back in the Turbo Pascal days:

procedure RandomizeIfNeeded();
begin
  if RandSeed = 0 then 
    Randomize();
end;

–jeroen


Filed under: Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi for PHP, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Pascal, Software Development, Turbo Pascal

by jpluimers at October 07, 2014 05:00 AM

October 06, 2014

The Podcast at Delphi.org

Meet Me in São Paulo, Brazil at the Embarcadero Conference

Last year was my first visit to the Embarcadero Conference in São Paulo, Brazil and I loved it. So I am going back again this year. As an added treat I’m be joining Marco Canto, the Delphi product manager. We both speak together on Delphi Present and Future, then Marco does The Fun Side of Delphi and later I’ll cover Internet of Things, Bluetooth and AppTethering when I will also show some Delphi powered Brain-Computer Interface demos and a lucky volunteer will fly a quadricopter with their thoughts.

The Embarcadero Conference in Brazil is huge with a lot of great sessions. I always consider it a treat when I get to see Marco’s Fun Side of Delphi presentation. I wonder if he will show off the Elf & Wizard classes that are new in XE7?

by Jim McKeeth at October 06, 2014 11:59 PM

October 05, 2014

Castle Game Engine news

Many new Spine features in Castle Game Engine :) 1. slot timeline attachment (see the blast of spineboy...

Many new Spine features in Castle Game Engine :)

1. slot timeline attachment (see the blast of spineboy weapon, the movement of dragon wings, blinking of goblin eyes, and appearing of Venice hero watch),
2. correct bone/slot resetting to the pose mode at the beginning of each animation,
3. Bezier curves for animating parameters.

October 05, 2014 01:10 PM

October 03, 2014

Firebird News

Mini-interview about Firebird Conference 2014 with Mark Rotteveel

Today’s guest is Mark Rotteveel, developer of JayBird, Firebird JDBC driver, and speaker at Firebird Conference 2014.

by mariuz at October 03, 2014 09:15 AM

Q/A : Why does Firebird truncate decimal places when dividing?

Firebird truncates decimal places when dividing, rather than rounding. Furthermore, it bases the number of decimal points in the returned value on the number of decimal places in the numerator and denominator. Why is Firebird truncating instead of rounding? And why does it base the returned value on the number of decimal places in the […]

by mariuz at October 03, 2014 07:52 AM

October 02, 2014

Andy's Blog and Tools

DDevExtensions 2.82 and IDE Fix Pack 5.7 released

DDevExtensions 2.82 is a rather small update. It fixes the “Switch to the module’s project” incompatibility with XE6 and adds the option to disable alpha-sort for the IDE’s class completion (Ctrl+Shift+C).

DisableAlphaSortClassCompletion

If alpha-sort class completion is disabled and you press Ctrl+Shift+C all methods from the class declaration are appended to the already existing implementation methods in the order that they appear in the class declaration with the exception for constructors and destructors. They are positioned before every other method (class ctor, class dtor, ctor, dtor, methods). This function does not resort your existing implementation methods, nor does it prevent the IDE from sorting the methods that are added to the class declaration because they only have an implementation.

IDE Fix Pack 5.7 increases the max. number of resources per binary from 3626 to 65534 (for the command line compiler you need fastdcc). The installer IDEFixPackReg*.exe now supports the “/EXTRACT” command line switch that extracts the installation files to the sub-folder “Files” instead of installing them. This version also adds some smaller optimization, especially for Delphi 2009 and extends the LineEditorEnd.ttr workaround by not creating the file in the first place.


DDevExtensions download:

Name IDE Version File Size Downloads Added
DDevExtensions 1.61 5-2007 DDevExtensions161Setup.zip 734.07 KB 15463 times 2009-01-10
DDevExtensions 2.8 Features PDF DDevExtensionsFeatures.pdf 602.92 KB 4731 times 2014-08-25
DDevExtensions 2.4 7, 2007 DDevExtensions24Setup7_2007.zip 535.41 KB 7000 times 2011-07-25
DDevExtensions 2.82 2009-XE6 DDevExtensions282.7z 908.68 KB 1066 times 2014-08-25
DDevExtensions 2.82 with XE7 2009-XE7 DDevExtensions282.7z 950.79 KB 794 times 2014-09-04

DDevExtensions Version 2.82 (2014-08-25)

  • Added: Disable Alpha-Sort Class Completion (Default off)
  • Fixed: XE6 broke “Switch to module project” dialog

IDE Fix Pack download:

Name IDE Version File Size Downloads Added
IDE Fix Pack 5.7 XE IDEFixPackXEReg57.7z 111.7 KB 649 times 2014-08-25
IDE Fix Pack 5.7 XE5+UP2 IDEFixPackXE5Reg57.7z 131.52 KB 688 times 2014-08-25
IDE Fix Pack 5.7 XE6 IDEFixPackXE6Reg57.7z 271.54 KB 1293 times 2014-08-25
IDE Fix Pack 5.71 XE7 IDEFixPackXE7Reg571.7z 265.42 KB 1852 times 2014-09-06
IDE Fix Pack 5.71 2009+UP3 IDEFixPack2009Reg571.7z 134.53 KB 313 times 2014-09-16
IDE Fix Pack 5.71 2010 IDEFixPack2010Reg571.7z 123.72 KB 950 times 2014-09-16

fastdcc download:

Name IDE Version File Size Downloads Added
fastdcc 5.7 2009+UP3 fastdcc2009v57.7z 75.74 KB 144 times 2014-08-25
fastdcc 5.7 XE fastdccXEv57.7z 81.61 KB 148 times 2014-08-25
fastdcc 5.7 XE5 fastdccXE5v57.7z 111.38 KB 189 times 2014-08-25
fastdcc 5.7 XE6 fastdccXE6v57.7z 139.83 KB 354 times 2014-08-25
fastdcc 5.7 2010 fastdcc2010v57.7z 79.62 KB 236 times 2014-08-26
fastdcc 5.71 XE7 fastdccXE7v571.7z 133.61 KB 1038 times 2014-09-06

IDE Fix Pack changelog

  • Added: Fix for “class operator In” class completion
  • Added: IDEFixPackReg*.exe supports command line parameter /EXTRACT that extracts the files instead of installing them
  • Added: Disable creation of EditorLineEnd.ttr (2009-2010)
  • Added: Fix for QC 111917: RLINK32: Too many resources to handle. Instead of 3626 it can now handle 65534 resource items (also in fastdcc for command line compiler)
  • Added: TObject.FieldAddress optimization for DFM loading
  • Added: String function replacements without STRINGCHECKS (2009-2010)
  • Changed: Disabled “.NET Windows\Globalization search I/O optimization” patch for Windows 8 (2009)
  • Added: TComponent.Remove optimization (2009)

by Andreas Hausladen at October 02, 2014 09:58 AM

IDE Fix Pack, DDevExtensions and DFMCheck for XE7

I’ve re-released the IDE Fix Pack 5.7, DDevExtensions 2.82 and DFMCheck 1.5 versions with support for XE7. The only change is that X7 is now supported (and one compiler patch was removed from IDE Fix Pack because it is fixed in XE7). Other than that it was just adjusting the build script, adjusting to the new ABI (name mangling of interface function parameters has changed) and building the projects.

IDE Fix Pack download:

Name IDE Version File Size Downloads Added
IDE Fix Pack 5.7 XE IDEFixPackXEReg57.7z 111.7 KB 649 times 2014-08-25
IDE Fix Pack 5.7 XE5+UP2 IDEFixPackXE5Reg57.7z 131.52 KB 688 times 2014-08-25
IDE Fix Pack 5.7 XE6 IDEFixPackXE6Reg57.7z 271.54 KB 1293 times 2014-08-25
IDE Fix Pack 5.71 XE7 IDEFixPackXE7Reg571.7z 265.42 KB 1852 times 2014-09-06
IDE Fix Pack 5.71 2009+UP3 IDEFixPack2009Reg571.7z 134.53 KB 313 times 2014-09-16
IDE Fix Pack 5.71 2010 IDEFixPack2010Reg571.7z 123.72 KB 950 times 2014-09-16

fastdcc download:

Name IDE Version File Size Downloads Added
fastdcc 5.7 2009+UP3 fastdcc2009v57.7z 75.74 KB 144 times 2014-08-25
fastdcc 5.7 XE fastdccXEv57.7z 81.61 KB 148 times 2014-08-25
fastdcc 5.7 XE5 fastdccXE5v57.7z 111.38 KB 189 times 2014-08-25
fastdcc 5.7 XE6 fastdccXE6v57.7z 139.83 KB 354 times 2014-08-25
fastdcc 5.7 2010 fastdcc2010v57.7z 79.62 KB 236 times 2014-08-26
fastdcc 5.71 XE7 fastdccXE7v571.7z 133.61 KB 1038 times 2014-09-06

DDevExtensions download:

Name IDE Version File Size Downloads Added
DDevExtensions 1.61 5-2007 DDevExtensions161Setup.zip 734.07 KB 15463 times 2009-01-10
DDevExtensions 2.8 Features PDF DDevExtensionsFeatures.pdf 602.92 KB 4731 times 2014-08-25
DDevExtensions 2.4 7, 2007 DDevExtensions24Setup7_2007.zip 535.41 KB 7000 times 2011-07-25
DDevExtensions 2.82 2009-XE6 DDevExtensions282.7z 908.68 KB 1066 times 2014-08-25
DDevExtensions 2.82 with XE7 2009-XE7 DDevExtensions282.7z 950.79 KB 794 times 2014-09-04

DFMCheck download:

Name IDE Version File Size Downloads Added
DFMCheck 1.5 5-XE7 DfmCheckSetup15.7z 683.73 KB 324 times 2014-09-04

by Andreas Hausladen at October 02, 2014 09:58 AM

System.ByteStrings support for XE7

The unit System.ByteStrings reintroduces the following String types for the mobile compilers:

  • ShortString
  • AnsiString
  • AnsiChar
  • PAnsiChar
  • PPAnsiChar
  • UTF8String
  • PUTF8String
  • RawByteString
  • PRawByteString

Usage:
Add the System.ByteStrings.dcu’s path to the compiler’s search path and add the unit to your uses clauses.

There is no *.PAS file because the DCU is patched with a hex editor to get access to the hidden types.

Name IDE Version File Size Downloads Added
System.ByteStrings XE5 RTM/UP1 only XE5ByteStrings.7z 2.45 KB 710 times 2013-10-23
System.ByteStrings XE5 UP2 only XE5Up2ByteStrings.7z 2.85 KB 662 times 2013-12-20
System.ByteStrings XE6 XE6ByteStrings.7z 2.89 KB 665 times 2014-04-16
System.ByteStrings XE7 XE7ByteStrings.7z 2.89 KB 246 times 2014-09-02

by Andreas Hausladen at October 02, 2014 09:58 AM

IDE Fix Pack 5.71 for XE7 – bug fix release

During the search for all function parameter name mangling changes in XE7, I disabled many IDE Fix Pack patches and forgot to enable them before I released version 5.7 for XE7. So here is version 5.71 that enables all patches again.

By enabling all the patches, I found three patches that weren’t necessary anymore or only partly necessary. Embarcadero fixed the rlink32.dll maximum resources limitation (QC 111917) and the debugger local variable watch memory leak (QC 115248). Furthermore they partly fixed the “operator In” class completion bug (QC 102047). Only the “complete implementation” part that is explained in the QC entry is fixed, the “complete interface” part still uses “&In” instead of “In”, IDE Fix Pack 5.7 fixes the missing part for you.

Download:

Name IDE Version File Size Downloads Added
IDE Fix Pack 5.7 XE IDEFixPackXEReg57.7z 111.7 KB 649 times 2014-08-25
IDE Fix Pack 5.7 XE5+UP2 IDEFixPackXE5Reg57.7z 131.52 KB 688 times 2014-08-25
IDE Fix Pack 5.7 XE6 IDEFixPackXE6Reg57.7z 271.54 KB 1293 times 2014-08-25
IDE Fix Pack 5.71 XE7 IDEFixPackXE7Reg571.7z 265.42 KB 1852 times 2014-09-06
IDE Fix Pack 5.71 2009+UP3 IDEFixPack2009Reg571.7z 134.53 KB 313 times 2014-09-16
IDE Fix Pack 5.71 2010 IDEFixPack2010Reg571.7z 123.72 KB 950 times 2014-09-16

Download:

Name IDE Version File Size Downloads Added
fastdcc 5.7 2009+UP3 fastdcc2009v57.7z 75.74 KB 144 times 2014-08-25
fastdcc 5.7 XE fastdccXEv57.7z 81.61 KB 148 times 2014-08-25
fastdcc 5.7 XE5 fastdccXE5v57.7z 111.38 KB 189 times 2014-08-25
fastdcc 5.7 XE6 fastdccXE6v57.7z 139.83 KB 354 times 2014-08-25
fastdcc 5.7 2010 fastdcc2010v57.7z 79.62 KB 236 times 2014-08-26
fastdcc 5.71 XE7 fastdccXE7v571.7z 133.61 KB 1038 times 2014-09-06

by Andreas Hausladen at October 02, 2014 09:58 AM

October 01, 2014

The Podcast at Delphi.org

New XE7 Android Features Skill Sprint

XE7 is full of new features everywhere, but there are some really nice ones specific to Android. Here is a replay of my Skill Sprint session on New Android Features.

The new Android specific features in XE7 include:

There are lots of other new features that are not specific to Android, but that will still help make your apps amazing for Android, iOS, Windows and OS X.

by Jim McKeeth at October 01, 2014 06:41 PM

Firebird News

FB TraceManager V3.5.2 has been released

Upscene Productions is excited to officially release FB TraceManager V3.5.2! This release adds UI docking capabilities, improved Firebird 3 support and fixes minor bugs. More information is available here: http://www.upscene.com/news/item/20140930 Feel free to check out the following V3.5 demo video More information on the product is available in the FB TraceManager section on our website, […]

by tsteinmaurer at October 01, 2014 05:56 PM

ANN: CopyCat LiveMirror 1.3

I am pleased to announce that CopyCat LiveMirror 1.3 is officially available! CopyCat LiveMirror is our database mirroring and backup tool, designed to make it trivial to setup a one-way replication between two Firebird databases, so that you can easily have a reliable, up-to-date backup at your fingertips, at all times. Please refer to our […]

by jonneve at October 01, 2014 04:29 PM

The Wiert Corner - irregular stream of stuff

jpluimers

I’ve been experimenting with the Delphi hinting directives lately to make it easier to migrate some libraries to newer versions of Delphi and newer platforms.

Hinting directives (deprecated, experimental, library and platform) were – like the $MESSAGE directive – added to Delphi 6.

Up to Delphi 5 you didn’t have any means to declare code obsolete. You had to find clever ways around it.

Warnings for hinting directives

When referring to identifiers marked with a hinting directive, you can get various warning messages that depend on the kind of identifier: unit, or other symbol.

Note the warning numbering is not in the alphabetic order of the hinting directive.

Unit identifiers can get these warnings:

  • W1006 Unit ‘HintingDirectivesUnit’ is deprecated
    //unit HintingDirectivesUnit deprecated;
  • W1007 Unit ‘HintingDirectivesUnit’ is experimental
    //unit HintingDirectivesUnit experimental;
  • W1004 Unit ‘HintingDirectivesUnit’ is specific to a library
    //unit HintingDirectivesUnit library;
  • W1005 Unit ‘HintingDirectivesUnit’ is specific to a platform
    //unit HintingDirectivesUnit platform;

Non-unit symbols can get these warnings:

  •  W1000 Symbol ‘FieldDepracated’ is deprecated
    //Default.FieldDepracated := 1;
  •  W1003 Symbol ‘FieldExperimental’ is experimental
    //Default.FieldExperimental := 1;
  •  W1001 Symbol ‘FieldLibrary’ is specific to a library
    //Default.FieldLibrary := 1;
  •  W1002 Symbol ‘FieldPlatform’ is specific to a platform
    //Default.FieldPlatform := 1;

Hinting directives: deprecated differs from the others

Of the hinting directives, deprecated is more versatile than experimental, library and platform as it allows two forms: with and without a ‘comment’.

I wasn’t aware of this part of the deprecated syntax until recently. The syntax part was introduced in Delphi 12.0 (aka Delphi 2009). You can for instance see it in the RTLConsts unit:

SInvalidDate = '''''%s'''' is not a valid date' deprecated 'Use SysConsts.SInvalidDate';
SInvalidDateTime = '''''%s'''' is not a valid date and time' deprecated 'Use SysConsts.SInvalidDateTime';
SInvalidInteger = '''''%s'''' is not a valid integer value' deprecated 'Use SysConsts.SInvalidInteger';
SInvalidTime = '''''%s'''' is not a valid time' deprecated 'Use SysConsts.SInvalidTime';
STimeEncodeError = 'Invalid argument to time encode' deprecated 'Use SysConsts.STimeEncodeError';

ModelMaker Code Explorer does not support this syntax yet, but they are aware of this.

But depending on the kind of identifier you use it on, the compiler warnings can be different.

When used on a unit, you can use both forms, but when using the unit, you get one kind of compiler warning:

//[DCC Warning] HintingDirectivesConsoleProject.dpr(9): W1006 Unit 'HintingDirectivesUnit' is deprecated
//unit HintingDirectivesUnit deprecated;

No warning about the ‘comment':

//[DCC Warning] HintingDirectivesConsoleProject.dpr(9): W1006 Unit 'HintingDirectivesUnit' is deprecated
//unit HintingDirectivesUnit deprecated 'use a different one';

But when using it on a variable,

var
I: Integer deprecated 'do not use global variables';
J: Integer deprecated;
K: Integer deprecated platform library experimental;

the forms result in different compiler warnings:

// W1000 Symbol 'I' is deprecated: 'do not use global variables'
I := 1;

// W1000 Symbol 'J' is deprecated
J := 2;

// W1000 Symbol 'K' is deprecated
// W1001 Symbol 'K' is specific to a library
// W1002 Symbol 'K' is specific to a platform
// W1003 Symbol 'K' is experimental
K := 3;

The effects of a unit hinting directive

The hinting directive documentation states that hinting directives on units apply on references to all the symbols on the unit:

When a hint directive appears in a unit declaration, it means that the hint applies to everything in the unit. For example, the Windows 3.1 style OleAuto.pas unit on Windows is completely deprecated. Any reference to that unit or any symbol in that unit produces a deprecation message.

But this also has a twist on all the unit symbols referenced from within the unit: when a symbol is marked with the same hinting directive as the unit, you will not get a warning referencing that symbol in the unit itself.

So a symbol marked deprecated, will not show a warning when referenced from inside the unit if the unit is also marked deprecated. The same holds for the other hinting directives.

Hinting directives on properties are still a no-go

Despite QC96350 (Cannot apply ‘deprecated’ keyword to property declarations) being open for 2 years, and the StackOverflow question How can I mark a property as deprecated in delphi? you can’t use hinting directives on properties.

So far for consistency (I will blog more on that later).

You cannot do either of these:

type
  TTest = class
  protected
    FValue: Integer;
  public
    property Value: Integer read FValue write FValue; deprecated; // E2169 Field definition not allowed after methods or properties
    property Value2: Integer read FValue write FValue deprecated; // E2029 ';' expected but identifier 'deprecated' found
  end;

Applying and combining hinting directives

A few rules for using hinting directives

  • The semicolon between the hinting directive and the symbol declaration usually has to be left out, except for methods where it has to be there.
  • There is no semicolon between combined hinting directives.
  • The abstract directive comes after the last hinting directive and does get separated by a semicolon.

So you get code like this:

THinted = class
end deprecated platform library experimental;

FieldDepracated: Integer deprecated;
FieldAll: Integer deprecated platform library experimental;

function Func: Integer; virtual; abstract;
function FuncDeprecated: Integer; virtual; deprecated; abstract;

procedure Proc; virtual; abstract;
procedure ProcDeprecated virtual; deprecated; abstract;

Full sample code

The full sample code is a BeSharp SVN change-set; the main unit is below.

Have fun with it!

–jeroen

unit HintingDirectivesUnit;

//[DCC Warning] HintingDirectivesConsoleProject.dpr(9): W1006 Unit 'HintingDirectivesUnit' is deprecated
//unit HintingDirectivesUnit deprecated;

//[DCC Warning] HintingDirectivesConsoleProject.dpr(9): W1007 Unit 'HintingDirectivesUnit' is experimental
//unit HintingDirectivesUnit experimental;

//[DCC Warning] HintingDirectivesConsoleProject.dpr(9): W1004 Unit 'HintingDirectivesUnit' is specific to a library
//unit HintingDirectivesUnit library;

//[DCC Warning] HintingDirectivesConsoleProject.dpr(9): W1005 Unit 'HintingDirectivesUnit' is specific to a platform
//unit HintingDirectivesUnit platform;

//[DCC Warning] HintingDirectivesConsoleProject.dpr(9): W1006 Unit 'HintingDirectivesUnit' is deprecated
//unit HintingDirectivesUnit deprecated 'use a different one';

interface

var
  I: Integer deprecated 'do not use global variables';
  J: Integer deprecated;
  K: Integer deprecated platform library experimental;

type
  THinted = class
  end deprecated platform library experimental;

// W1000 Symbol 'THinted' is deprecated
// W1001 Symbol 'THinted' is specific to a library
// W1002 Symbol 'THinted' is specific to a platform
// W1003 Symbol 'THinted' is experimental
// W1000 Symbol 'THinted' is deprecated
  THintedClass = class of THinted;

  TDefault = class(TObject)
  strict private
    FMember: Integer;
  public
    Field: Integer;
    FieldDepracated: Integer deprecated;
    FieldExperimental: Integer experimental;
    FieldLibrary: Integer library;
    FieldPlatform: Integer platform;
    FieldAll: Integer deprecated platform library experimental;
    function Func: Integer; virtual; abstract;
    function FuncDeprecated: Integer; virtual; deprecated; abstract;
    function FuncExperimental: Integer; virtual; experimental; abstract;
    function FuncLibrary: Integer; virtual; library; abstract;
    function FuncPlatform: Integer; virtual; platform; abstract;
    procedure Proc; virtual; abstract;
    procedure ProcDeprecated; virtual; deprecated; abstract;
    procedure ProcExperimental; virtual; experimental; abstract;
    procedure ProcLibrary; virtual; library; abstract;
    procedure ProcPlatform; virtual; platform; abstract;
    property Member: Integer read FMember write FMember;
  strict protected
    procedure ProcDeprecatedComment; virtual; deprecated 'use some other Proc in stead'; abstract;
  strict private
    // E2169 Field definition not allowed after Procs or properties
    // procedure ProcAbstractDeprecated; virtual;  abstract; deprecated;

    // E2029 ';' expected but string constant found
    // procedure ProcExperimentalComment; virtual; experimental 'Experimental Proc'; abstract;

    // E2029 ';' expected but string constant found
    // procedure ProcLibraryComment; virtual; library 'Library Proc'; abstract;

    // E2029 ';' expected but string constant found
    // procedure ProcPlatformComment; virtual; platform 'Platform Proc'; abstract;

    // E2169 Field definition not allowed after Procs or properties
    // property MemberDeprecated: Integer read FMember write FMember; deprecated;
  end;

// W1001 Symbol 'THinted' is specific to a library
// W1002 Symbol 'THinted' is specific to a platform
// W1003 Symbol 'THinted' is experimental
implementation

procedure UseDefault;
var
  Default: TDefault;
begin
// W1000 Symbol 'I' is deprecated: 'do not use global variables'
  I := 1;
// W1000 Symbol 'J' is deprecated
  J := 2;
// W1000 Symbol 'K' is deprecated
// W1001 Symbol 'K' is specific to a library
// W1002 Symbol 'K' is specific to a platform
// W1003 Symbol 'K' is experimental
  K := 3;
// W1000 Symbol 'FuncDeprecated' is deprecated
// W1003 Symbol 'FuncExperimental' is experimental
// W1001 Symbol 'FuncLibrary' is specific to a library
// W1002 Symbol 'FuncPlatform' is specific to a platform

// W1000 Symbol 'ProcDeprecated' is deprecated
// W1003 Symbol 'ProcExperimental' is experimental
// W1001 Symbol 'ProcLibrary' is specific to a library
// W1002 Symbol 'ProcPlatform' is specific to a platform

// W1000 Symbol 'ProcDeprecatedComment' is deprecated: 'use some other Proc in stead'
  Default := TDefault.Create();
  try
    Default.Field := 1;
// W1000 Symbol 'FieldDepracated' is deprecated
    Default.FieldDepracated := 1;
// W1003 Symbol 'FieldExperimental' is experimental
    Default.FieldExperimental := 1;
// W1001 Symbol 'FieldLibrary' is specific to a library
    Default.FieldLibrary := 1;
// W1002 Symbol 'FieldPlatform' is specific to a platform
    Default.FieldPlatform := 1;
  finally
    Default.Free;
  end;
end;

end.

Filed under: Apple Pascal, Borland Pascal, DEC Pascal, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Encoding, FreePascal, ISO-8859, ISO8859, Java, Lazarus, MQ Message Queueing/Queuing, Reflection, Software Development, Sybase, Unicode, UTF-8, UTF8

by jpluimers at October 01, 2014 05:00 AM

September 30, 2014

The Wiert Corner - irregular stream of stuff

jpluimers

I recently bumped into the NTCore website by Daniel Pisti.

At a client without my own VMs, I wanted to create a DebugBreak like function in Delphi, which I remembered from my Turbo Pascal days to be something like Inline($CC). So searching for both Delphi and INT 3, I found an EXE injection page at NTCore.

In Delphi, you can do this with a procedure like this, which cannot be inlined because it has an asm block:

procedure DebugBreak();
asm
  int 3
end;

(Reminder to self: sort out what to do here to break on an iOS device; Xcode has an alternative)

The site has information about system internals and software security posted as articles until 2009,  when he switched to blog posts. Besides that, he has written a bunch of interesting articles at CodeProject.

An important product on his site is the Explorer Suite:

A freeware suite of tools including a PE editor called CFF Explorer and a process viewer. The PE editor has full support for PE32/64. Special fields description and modification (.NET supported), utilities, rebuilder, hex editor, import adder, signature scanner, signature manager, extension support, scripting, disassembler, dependency walker etc. First PE editor with support for .NET internal structures. Resource Editor (Windows Vista icons supported) capable of handling .NET manifest resources. The suite is available for x86 and x64.

It is a great tool aimed at the Windows PE format, and a prelude to the commercial Cerbero profiler at iCerbero.com which covers many more file formats and tools that can aid for instance in analyzing malware. Daniel has moved to Frankfurt, Germany and now is a security expert doing great work.

Daniel also as a great twitter feed where he refers to posts from others.

For instance, malware usually runs in the user context, which is one of the reasons you should be really careful storing passwords locally. So I was glad that Daniel pointed to all of your browser password stores are straightforward to decrypt.

–jeroen

Further reading:


Filed under: Delphi, Development, Pascal, Power User, Software Development, Turbo Pascal, Windows, xCode/Mac/iPad/iPhone/iOS/cocoa

by jpluimers at September 30, 2014 05:00 AM

September 29, 2014

Firebird News

Interview with the author of Sqitch (database change management application)

As you might now Ștefan Suciu created a Firebird port for Sqitch Bellow is a interview with the author of Sqitch : David Wheeler with a few Firebird mentions ps: There is a GUI for Sqitch – Simple SQL change management created by Stefan https://github.com/stefansbv/sqitch-gui

by mariuz at September 29, 2014 03:49 PM

Mini-interview with Paul Reeves

We started a series or mini-interviews with speakers of Firebird International Conference 2014. The second guest is Paul Reeves

by mariuz at September 29, 2014 03:39 PM

Castle Game Engine news

September 26, 2014

while true do;

My “Delphi Cookbook” has been published

Almost an year ago I started to write a book about Delphi for Packt Publishing. Today that book has been published. This book is a cookbook! That’s it, in 328 pages you will find useful (I hope) “recipes” for your day-by-day Delphi job. Topics of the book Create visually stunning applications using FireMonkey Effectively use LiveBindings with the right OOP approach Create [...]

by Daniele Teti at September 26, 2014 03:34 PM

Firebird News

Mini-interview with Ann W. Harrison

We are starting series or mini-interviews with speakers of Firebird International Conference 2014. The first guest is Ann W. Harrison

by mariuz at September 26, 2014 11:29 AM

September 25, 2014

Castle Game Engine news

The Wiert Corner - irregular stream of stuff

jpluimers

If you are going to do test driven development and unit testing, you should watch these videos and slide decks, most of them by Miško Hevery:

  1. Not a video, but a good starter: Guide: Writing Testable Code (or read the PDF version).
  2. 0:32:07 ▶ “The Clean Code Talks — Unit Testing” – YouTube.
  3. 0:37:56 ▶ The Clean Code Talks – Don’t Look For Things! – YouTube.
  4. 0:54:08 ▶ The Clean Code Talks – “Global State and Singletons” – YouTube.
    • slides:     Clean Code Talks – Global State and Singletons. (slide 57; “global state is the root of all test problems”)
    • global state consequences for unit tests:
      • flakiness
      • order of test matters
      • tests cannot be run in parallel
    • red flags:
      • getting current time or date
      • getting a random number
    • be careful:
      • new operators are dangerous;
      • ask for what you need;
      • global state is nightmare;
      • constructor work is dangerous
  5. 0:38:24 ▶ “The Clean Code Talks — Inheritance, Polymorphism, & Testing” – YouTube.
  6. 0:56:02 ▶ Design Tech Talk Series Presents: OO Design for Testability – YouTube.
    • slides:     Design For Testablity (eye opener: slide 3; “No tests”: unit testing Common misconceptions/Invalid excuses)
  7. 1:18:41 ▶ How to Write Clean, Testable Code – YouTube.

The colon separated numbers in front of each video are the duration in H:MM:SS (yes, the final one is over an hour, but very interesting).

Each item consists of a video from the …. followed by the slide decks I find on …. site:

Thanks Stu Sherwin for pointing at this playist: Google Tech Talks – Misko Hevery – YouTube  by rtvdoorn (I found the playlist after bumping into the second talk).

There is also a list of videos at Info on OOP | westworld of which the non-overlapping ones are more aimed specifically at Java development (but for non-Java programmers, it is good to know about things like GUICE, JMock and EasyMock).

I still need to review the rest of the talks listed at About Miško Hevery.

–jeroen


Filed under: .NET, Agile, C#, Delphi, Development, Java, Java Platform, JavaScript/ECMAScript, Pascal, Scripting, Software Development, Unit Testing, VB.NET

by jpluimers at September 25, 2014 11:00 AM

September 24, 2014

while true do;

Using dynamic arrays and Parallel Programming Library (Part 1)

The Parallel Programming Library introduced in XE7 is one of the  most awaited built-in library for the Delphi and C++Builder RTL, at least for me. I’ve still a nice list waiting for the next versions, but this is another story Marco Cantù wrote about dynamic arrays some days ago, another nice feature introduced in [...]

by Daniele Teti at September 24, 2014 08:48 PM

Firebird News

Firebird 3.0 beta 1 is almost ready

Dmitry Yemanov recently announced (in fb-devel discussion list) that Beta 1 of Firebird 3 is expected to be released in the next week. Please take some time when Beta1 is out and do as much tests as you can, and report the problems back in fb-devel or Firebird tracker, helping the core developers to address the issues […]

by Cantu at September 24, 2014 04:42 PM

The Wiert Corner - irregular stream of stuff

jpluimers

A while ago, I had a client with an exception on a workstation.

There was no permission to run a debugger on their system, or use something like MadExcept or Exceptional Magic in their code base.

The exception looked like this:

---------------------------
Application Error
---------------------------
Exception EInOutError in module MyApplication.exe at 001656B1.File access denied.
---------------------------
OK
---------------------------

These are the steps to get at the source line in an x86 Delphi program (I still have to try the x64, but presume it works similarly):

  1. Go to the Project Options dialog
  2. Browse to Delphi Compiler; Linking
  3. Note the value of the Image Base setting (in this case $400000
  4. Add that to the value from the error dialog ($001656B1 + $400000 = $005656B1)
  5. Use F7 to step into your executable
  6. In the menu goto View; Debug Windows; CPU Windows; Entire CPU
  7. Press Ctrl-G then enter $005656B1
  8. Press Ctrl-V to go to the source code line

Convoluted, but it works (:

 

–jeroen


Filed under: Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development

by jpluimers at September 24, 2014 05:00 AM

September 23, 2014

Firebird News

NHibernate 4.0.1.GA released with Firebird fixes

NHibernate 4.0.1 General Availability is now available for download from Sourceforge and Nuget. http://sourceforge.net/projects/nhibernate/?source=directory This includes fixes for regressions in NH 4.0.0, and some fixes for mapping-by-code and Firebird issues. Please see the full release notes for more information: https://github.com/nhibernate/nhibernate-core/blob/4.0.1.GA/releasenotes.txt

by mariuz at September 23, 2014 11:45 AM

September 21, 2014

Firebird News

Database .NET 13.0 released

Database .NET is an innovative, powerful and intuitive multiple database management tool, With it you can Browse objects, Design tables, Edit rows, Export data and Run queries with a consistent interface. New features and improvements from 12.4 to 13.0 (2014/09/22) Updated to FirebirdSql.Data.FirebirdClient.dll 4.5.1 Added [ADV] Advanced Browsing Options Added [ADV] Advanced Edit Options Added […]

by fishcodelib at September 21, 2014 04:23 PM

September 20, 2014

twm’s blog

Some changes to CustomContainerPack

Today I made some small changes to the CustomContainerPack.

If you don’t know about the Custom Container Pack, see my previous blog post.

Apart from removing two with statements I changed the place where the wizard shows up in the File -> New -> Other dialog. Up to Delphi 7 it is still in the “New” category.

ccpack_delphi7

For newer Delphi versions, it now shows up in the “Delphi Files” category:

ccpack_delphi2005

It took me quite a while to figure out how to do it. Just returning “Delphi Files” from the IOTARepositoryWizard.GetPage function doesn’t work. The trick is to use the IOTARepositoryWizard80 interface that was introduced with Delphi 2005 (or, judging from the name, probably with Delphi 8). It added two new functions to IOTARepositoryWizard:

    function GetPersonality: string;
    function GetGalleryCategory: IOTAGalleryCategory;

GetPersonality is easy, you just return one of the pre-defined string constants sXxxxPersonality, in this case: sDelphiPersonality

function TCCWizard.GetPersonality: string;
begin
  Result := sDelphiPersonality;
end;

(If anybody wants to check if CustomContainerCack can be used with the C++Builder personality, please contact me through my Google+ page.)

GetGalleryCategory is a bit more tricky. I found the solution in Steve’s Blog:

function TCCWizard.GetGalleryCategory: IOTAGalleryCategory;
var
  cat: IOTAGalleryCategory;
  catMgr: IOTAGalleryCategoryManager;
begin
  catMgr := (BorlandIDEServices as IOTAGalleryCategoryManager);
  Assert(Assigned(catMgr));
  cat := catMgr.FindCategory(sCategoryDelphiNewFiles);
  Assert(Assigned(cat));
  Result := cat;
end;

by dummzeuch at September 20, 2014 04:02 PM

The Wiert Corner - irregular stream of stuff

jpluimers

So I won’t forget: Abstract syntax tree builder for Delphi.

Abstract syntax tree builder for Delphi
DelphiAST Announce
roman.yankovsky.me

Based on CastaliaDelphiParser. Published with MPL license.

–jeroen

via: Does anyone know of a way to get an AST of a Delphi unit? Out of the various….


Filed under: Delphi, Development, Software Development

by jpluimers at September 20, 2014 01:51 PM

Firebird News

Avoding blind sql injections in #php

Common steps in avoiding sql injections 1.First step is to sanitize the inputs and never trust what comes from POST/GET : 2.Another tip is to Always use prepared statements (in ibase) or PDO that is more safe (query stays unchaged while executing the php script) and the parameters will be the only changes in the queries (feed them from […]

by mariuz at September 20, 2014 10:40 AM

September 19, 2014

The Podcast at Delphi.org

Hello Moto 360 from Delphi XE7

Moto 360I really like my Moto 360 watch. It looks fabulous, and does great as an extension of my Android phone, but of course the most important question is how to make an app for it. Turns out it just works with RAD Studio X7, Delphi or C++. Thanks to the new FireUI Multi-Device designer I can actually create a custom view in the UI to make designing the perfect user interface a breeze. Here are some of the details of what I discovered along the way, followed by a download of my sample and the custom view.

The bottom line is it just works, which really isn’t a surprise. Most new Android devices use ARMv7 and the NEON instruction set. (NEON is kind of like the MMX standard on the Intel platform. At first not everyone used those instructions, but once they caught on, everyone did.) So it is no surprise that the Moto 360 does too. Unlike some of the other watches, the Moto 360 does not have a micro USB port. So you have to use ADB over BlueTooth. This requires a few extra steps to setup, and is really slow to deploy over. So slow I canceled the first two deployments because I thought I set something up wrong.

First of all, the Moto 360 display is not perfectly round. It has a flat area on the bottom. If you look closely you can see the light sensor there. Not sure if that was why it wasn’t round, or if there was another design reason. In any case, the screen resolution is 320 x 290 pixels at 213 Pixels Per Inch. This means at design time you have a usable area of 240 x 218 pixels. This is the information we need to create a custom view. Just put the following code in a package.

  TDeviceinfo.AddDevice(TDeviceinfo.TDeviceClass.Tablet, ViewName,
    // The Moto360 is 320x290 phyiscal and 240x218 logical with 213 PPI
    TSize.Create(320, 290), TSize.Create(240, 218),
    TOSVersion.TPlatform.pfAndroid, 213,
    True); // Exclusive

The Device class enumeration actually has a Watch class, but looking in the code that detects the class at runtime and it doesn’t know how to detect a watch yet. So it defaults to Tablet. It makes sense if you think about the fact that XE7 was released before the Moto 360. I imagine an update will address this.

The requirement to get the custom view to show up in the IDE is you need to update the XML file found at %AppData%\Roaming\Embarcadero\BDS\15.0\MobileDevices.xml to reference the new view. Inside the MobileDevices element, add the following:

  <MobileDevice>
    <Displayname>Moto360</Displayname>
    <Name>Moto360</Name>
    <DevicePlatform>3</DevicePlatform>
    <FormFactor>2</FormFactor>
    <Portrait Enabled="True" Width="240" Height="218" Top="102" Left="29" StatusbarHeight="0" StatusBarPos="0" Artwork="C:\Users\jim\Documents\Embarcadero\Studio\Projects\HelloMoto360\Moto360.png" />
    <UpsideDown Enabled="False" Width="240" Height="218" Top="0" Left="0" StatusbarHeight="0" StatusBarPos="0" Artwork="" />
    <LandscapeLeft Enabled="False" Width="240" Height="218" Top="0" Left="0" StatusbarHeight="0" StatusBarPos="0" Artwork="" />
    <LandscapeRight Enabled="False" Width="240" Height="218" Top="0" Left="0" StatusbarHeight="0" StatusBarPos="0" Artwork="" />
  </MobileDevice>

You’ll need to update the path to that Artwork to point to the correct location of the PNG on your system. Or you can just leave it blank. Here is what it all looks like when setup in the IDE.

Hello Moto 360 in the XE7 IDE

You’ll notice a red circle on the design surface. I added this to see where the corners are (since the display is round). At runtime you can just barely see the red if you hold the watch right. In production I’d hide this at runtime. I placed the TCircle at -1, -1 and set the size to 242 x 242. This way the circle follows the bezel and not the display area of the screen. I suppose if I bumped it out another pixel it would disappear completely at runtime.

To get the Moto 360 to show up as a target device you first need to enable Bluetooth debugging.

  1. Hold the side button in until Settings appears
  2. Swipe down to About and tap it.
  3. Tap on build number until it tells you that you are a developer.
  4. Swipe back to settings and then tap on Developer options.
  5. Tap on ADB Debugging until it says Enabled.
  6. Tap on Debug over Bluetooth until it says Enabled.
  7. On your paired phone, go into Android Wear settings (gears in the upper right)
  8. Enable Debugging over Bluetooth.
    1. It should show
      • Host: disconnected
      • Target: connected
    2. Target is the watch, Host is your computer.

Then you connect your phone that is connected to the Moto 360 via USB and run the following commands (assuming ADB is on your system path) to connect via Bluetooth. I made a batch file.

[dos]
@echo off
REM optional cleaning up
adb disconnect localhost:4444
adb -d forward –remove-all
REM this is the connection
adb -d forward tcp:4444 localabstract:/adb-hub
adb -d connect localhost:4444
REM these lines are to see if it worked
echo Here is the forwarded ports . . . .
adb forward –list
echo.
echo Wait a second for it to connect . . . .
pause
adb devices
[/dos]

The ADB Devices list should show something like

List of devices attached 
123456abcd device 
localhost:4444 device

Now the Android Wear app on your phone should show

  • Host: connected
  • Target: connected

Be sure that your Moto 360 app uses the unit that defines the Moto 360 device (from your package). This way your app can select it at runtime. If you do all that, you’ll see something similar to this with it running on the Moto 360:

Hello Moto 360 from Delphi XE7

My camera had a hard time focusing on it, but rest assured it looks fabulous! I tried C++ too, and no surprises, it works as well. More experimenting to do, but it is nice to know I have a tool that will take me everywhere I want to go.

If you don’t have a Moto 360, you can setup an Android emulator (AVD) instead. I did that before mine showed up. You need to download the Android 4.4W (API20) SDK Platform and ARM System image.

Android Wear SDK Download

Then create an AVD with the new Emulator.

Android Wear AVD Settings

It actually gives you the rectangle screen with a round bezel. Also it is 320 x 320 (so completely round) and 240 PPI. This means the view I created (since it was exclusive) won’t work on the emulator. You’ll need to create a new custom view for the emulator, but I’ll leave that up to to.

you can download all of my code for the custom view, Bluetooth ADB batch file, and sample apps from Github. (Update: Added a view for Galaxy Gear Live) BTW, XE7 adds local Git support, which is another great new feature. Download the trial and check it out.

by Jim McKeeth at September 19, 2014 06:40 PM

September 18, 2014

The Wiert Corner - irregular stream of stuff

Click on the shield icon, followed by

If you run Continua CI 1.5.x.y and use Git then make sure you upgrade to at least Continua CI 1.5.0.295 (get it from the Continua CI download page).

Click on the shield icon, followed by

Click on the shield icon, followed by “CI Server”

After that, reset all your Git repositories in ContinuaCI.

To view all the repositories on the server, follow either of these steps:

  • A:
    1. Logon as an administrator with the rights to view all repositories on the Continua CI server.
    2. Click on the shield icon in the top bar.
    3. Then click on “CI Server”.
    4. In the list on the left, scroll down and click “Repositories”.
  • B:
    1. Logon as an administrator with the rights to view all repositories on the Continua CI server.
    2. Note the URL in the address bar of your browser (for instance http://localhost:8080/ci).
    3. Replace the /ci part of your URL with /administration/ci/repositories (so you end up at something like http://localhost:8080/administration/ci/repositories).
    4. Go to that URL.

Now you are in the repositories section, where you see all the repositories configured on the Continua CI. Each repository has a [Reset] link in the right most column.

Then follow these steps:

  1. For all Git repositories,
    1. Click on the [Reset] link.
    2. Confirm the “Are you sure you want to reset this repository?” question by clicking “Yes”.
  2. Wait for all Git repositories to be marked “Ready” and have a green checkmark icon.

The Git repositories will go through these states to become “Ready”:

  1. Initialising
  2. Updating cache
  3. Getting changessets
  4. Ready

–jeroen

via Continua CI – v1.5.0.295 Released. Critical bug fix for Git.

A new version of Continua CI has been uploaded and is available from Continua CI Downloads. The latest version of Continua CI is now 1.5.0.295.

Critical fix notification for users running v1.5 or greater: All users with Git repositories should install this update. After installing please perform a repository reset of all Git repositories which contain the “fetch other refs” option. This can be done from the Administration -> Repository area

v1.5.0.295 Changes

  • Fix: Critical issue with Git repositories which contain the “fetch other refs” option causing large repository cache size and lost of performance. Please reset all Git repositories which contain “fetch other refs” options.
  • Fix: Vault repositories now allow a blank empty password to be entered
  • Fix: Copying Subversion branches which contain externals would result in externals from the destination branch to be ignored.
  • Fix: Issue where empty Subversion changesets would prevent a build from starting.Note : You will need to update your agents after installing this build.

View full version history for Continua CI 1.5.

Note : You will need to update your agents after upgrading to this build.


Filed under: .NET, Continua CI, Continuous Integration, Delphi, Development, Software Development

by jpluimers at September 18, 2014 10:22 AM

September 17, 2014

The road to Delphi

The Podcast at Delphi.org

The FireUI: Multi-Device Designer in RAD Studio XE7

Here is the video replay, slides and resources from my Developer Skill Sprint on the new Multi-Device Designer in RAD Studio XE7. This is one part of the new FireUI, the evolution of FireMonkey.

The Multi-Device Designer is a new feature in Appmethod, RAD Studio, Delphi and C++Builder XE7 that makes it easy to maximize the reuse of your visually designed forms across devices, while also getting the most flexibility and customization as possible.

Design your UI once for Windows, OS X, iOS and Android, then customize it for different screen sizes: iPad, iPhone, Tablet, Google Glass, Surface Pro, etc.

You can view the slides on Google Docs.

Check out the Guided Tour on the Welcome Page and the following DocWiki pages:

Check out the other skill sprints too. . .

by Jim McKeeth at September 17, 2014 08:03 PM

September 16, 2014

Firebird News

Firebird Manual Pages Reorganisation and cleanup

Paul Vinkenoog cleaned up that page and wrote on Firebird-docs: – On top are the most important version-specific docs for the currently supported versions, i.e. 2.5 and 2.1 Quick Start Guides and LangRef Updates. – After that, the Command Line Utilities manuals, followed by other user manuals, reference material and the Firebird licenses. – Then come the […]

by mariuz at September 16, 2014 12:39 PM

Firebird Conference 2014: only 1 month left

Firebird International Conference 2014 will take place on October 24-25, in Prague. 2 days of the intensive talks from Firebird core and drivers developers, vendors of leading Firebird tools and even legends of the database world: Ann Harrison and Jim Starkey. Take a look at detailed talks descriptions. Don’t miss the biggest event of the year, […]

by mariuz at September 16, 2014 09:14 AM

September 15, 2014

The Wiert Corner - irregular stream of stuff

jpluimers

Simon Stuart yesterday posted a very interesting post on G+ that explains on this (edited) topic:

#Rendering   I was having a conversation last night … with +David Berneda regarding rendering performance improvements for FireMonkey applications.
Specifically, custom drawing/rendering on a FireMonkey Canvas.

I just want to summarize the points I raised, and some of the conclusions I’ve come to having been working with rendering in FireMonkey since the end of June this year.

–jeroen

via: Simon Stuart rendering performance improvements for FireMonkey applications. Specifically, custom drawing/rendering on a FireMonkey Canvas.


Filed under: Delphi, Delphi XE5, Delphi XE6, Delphi XE7, Development, FireMonkey, OS X FMX, Software Development

by jpluimers at September 15, 2014 05:30 AM

September 14, 2014

Lazarus Team Anouncements

Bug Busters

Hello

We are slowly moving towards the next Lazarus 1.4 release. (No fixed date yet.)
The list of open issues targeted for 1.4 is partly cleaned. There were ~400 of them (for historical reasons), now they are down to ~140.

Maybe due to increased popula...

September 14, 2014 04:04 PM

twm’s blog

Custom Container Pack for Delphi XE2 to XE7

I just updated the Custom Container Pack sources to support Delphi XE2 to XE7. It was mostly a matter of creating the packages for the newer versions. I also had to adapt the registration code to changes in Delphi XE2.

It now compiles and installs. I have not tested it extensively. We use it at work with Delphi 2007 and I know of no bugs with it.

Custom Containers Pack (CCPack) is an integrated tool and component mini-library to produce and maintain composite controls (or simply “composites”) and other containers (forms, data modules and frames). The process of building composite components looks like ActiveForm and Frame creating, but the result is the native VCL component. You can create new composites just as usual forms.

Here is the original documentation in RTF format.

It was originally developed by Sergey Orlik who posted the source code to code central

by dummzeuch at September 14, 2014 12:37 PM

September 13, 2014

Te Waka o Pascal

Zombie Apps (not) in the Apple App Store

In the run up to the announcement of the new iPhone 6 and the Apple Watch, Apple also revamped iTunes Connect, the portal through which apps are submitted to the App Store. Unfortunately the new interface has a number of problems which I spent wasted hours dealing with yesterday. Beginning at the Beginning The problems […]

by Jolyon Direnko-Smith at September 13, 2014 10:12 PM

twm’s blog

dzlib compiles with all Delphi versions from 2007 to XE6

Today I spent some time to make dzlib compile with all Delphi versions from 2007 to XE6 (XE7 to come later). It didn’t take too long since it already supported 2007, XE2 and XE6.

It’s interesting to see, how the RTL evolved between these versions. Some examples:

  • The IsWhitespace function started out as a class method of TCharacter, then moved to TCharHelper and finally ended up as a method of the Char type itself (probably added through a class helper, I didn’t check).
  • The global DecimalSeparator variable was marked deprecated for a long time (replaced by a property of the global FormatSettings class) and has finally been removed from the RTL.

There is also a breaking change in the Delphi XE6 RTL:
You can no longer create a TThread suspended and then call Resume/Start from within its constructor. If you do that, you will get an exception. But since the thread no longer gets started until the constructor has run that is no longer necessary.

by dummzeuch at September 13, 2014 06:51 PM

[German only] Fahrradbeleuchtung

Es wird wieder dunkel, und so allmählich braucht man auch zu normalen Radfahrzeiten wieder Licht. Seit einiger Zeit sind laut STVZO batteriebetriebene Lampen auch für normale Fahrräder zugelassen, sofern sie einige Bedingungen erfüllen. Passend dazu hatte Aldi Nord am 11.8.2014 die Pedaluxx LED Fahrradbeleuchtung im Angebot. Ich habe zugegriffen, weil ich dachte, dass man für 9,99 Euro nicht allzuviel verliert, wenn sie nichts taugt.

Die Lampen an sich sind ganz OK, auch wenn es ziemlich verwirrend ist, dass die Lade-Kontrolleuchte der Frontlampe an geht, wenn die Batterien gewechselt werden sollen, die des Rücklichts hingegen geht dann aus.

Die Halter allerdings sind ziemlich wacklig. Ich bin mir sicher, dass sie nicht lange halten werden. Schon bei der Montage der Halterung für die Frontlampe habe ich bemerkt, dass sich das dünne Plastik, in dem die Schraube halten soll, nach außen verbiegt.

Ich hatte vorher (bevor mir das Fahrrad komplett geklaut wurde) eine andere (aber auch deutlich teurere) Frontlampe, damals noch ohne STVZO-Zulassung, deren Halter bombenfest sass. Leider gibt es die nicht mehr zu kaufen.

Batterien (8x AAA) waren dabei, aber ich werde sie, sobald sie leer sind, durch Akkus ersetzen.

Man sollte vielleicht erwähnen, dass die neue Fassung der STVZO zwar batteriebetriebene Lampen erlaubt, man diese allerdings nach STVO bei der Benutzung des Fahrrads (also auch tagsüber) montiert haben muss. Mitführen alleine reicht nicht. Genaugenommen ist es sogar noch schlimmer: Die Leuchten müssen “fest” am Rad montiert sein, danach wären Ansteckleuchten gar nicht zulässig. Ob das so ist, ist noch nicht endgültig geklärt.

Mir persönlich ist es ziemlich egal, was diese Vorschriften zur Fahrradbeleuchtung sagen. Mir ist wichtig, dass ich im Straßenverkehr gesehen werden, denn ich möchte gerne noch ein paar Jährchen leben und ich weiß, wie schlecht Radfahrer ohne Licht in der Dämmerung zu sehen sind. Deshalb werde ich diese Beleuchtung testen und verwenden, wenn sie ihren Zweck erfüllt. Wenn nicht, muss eine andere her, Zulassung oder nicht.

Vielleicht noch ein Hinweis: Anders als früher sind Fahrradlampen heute so hell, dass sie entgegenkommende Verkehrsteilnehmer blenden, wenn sie falsch eingestellt sind. Die Frontlampe muss so eingestellt sein, dass ihr Leuchtkegel die Straße max. 15 m vor dem Fahrrad beleuchtet. Mir kommen in letzter Zeit leider immer wieder andere Radfahrer entgegen, deren Licht viel zu hoch gestellt ist.

(STVO = Straßenverkehrsordnung, STVZO = Straßenverkehrs-Zulassungs-Ordnung)

by dummzeuch at September 13, 2014 06:39 PM

September 12, 2014

Andy's Blog and Tools

EditorLineEnds.ttr – IDEFixPack users are not affected

With the latest Windows updates (KB2982791, KB2970228) Delphi 8-2010 can’t be started twice without a reboot because the IDE wants to create the file %TEMP%\EditorLineEnds.ttr that is now locked by the system.

The IDE extracts a FONT-resource to %TEMP%\EditorLineEnds.ttr and then loads it with AddFontResource(). The IDE’s finalization code unloads the font. But with the newest Windows Updates, Microsoft prevents the RemoveFontResource() function from unlocking the file (for security reasons). If you start a second IDE the resource-extraction fails and throws an exception causing the IDE to terminate.

If you have IDEFixPack newer than 2.7 already installed, you are not affected because IDEFixPack prevents the IDE from calling AddFontResource (this was a patch to work around a performance nightmare with an installed Adobe Type Manager). Thus the file is never locked.

If you are a new user to IDEFixPack, you may need to reboot after installing IDEFixPack if the font file is already locked.

IDEFixPack for 2009 or newer

IDEFixPack for 2007 (if you have Windows 8 you need to use version 4.3 instead of 4.4)

by Andreas Hausladen at September 12, 2014 03:05 PM

Firebird News

The Perfect Database Server: Firebird 2.5.3 And FreeBSD 10

Here is the guide on installing Firebird 2.5.3 from FreeBSD 10 Ports and creating your first test database; also we show you how to install Flamerobin GUI (administration tool) and the PHP driver for it. This was tested on fresh FreeBSD 10 on a kvm-linux virtual machine. Download a compressed snapshot of the Ports Collection into /var/db/portsnap. […]

by mariuz at September 12, 2014 02:35 PM

September 11, 2014

Daniel Magin's Logfile

NFC Android Application with Delphi XE6 and XE7

NFC Android Application with Delphi XE6 and XE7

DelphiXE6

Download Delphi XE6 Example Source Code

For the German Delphi Days last Weekend in Bonn i prepared a Workshop and a Session how to develop with Delphi a Android Application to read and write NFC tags. So i worked out a Delphi Example to do this. Delphi brings no ready components to do this out of the box. So i tried my first steps and i found it is not only necessary to add in classes.dex the NFC SDK Jar Files, no it was also necessary to change the NativeActivity in the AndroidManfifest.template (see later more in detail). I remember that my friend Brian Long, also a Embarcadero MVP have done this with XE5 and XE6 on his blog (LINK). So i called him and we suprise, he was also to test out NFC with Delphi for Android at the same time. So we decided everybody was work for 1 week seperate and then we merge our knowledge. It was really funny later he did found out what i am missing and i found out stuff he missed.

Brian Long also published his result here: LINK

Requirements

1. to run such Android Applications you need a Android Device WITH NFC ! So please check your device. I found also a nice webpage with a collection of NFC Android Devices on LINK/

2. Ready installed Delphi XE6 or XE7

3. Read AND understand (!) the Article published from Google in the Developer Network. Minimum read and understand the following parts in Chapter NFC Basics:

LINK

NFC Basics

  • The Tag Dispatch System
  • Requesting NFC Access in the Android Manifest
  • Filtering for NFC Intents
  • Creating Common Types of NDEF Records

4. Read dokwiki what is classes.dex in Delphi and how to patch this:

- XE6 Users: LINK

- XE7 Users: LINK

XE6 Users: A big new function in XE7 IDE is to drag and drop a jar file in your porject, and Delphi create on compile the classes.dex file for you automatic. So ist is extreme much easier to add your custom or 3rd Party JARS from other Hardware for your device into your Delphi Project

RadStudioXE7

Ok let's rock Delphi to work with NFC on Android Devices

Before we create the Delphi Project, we need to pack all the NFC SDK stuff in a JAR file and create the Pascal files to use it.

The minimum version requirements, the NFC is to Android2.3 (Level 10) began to support the minimum version requirements must be specified as 10. Introduced in Android 4.0 (API level 14) we can all we need to read and write NFC and much more. This should also you minimum SDK on your Computer. So if you have not this SDK on your machine, please update your sdk folder with local "SDK Manager.exe" in your Android SDK folder Path.

RadStudioXE7

Let's tals also for nun Java Friends how to generate a .java text file to a .jar file. It is very simple. For Delphi XE6 you need minimum java 1.6 and XE7 java 1.7 on your machine. Open a Command box and type "java -version". If java is installed correct you should a result like this:

RadStudioXE7

crash session how to compile a jar file from a .java text file

  1. javac ABC.java <-- create a ABC.class from .java file
  2. jar cfv ABC.jar ABC.class <-- this create a .jar file from .class file

so wee need all NFC .java files in your

PATH_TO YOUR SDK FOLDER ..Android\sdk\sources\android-20\android\nfc\

After this two simple commands we have a ready jar file to generate the pascal file.

This inteface pascal file for this new Java classes. This is not so simple for XE6 Users. You can write it by hand but this will end in a horror never ending time. There are some 3rd party tools like Java2Pas and other, but this produce for each created .jar file a seperate .pas file. But mostly each file uses each other. So you have circular uses wich delphi can not compile this, so you must copy paste all .pas files in one file per hand. XE7 Users get a free tool Java2OP.exe (it should be possible to download in a few days). This tool handles all for you perfect - LINK TO JAVA2OP .

I think the generated files can be used also in XE6, but i have not tested out, cause the Embarcadero Java2OP.exe is not available now during the time i was writing this article. Also the Embarcadero Java2OP.exe should generate the Pascal files direct form the .java files, so compiling to jar is not necessary anymore, as the documentation is talk about it. but it was not possible to test.

Don't go in panic in my example download, the .pas file is ready to use. i have generated it with my own converter.

Ok what also we need and this we add in the classes.dex file:

to catch the event if a user is bring a NFC Card to the Phone i found out the application get a onNewIntent fired. But this Events we did not find translated to the firemonkey framework. but this is very simple to solve. we write a very small java class and add this class to our classes.dex.

This java class handles everything for us like onNewIntent, NFC enable/disable on pause, resume,...

With the line public native void onNewIntentNative(Intent NewIntent); we introduce a new method wich will be fired on the original onNewIntent method. Thanks to Brian Long to figure this out :-)

  1. package net.developerexperts.nfc;
  2.  
  3. import android.os.Bundle;
  4. import android.util.Log;
  5. import android.content.Intent;
  6.  
  7. import android.nfc.NfcAdapter;
  8. import android.content.Intent;
  9. import android.app.PendingIntent;
  10.  
  11. import android.app.AlertDialog;
  12. import android.content.DialogInterface;
  13. import android.content.DialogInterface.OnClickListener;
  14.  
  15. public class NativeActivitySubclass extends com.embarcadero.firemonkey.FMXNativeActivity {
  16.  
  17. static final String TAG = "NativeActivitySubclass";
  18.  
  19. private NfcAdapter nfcAdapter;
  20. private PendingIntent pendingIntent;
  21.  
  22. @Override
  23. protected void onCreate(Bundle savedInstanceState) {
  24. super.onCreate(savedInstanceState);
  25. //Custom initialization
  26. nfcAdapter = NfcAdapter.getDefaultAdapter(this);
  27.         Intent intent = new Intent(this, getClass());
  28.         pendingIntent = PendingIntent.getActivity(this, 0,
  29.             intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
  30. }
  31.  
  32. public native void onNewIntentNative(Intent NewIntent);
  33.  
  34. @Override
  35. protected void onNewIntent(Intent intent)
  36.     {
  37. super.onNewIntent(intent);
  38. onNewIntentNative(intent);
  39. }
  40.  
  41. @Override
  42.     public void onPause()
  43.     {
  44.         super.onPause();
  45. disableForegroundDispatch();
  46.     }
  47.  
  48. @Override
  49.     public void onResume()
  50.     {
  51.         super.onResume();
  52. enableForegroundDispatch(pendingIntent);
  53.     }
  54.  
  55. public void enableForegroundDispatch(PendingIntent pendingIntent)
  56. {
  57. nfcAdapter.enableForegroundDispatch(this, pendingIntent, null, null);
  58. }
  59.  
  60. public void disableForegroundDispatch()
  61. {
  62. nfcAdapter.disableForegroundDispatch(this);
  63. }
  64.  
  65. public void showDialog(final String title, final String msg)
  66. {
  67. Log.d(TAG, "Displaying dialog");
  68. runOnUiThread(new Runnable() {
  69. public void run() {
  70. AlertDialog.Builder builder = new AlertDialog.Builder(NativeActivitySubclass.this);
  71. builder.setMessage(msg).
  72.                         setTitle(title).
  73.                         setCancelable(true).
  74.                         setPositiveButton("OK", new OnClickListener(){
  75. public void onClick(DialogInterface dialog, int which)
  76. {
  77. dialog.dismiss();
  78. }
  79.        }).show();
  80. }
  81. });
  82. }
  83. }

for this small new onNewIntentNative we add later a method in our mainform:

  1. procedure OnNewIntentNative(PEnv: PJNIEnv; This: JNIObject; NewIntent: JNIObject); cdecl;
  2. begin
  3.   Log.d('Queuing native routine to run synchronized');
  4.   TThread.Queue(nil,
  5.     procedure
  6.     begin
  7.       frmMain.OnNewIntent(TJIntent.Wrap(NewIntent)); //CALL the next procedure
  8.     end);
  9. end;
  10.  
  11.  
  12. procedure TfrmMain.OnNewIntent(Intent: JIntent);
  13. begin
  14.   //here we add later code what ever we like to do if a NFC Card is found
  15. end;

to register the native event we this code in delphi

  1. procedure TfrmMain.RegisterDelphiNativeMethods;
  2. var
  3.   PEnv: PJNIEnv;
  4.   ActivityClass: JNIClass;
  5.   NativeMethod: JNINativeMethod;
  6. begin
  7.   Log.d('Starting the registration JNI stuff');
  8.  
  9.   PEnv := TJNIResolver.GetJNIEnv;
  10.  
  11.   Log.d('Registering interop method');
  12.  
  13.   NativeMethod.Name := 'onNewIntentNative';
  14.   NativeMethod.Signature := '(Landroid/content/Intent;)V';
  15.   NativeMethod.FnPtr := @OnNewIntentNative;
  16.  
  17.   ActivityClass := PEnv^.GetObjectClass(PEnv, PANativeActivity(System.DelphiActivity).clazz);
  18.  
  19.   PEnv^.RegisterNatives(PEnv, ActivityClass, @NativeMethod, 1);
  20.  
  21.   PEnv^.DeleteLocalRef(PEnv, ActivityClass);
  22. end;

Ok let's go back to add our small jar file into XE6

To generate in XE6 your custom classes.dex file Brian Long have written a wonderful batch file:

  1. @echo off
  2.  
  3. setlocal
  4.  
  5.  
  6. // CHANGE IN NEXT LINE YOUR SDK ROOT FOLDER
  7. if x%ANDROID% == x set ANDROID=c:\Android\sdk\
  8. set ANDROID_PLATFORM=%ANDROID%\platforms\android-19
  9. set DX_LIB=%ANDROID%\build-tools\android-4.4\lib
  10. set DX_BATCH=%ANDROID%\build-tools\android-4.4
  11.  
  12. set EMBO_DEX="C:\Program Files (x86)\Embarcadero\Studio\14.0\lib\android\debug\classes.dex"
  13. set PROJ_DIR="%CD%"
  14. set VERBOSE=0
  15.  
  16. echo.
  17. echo Compiling the Java activity source file
  18. echo.
  19. mkdir output 2> nul
  20. mkdir output\classes 2> nul
  21. if x%VERBOSE% == x1 SET VERBOSE_FLAG=-verbose
  22. javac %VERBOSE_FLAG% -source 1.6 -target 1.6 -Xlint:deprecation -cp %ANDROID_PLATFORM%\android.jar;classes.jar -d output\classes src\net\developerexperts\nfc\NativeActivitySubclass.java
  23.  
  24. echo.
  25. echo Creating jar containing the new classes
  26. echo.
  27. mkdir output\jar 2> nul
  28. if x%VERBOSE% == x1 SET VERBOSE_FLAG=v
  29. jar c%VERBOSE_FLAG%f output\jar\test_classes.jar -C output\classes net
  30.  
  31. echo.
  32. echo Converting from jar to dex...
  33. echo.
  34. mkdir output\dex 2> nul
  35. if x%VERBOSE% == x1 SET VERBOSE_FLAG=--verbose
  36. call %DX_BATCH%\dx --dex %VERBOSE_FLAG% --output=%PROJ_DIR%\output\dex\test_classes.dex --positions=lines %PROJ_DIR%\output\jar\test_classes.jar
  37.  
  38. echo.
  39. echo Merging dex files
  40. echo.
  41. java -cp %DX_LIB%\dx.jar com.android.dx.merge.DexMerger %PROJ_DIR%\output\dex\classes.dex %PROJ_DIR%\output\dex\test_classes.dex %EMBO_DEX%
  42.  
  43. echo Tidying up
  44. echo.
  45. del output\classes\net\developerexperts\nfc\NativeActivitySubclass*.class
  46. rmdir output\classes\net\developerexperts\nfc
  47. rmdir output\classes\net\developerexperts
  48. rmdir output\classes\net
  49. rmdir output\classes
  50. del output\dex\test_classes.dex
  51. del output\jar\test_classes.jar
  52. rmdir output\jar
  53.  
  54. echo.
  55. echo Now we have the end result, which is output\dex\classes.dex
  56.  
  57. :Exit
  58.  
  59. endlocal

Important: if you have installed on your machine Java 1.7 or higher you must compile for Delphi XE6 in java 1.6 this you do like in the batch file:

javac %VERBOSE_FLAG% -source 1.6 -target 1.6 -Xlint:deprecation......

This batch file is not needed for XE7 users cause as i have written you can easy drag and drop the jar files in your project under the project tree in android section.

WOW what a hard work, but if you understand this you are now a hero. now you can add every other jar file in your classes.dex and can easy call.

Now we can with Delphi and welcome back to pascal code ;-)

Generate a new Delphi FMX Project and change it to Android. Save and open the AndroidManifest.template.xml

there we found in the activity area and have to change:

  1.       <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
  2.                 android:label="%activityLabel%"
  3.                 android:configChanges="orientation|keyboardHidden">

Replace with our new Added class to receive our onNewIntent

  1.      <activity android:name="net.developerexperts.nfc.NativeActivitySubclass"
  2.                 android:label="%activityLabel%"
  3.                 android:configChanges="orientation|keyboardHidden"
  4. android:launchMode="singleTop">

Also we add all NFC enhancements what we like to use in our Delphi Application, as you have readed in the Google Developer docs (see requirements on the top of this article). So your AndroidManifest.template.xml sould look like this:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- BEGIN_INCLUDE(manifest) -->
  3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  4.         package="%package%"
  5.         android:versionCode="%versionCode%"
  6.         android:versionName="%versionName%">
  7.  
  8.     <!-- This is the platform API where NativeActivity was introduced. -->
  9.     <!--<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="%targetSdkVersion%" /> -->
  10.    <!--  <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="11" /> -->
  11.      <uses-sdk android:minSdkVersion="%minSdkVersion%" android:targetSdkVersion="%targetSdkVersion%" />
  12.  
  13. <%uses-permission%>
  14.     <application android:persistent="%persistent%"
  15.         android:restoreAnyVersion="%restoreAnyVersion%"
  16.         android:label="%label%"
  17.         android:installLocation="%installLocation%"
  18.         android:debuggable="%debuggable%"
  19.         android:largeHeap="%largeHeap%"
  20.         android:icon="%icon%"
  21.         android:theme="%theme%"
  22.         android:hardwareAccelerated="%hardwareAccelerated%">
  23.         <!-- Our activity is a subclass of the built-in NativeActivity framework class.
  24.              This will take care of integrating with our NDK code. -->
  25.         <activity android:name="net.developerexperts.nfc.NativeActivitySubclass"
  26.                 android:label="%activityLabel%"
  27.                 android:configChanges="orientation|keyboardHidden"
  28. android:launchMode="singleTop">
  29.             <!-- Tell NativeActivity the name of our .so -->
  30.             <meta-data android:name="android.app.lib_name"
  31.                 android:value="%libNameValue%" />
  32.  
  33.  
  34. <intent-filter>
  35.                 <action android:name="android.intent.action.MAIN" />
  36.                 <category android:name="android.intent.category.LAUNCHER" />
  37.             </intent-filter>
  38.  
  39.  
  40. <intent-filter>  
  41.          <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
  42. <category android:name="android.intent.category.DEFAULT"/>
  43. <data android:mimeType="text/plain" />
  44.  
  45.             </intent-filter>
  46.  
  47. <intent-filter>
  48.      <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
  49.      <category android:name="android.intent.category.DEFAULT"/>
  50.      <data android:scheme="http" />
  51. </intent-filter>
  52.  
  53. <intent-filter>
  54.      <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
  55.      <category android:name="android.intent.category.DEFAULT"/>
  56.      <data android:scheme="dav" />
  57. </intent-filter>
  58.  
  59.  
  60. <intent-filter>
  61. <action android:name="android.nfc.action.TECH_DISCOVERED" />
  62. <category android:name="android.intent.category.DEFAULT" />
  63. </intent-filter>
  64. <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
  65. android:resource="@xml/nfc_tech_filter" />
  66.  
  67.  
  68.  
  69.  
  70. </activity>
  71.         <receiver android:name="com.embarcadero.firemonkey.notifications.FMXNotificationAlarm" />
  72.     </application>
  73. </manifest>  
  74. <!-- END_INCLUDE(manifest) -->

Also in in Deployment Options (Menu: Project - Deployment) it is important to disable (only XE6, XE7 do it four you automatic as you learned) the original classes.dex file and deploy your new generated classes.dex file.

DelphiXE6

Next important step is to enable in your Application under Menu Project - Options the NFC rights.

DelphiXE6

I think it is not necessary to discuss all the source lines, but lets try to explain all the new NFC new line. In my Project you find two units:

DeveloperExperts.Android.nfc.pas

this is the generated interface unit to the NFC Android imported SDK we like to use and call

DeveloperExperts.Android.nfc.Helper.pas

this unit handles the most important stuff to work with NFC and Delphi

  1. TDXNFCHelper = class
  2.   private
  3.   public
  4.     class function getNFCManager: JNfcManager;
  5.     class function checkNFC: boolean;
  6.     class function getNFCDefaultAdapter: JNfcAdapter;
  7.     class function NdefRecordsJavaBytesToString(jbytes: TJavaArray<Byte>; const MimeType: TDXMimeType): TDXStringRecord;
  8.     class function GetDXMimeTypeFromString(const sMimeType: string): TDXMimeType;
  9.     class function GetURIType(const _uriID: integer): TDXUriResult;
  10.     class function StringToJavaArrayOfBytes(sText: string): TJavaArray<System.Byte>; static;
  11.     class procedure JavaArrayByteCopy(src: TJavaArray<System.Byte>; srcPos: integer; dest: TJavaArray<System.Byte>; destPos: integer; _length: integer);
  12.     class procedure WriteTextRecordsToNfcCard(NdefRecordsText: TList<string>; IsoLangCode: string; _tag: JTag);
  13.  
  14.   end;
  15.   

this helper class with class methods (for delphi beginners: you do not need to create this class) gives you some methods:

class function checkNFC: boolean;

check is NFC is available an possible to access

class function getNFCManager: JNfcManager;

like described in the Google Developer NFC Guide you get back a NFCManager over this you can access for example the default Adapter to read and write the NFC Card stuff

class function getNFCDefaultAdapter: JNfcAdapter;

direct access to the NFC Default Adapter

class procedure WriteTextRecordsToNfcCard(NdefRecordsText: TList; IsoLangCode: string; _tag: JTag);

write all strings from the Input Parameter TList to text records to the NCF card

all other methods are helper to convert String to Java Array, getMimeTypes, URIType and much more...

Lets analyse the main form

You find a ListBox with 2 items:

checkNFC: call the HelperClass checkNFC to check is NFC available

writeNFC: set a local variable NextNFCTagScanWaitingDataToWrite:=true

so next NFC card touched to the device will be written. Every time a NFC card touched to the device OnNewIntent will be fired (you remember we introduced our java class to get this event)

  1. procedure TfrmMain.OnNewIntent(Intent: JIntent);
  2. begin
  3.   SharedActivity.setIntent(Intent);
  4.  
  5.   CurrentNFCTag := Intent.getParcelableExtra(TJNFCAdapter.JavaClass.EXTRA_TAG);
  6.  
  7.   if not NextNFCTagScanWaitingDataToWrite then
  8.     ReadAllInfomationsFromCurrentNFCIntent
  9.   else
  10.   begin
  11.     WriteWaitingDataToNfcTag;
  12.   end;
  13. end;

There you can found the local variable NextNFCTagScanWaitingDataToWrite check if we read or write the NFC Card.

Writing is very simple.

  1. procedure TfrmMain.WriteWaitingDataToNfcTag;
  2. var
  3.   _tag: JTag;
  4.   sRecords: TList<string>;
  5.  
  6. begin
  7.   NextNFCTagScanWaitingDataToWrite := false;
  8.   displayResult('start writing data', true);
  9.   _tag := TJTag.Wrap((CurrentNFCTag as ILocalObject).GetObjectID);
  10.   if Assigned(_tag) then
  11.   begin
  12.     sRecords:=TList<string>.Create;
  13.     sRecords.Add('This record is from Elmo');
  14.     sRecords.Add('This record is from Bert');
  15.     sRecords.Add('This record is from Cookiemonster');
  16.     TDXNFCHelper.WriteTextRecordsToNfcCard(sRecords,'en',_tag);
  17.     displayResult('finished writing data', true);
  18.   end
  19.   else
  20.   begin
  21.     displayResult('Tag instance not found');
  22.   end;
  23. end;

We generate a TList with all the string we write to the NFC Records. The Helper class make us easy to write:

TDXNFCHelper.WriteTextRecordsToNfcCard(sRecords,'en',_tag);

1. Parameter = the list of strings

2. given a Language Code of our text

3. the _tag (our NFC Card access)

Reading:

  1. procedure TfrmMain.ReadNFCRecords;
  2. var
  3.   Intent: JIntent;
  4.   jIntentName: JString;
  5.   IntentName: string;
  6.   rawMsgs: Androidapi.JNIBridge.TJavaArray<JParcelable>;
  7.   msg: JNdefMessage;
  8.   msgRecords: Androidapi.JNIBridge.TJavaObjectArray<JNdefRecord>;
  9.   i: Integer;
  10.   _NdefRecordRaw: JNIObject;
  11.   _NdefRecord: JNdefRecord;
  12.   recBytes: Androidapi.JNIBridge.TJavaArray<Byte>;
  13.   _currentRecord: TDXStringRecord;
  14. begin
  15.   Intent := SharedActivity.getIntent;
  16.   if Intent <> nil then
  17.   begin
  18.     jIntentName := Intent.getAction;
  19.     IntentName := JStringToString(jIntentName);
  20.     if (TJNFCAdapter.JavaClass.ACTION_NDEF_DISCOVERED.equals(Intent.getAction)) or (TJNFCAdapter.JavaClass.ACTION_TECH_DISCOVERED.equals(Intent.getAction)) then
  21.     begin
  22.       try
  23.         rawMsgs := Intent.getParcelableArrayExtra(TJNFCAdapter.JavaClass.EXTRA_NDEF_MESSAGES);
  24.         if rawMsgs <> nil then
  25.         begin
  26.           if rawMsgs.Length > 0 then
  27.           begin
  28.             msg := TJNdefMessage.Wrap((rawMsgs[0] as ILocalObject).GetObjectID);
  29.             msgRecords := msg.getRecords;
  30.             for i := 0 to msgRecords.Length - 1 do
  31.             begin
  32.               _NdefRecordRaw := msgRecords.GetRawItem(i);
  33.               _NdefRecord := TJNdefRecord.Wrap(_NdefRecordRaw);
  34.               recBytes := _NdefRecord.getPayload;
  35.               _currentRecord := TDXNfcHelper.NdefRecordsJavaBytesToString(recBytes, TDXNfcHelper.GetDXMimeTypeFromString(JStringToString(_NdefRecord.toMimeType)));
  36.               if not _currentRecord.UriResult.UriIsValid then
  37.               begin
  38.                 // mimetype text
  39.                 displayResult('Record ' + i.ToString);
  40.                 displayResult('MIME: ' + JStringToString(_NdefRecord.toMimeType));
  41.                 displayResult('ISO CODE: ' + _currentRecord.ISOCode);
  42.                 displayResult(_currentRecord.payload);
  43.               end
  44.               else
  45.               begin
  46.                 // mimetype URI
  47.                 displayResult('Record ' + i.ToString);
  48.                 displayResult('URI: ' + _currentRecord.UriResult.UriText + _currentRecord.payload);
  49.               end;
  50.             end;
  51.           end;
  52.         end;
  53.       except
  54.         on E: Exception do
  55.         begin
  56.           //Log however you like
  57.         end;
  58.       end;
  59.     end;
  60.   end;
  61. end;

First we check over the intent name if ACTION_NDEF_DISCOVERED (remmeber Google Article NFC Basics). If NFC Intent equals ACTION_NDEF_DISCOVERED so we know we have standard records. So we must read out the the message. The message contains none to many records. we loop over each record and read out the mime time and display the result. In my example i analyse only text and URI types, but you can easy extend to every valid type.

Now you know the most basic steps. You find much more in my example. So take your time to play and work with it.

Summary

You learned how to:

- import android sdk framework stuff

- convert your self written java to jar's

- add your jar's to classes.dex

- how to generate pascal interface files

- call from delphi such stuff

Download Delphi XE6 Example Source Code

What's coming next? Waiting to catch a iPhone 6 to use Delphi and NFC on iOS. This Article will be continued after i have this device in my hand :-)

regards

daniel magin

Embarcadero MVP

@ the end here the wrapped NFC Pascal file (also included in download)

  1. // File generated on 29.07.2014 12:05:01 by DeveloperExperts
  2.  
  3. unit DeveloperExperts.Android.nfc;
  4.  
  5. interface
  6.  
  7. uses
  8.   Androidapi.JNIBridge,
  9.   Androidapi.JNI.Analytics,
  10.   Androidapi.JNI.ApkExpansion,
  11.   Androidapi.JNI.App,
  12.   Androidapi.JNI.Dalvik,
  13.   Androidapi.JNI.Embarcadero,
  14.   Androidapi.JNI.GraphicsContentViewText,
  15.   Androidapi.JNI.Hardware,
  16.   Androidapi.JNI.InputMethodService,
  17.   Androidapi.JNI.JavaTypes,
  18.   Androidapi.JNI.Licensing,
  19.   Androidapi.JNI.Location,
  20.   Androidapi.JNI.Media,
  21.   Androidapi.JNI.Net,
  22.   Androidapi.JNI.OpenGL,
  23.   Androidapi.JNI.Os,
  24.   Androidapi.JNI.PlayServices,
  25.   Androidapi.JNI.Provider,
  26.   Androidapi.JNI.Support,
  27.   Androidapi.JNI.Telephony,
  28.   Androidapi.JNI.Util,
  29.   Androidapi.JNI.VideoView,
  30.   Androidapi.JNI.Webkit,
  31.   Androidapi.JNI.Widget;
  32.  
  33. type
  34.   { Class forward declarations }
  35.   JCardEmulation = interface; { android/nfc/cardemulation/CardEmulation }
  36.   JHostApduService = interface; { android/nfc/cardemulation/HostApduService }
  37.   JOffHostApduService = interface; { android/nfc/cardemulation/OffHostApduService }
  38.   JFormatException = interface; { android/nfc/FormatException }
  39.   JNdefMessage = interface; { android/nfc/NdefMessage }
  40.   JNdefRecord = interface; { android/nfc/NdefRecord }
  41.   JNfcAdapter_CreateBeamUrisCallback = interface; { android/nfc/NfcAdapter$CreateBeamUrisCallback }
  42.   JNfcAdapter_CreateNdefMessageCallback = interface; { android/nfc/NfcAdapter$CreateNdefMessageCallback }
  43.   JNfcAdapter_OnNdefPushCompleteCallback = interface; { android/nfc/NfcAdapter$OnNdefPushCompleteCallback }
  44.   JNfcAdapter_ReaderCallback = interface; { android/nfc/NfcAdapter$ReaderCallback }
  45.   JNfcAdapter = interface; { android/nfc/NfcAdapter }
  46.   JNfcEvent = interface; { android/nfc/NfcEvent }
  47.   JNfcManager = interface; { android/nfc/NfcManager }
  48.   JTag = interface; { android/nfc/Tag }
  49.   JTagLostException = interface; { android/nfc/TagLostException }
  50.   JBasicTagTechnology = interface; { android/nfc/tech/BasicTagTechnology }
  51.   JIsoDep = interface; { android/nfc/tech/IsoDep }
  52.   JMifareClassic = interface; { android/nfc/tech/MifareClassic }
  53.   JMifareUltralight = interface; { android/nfc/tech/MifareUltralight }
  54.   JNdef = interface; { android/nfc/tech/Ndef }
  55.   JNdefFormatable = interface; { android/nfc/tech/NdefFormatable }
  56.   JNfcA = interface; { android/nfc/tech/NfcA }
  57.   JNfcB = interface; { android/nfc/tech/NfcB }
  58.   JNfcBarcode = interface; { android/nfc/tech/NfcBarcode }
  59.   JNfcF = interface; { android/nfc/tech/NfcF }
  60.   JNfcV = interface; { android/nfc/tech/NfcV }
  61.   JTagTechnology = interface; { android/nfc/tech/TagTechnology }
  62.  
  63.   JCardEmulationClass = interface(JObjectClass)
  64.     ['{43DA51E2-EA67-4A69-A20F-1DD312214C2E}']
  65.     { Property methods }
  66.     function _GetACTION_CHANGE_DEFAULT: JString;
  67.     function _GetCATEGORY_OTHER: JString;
  68.     function _GetCATEGORY_PAYMENT: JString;
  69.     function _GetEXTRA_CATEGORY: JString;
  70.     function _GetEXTRA_SERVICE_COMPONENT: JString;
  71.     function _GetSELECTION_MODE_ALWAYS_ASK: Integer;
  72.     function _GetSELECTION_MODE_ASK_IF_CONFLICT: Integer;
  73.     function _GetSELECTION_MODE_PREFER_DEFAULT: Integer;
  74.     { Methods }
  75.     function getInstance(adapter: JNfcAdapter): JCardEmulation; cdecl;
  76.     { Properties }
  77.     property ACTION_CHANGE_DEFAULT: JString read _GetACTION_CHANGE_DEFAULT;
  78.     property CATEGORY_OTHER: JString read _GetCATEGORY_OTHER;
  79.     property CATEGORY_PAYMENT: JString read _GetCATEGORY_PAYMENT;
  80.     property EXTRA_CATEGORY: JString read _GetEXTRA_CATEGORY;
  81.     property EXTRA_SERVICE_COMPONENT: JString read _GetEXTRA_SERVICE_COMPONENT;
  82.     property SELECTION_MODE_ALWAYS_ASK: Integer read _GetSELECTION_MODE_ALWAYS_ASK;
  83.     property SELECTION_MODE_ASK_IF_CONFLICT: Integer read _GetSELECTION_MODE_ASK_IF_CONFLICT;
  84.     property SELECTION_MODE_PREFER_DEFAULT: Integer read _GetSELECTION_MODE_PREFER_DEFAULT;
  85.   end;
  86.  
  87.   [JavaSignature('android/nfc/cardemulation/CardEmulation')]
  88.   JCardEmulation = interface(JObject)
  89.     ['{79EFB1E2-A217-4FA3-BF59-5E79FE67A54B}']
  90.     { Methods }
  91.     function getSelectionModeForCategory(category: JString): Integer; cdecl;
  92.     function isDefaultServiceForAid(service: JComponentName; aid: JString): Boolean; cdecl;
  93.     function isDefaultServiceForCategory(service: JComponentName; category: JString): Boolean; cdecl;
  94.   end;
  95.  
  96.   TJCardEmulation = class(TJavaGenericImport<JCardEmulationClass, JCardEmulation>)
  97.   end;
  98.  
  99.   JHostApduServiceClass = interface(JObjectClass)
  100.     ['{D81BC39F-9EC2-4FF2-80C2-AA000344F762}']
  101.     { Property methods }
  102.     function _GetDEACTIVATION_DESELECTED: Integer;
  103.     function _GetDEACTIVATION_LINK_LOSS: Integer;
  104.     function _GetSERVICE_INTERFACE: JString;
  105.     function _GetSERVICE_META_DATA: JString;
  106.     { Methods }
  107.     function init: JHostApduService; cdecl;
  108.     { Properties }
  109.     property DEACTIVATION_DESELECTED: Integer read _GetDEACTIVATION_DESELECTED;
  110.     property DEACTIVATION_LINK_LOSS: Integer read _GetDEACTIVATION_LINK_LOSS;
  111.     property SERVICE_INTERFACE: JString read _GetSERVICE_INTERFACE;
  112.     property SERVICE_META_DATA: JString read _GetSERVICE_META_DATA;
  113.   end;
  114.  
  115.   [JavaSignature('android/nfc/cardemulation/HostApduService')]
  116.   JHostApduService = interface(JObject)
  117.     ['{C0BA2359-5768-4B3B-9404-2AFFD6F6541B}']
  118.     { Methods }
  119.     procedure notifyUnhandled; cdecl;
  120.     function onBind(intent: JIntent): JIBinder; cdecl;
  121.     procedure onDeactivated(Param0: Integer); cdecl;
  122.     function processCommandApdu(Param0: TJavaArray<Byte>; Param1: JBundle): TJavaArray<Byte>; cdecl;
  123.     procedure sendResponseApdu(responseApdu: TJavaArray<Byte>); cdecl;
  124.   end;
  125.  
  126.   TJHostApduService = class(TJavaGenericImport<JHostApduServiceClass, JHostApduService>)
  127.   end;
  128.  
  129.   JOffHostApduServiceClass = interface(JObjectClass)
  130.     ['{F4642B6A-DEFB-49D6-9A3A-D90BB03600AF}']
  131.     { Property methods }
  132.     function _GetSERVICE_INTERFACE: JString;
  133.     function _GetSERVICE_META_DATA: JString;
  134.     { Methods }
  135.     function init: JOffHostApduService; cdecl;
  136.     { Properties }
  137.     property SERVICE_INTERFACE: JString read _GetSERVICE_INTERFACE;
  138.     property SERVICE_META_DATA: JString read _GetSERVICE_META_DATA;
  139.   end;
  140.  
  141.   [JavaSignature('android/nfc/cardemulation/OffHostApduService')]
  142.   JOffHostApduService = interface(JObject)
  143.     ['{94CBB2DE-3E84-4557-B253-2747C82EBBBA}']
  144.     { Methods }
  145.     function onBind(Param0: JIntent): JIBinder; cdecl;
  146.   end;
  147.  
  148.   TJOffHostApduService = class(TJavaGenericImport<JOffHostApduServiceClass, JOffHostApduService>)
  149.   end;
  150.  
  151.   JFormatExceptionClass = interface(JObjectClass)
  152.     ['{558F4E4C-2DE0-4352-B626-2C9B0D482504}']
  153.     { Methods }
  154.     function init: JFormatException; cdecl; overload;
  155.     function init(&message: JString): JFormatException; cdecl; overload;
  156.     function init(&message: JString; e: JThrowable): JFormatException; cdecl; overload;
  157.   end;
  158.  
  159.   [JavaSignature('android/nfc/FormatException')]
  160.   JFormatException = interface(JObject)
  161.     ['{9F16ED2E-6826-4A40-959E-8858D07D7EF4}']
  162.   end;
  163.  
  164.   TJFormatException = class(TJavaGenericImport<JFormatExceptionClass, JFormatException>)
  165.   end;
  166.  
  167.   JNdefMessageClass = interface(JObjectClass)
  168.     ['{1FFA39B2-A5DB-47A9-9737-7C5821DD97ED}']
  169.     { Property methods }
  170.     function _GetCREATOR: JParcelable_Creator;
  171.     procedure _SetCREATOR(Value: JParcelable_Creator);
  172.     { Methods }
  173.     function init(data: TJavaArray<Byte>): JNdefMessage; cdecl; overload;
  174.     function init(&record: JNdefRecord; records: TJavaObjectArray<JNdefRecord>): JNdefMessage; cdecl; overload;
  175.     function init(records: TJavaObjectArray<JNdefRecord>): JNdefMessage; cdecl; overload;
  176.     { Properties }
  177.     property CREATOR: JParcelable_Creator read _GetCREATOR write _SetCREATOR;
  178.   end;
  179.  
  180.   [JavaSignature('android/nfc/NdefMessage')]
  181.   JNdefMessage = interface(JObject)
  182.     ['{6F6F2C4B-72AA-4F38-9253-A2EF427721C6}']
  183.     { Methods }
  184.     function describeContents: Integer; cdecl;
  185.     function equals(obj: JObject): Boolean; cdecl;
  186.     function getByteArrayLength: Integer; cdecl;
  187.     function getRecords: TJavaObjectArray<JNdefRecord>; cdecl;
  188. //    function getRecords: TJavaArray<JNdefRecord>; cdecl;
  189.     function hashCode: Integer; cdecl;
  190.     function toByteArray: TJavaArray<Byte>; cdecl;
  191.     function toString: JString; cdecl;
  192.     procedure writeToParcel(dest: JParcel; flags: Integer); cdecl;
  193.   end;
  194.  
  195.   TJNdefMessage = class(TJavaGenericImport<JNdefMessageClass, JNdefMessage>)
  196.   end;
  197.  
  198.   JNdefRecordClass = interface(JObjectClass)
  199.     ['{A378AA8C-A1F5-4846-9983-EA96BB1E87E4}']
  200.     { Property methods }
  201.     function _GetCREATOR: JParcelable_Creator;
  202.     procedure _SetCREATOR(Value: JParcelable_Creator);
  203.     function _GetRTD_ALTERNATIVE_CARRIER: TJavaArray<Byte>;
  204.     procedure _SetRTD_ALTERNATIVE_CARRIER(Value: TJavaArray<Byte>);
  205.     function _GetRTD_HANDOVER_CARRIER: TJavaArray<Byte>;
  206.     procedure _SetRTD_HANDOVER_CARRIER(Value: TJavaArray<Byte>);
  207.     function _GetRTD_HANDOVER_REQUEST: TJavaArray<Byte>;
  208.     procedure _SetRTD_HANDOVER_REQUEST(Value: TJavaArray<Byte>);
  209.     function _GetRTD_HANDOVER_SELECT: TJavaArray<Byte>;
  210.     procedure _SetRTD_HANDOVER_SELECT(Value: TJavaArray<Byte>);
  211.     function _GetRTD_SMART_POSTER: TJavaArray<Byte>;
  212.     procedure _SetRTD_SMART_POSTER(Value: TJavaArray<Byte>);
  213.     function _GetRTD_TEXT: TJavaArray<Byte>;
  214.     procedure _SetRTD_TEXT(Value: TJavaArray<Byte>);
  215.     function _GetRTD_URI: TJavaArray<Byte>;
  216.     procedure _SetRTD_URI(Value: TJavaArray<Byte>);
  217.     function _GetTNF_ABSOLUTE_URI: SmallInt;
  218.     function _GetTNF_EMPTY: SmallInt;
  219.     function _GetTNF_EXTERNAL_TYPE: SmallInt;
  220.     function _GetTNF_MIME_MEDIA: SmallInt;
  221.     function _GetTNF_UNCHANGED: SmallInt;
  222.     function _GetTNF_UNKNOWN: SmallInt;
  223.     function _GetTNF_WELL_KNOWN: SmallInt;
  224.     { Methods }
  225.     function init(tnf: SmallInt; &type: TJavaArray<Byte>; id: TJavaArray<Byte>; payload: TJavaArray<Byte>): JNdefRecord; cdecl; overload;
  226.     function init(data: TJavaArray<Byte>): JNdefRecord; cdecl; overload; deprecated;
  227.     function createApplicationRecord(packageName: JString): JNdefRecord; cdecl;
  228.     function createExternal(domain: JString; &type: JString; data: TJavaArray<Byte>): JNdefRecord; cdecl;
  229.     function createMime(mimeType: JString; mimeData: TJavaArray<Byte>): JNdefRecord; cdecl;
  230.     function createUri(uriString: JString): JNdefRecord; cdecl; overload;
  231.     function createUri(uri: Jnet_Uri): JNdefRecord; cdecl; overload;
  232.     { Properties }
  233.     property CREATOR: JParcelable_Creator read _GetCREATOR write _SetCREATOR;
  234.     property RTD_ALTERNATIVE_CARRIER: TJavaArray<Byte> read _GetRTD_ALTERNATIVE_CARRIER write _SetRTD_ALTERNATIVE_CARRIER;
  235.     property RTD_HANDOVER_CARRIER: TJavaArray<Byte> read _GetRTD_HANDOVER_CARRIER write _SetRTD_HANDOVER_CARRIER;
  236.     property RTD_HANDOVER_REQUEST: TJavaArray<Byte> read _GetRTD_HANDOVER_REQUEST write _SetRTD_HANDOVER_REQUEST;
  237.     property RTD_HANDOVER_SELECT: TJavaArray<Byte> read _GetRTD_HANDOVER_SELECT write _SetRTD_HANDOVER_SELECT;
  238.     property RTD_SMART_POSTER: TJavaArray<Byte> read _GetRTD_SMART_POSTER write _SetRTD_SMART_POSTER;
  239.     property RTD_TEXT: TJavaArray<Byte> read _GetRTD_TEXT write _SetRTD_TEXT;
  240.     property RTD_URI: TJavaArray<Byte> read _GetRTD_URI write _SetRTD_URI;
  241.     property TNF_ABSOLUTE_URI: SmallInt read _GetTNF_ABSOLUTE_URI;
  242.     property TNF_EMPTY: SmallInt read _GetTNF_EMPTY;
  243.     property TNF_EXTERNAL_TYPE: SmallInt read _GetTNF_EXTERNAL_TYPE;
  244.     property TNF_MIME_MEDIA: SmallInt read _GetTNF_MIME_MEDIA;
  245.     property TNF_UNCHANGED: SmallInt read _GetTNF_UNCHANGED;
  246.     property TNF_UNKNOWN: SmallInt read _GetTNF_UNKNOWN;
  247.     property TNF_WELL_KNOWN: SmallInt read _GetTNF_WELL_KNOWN;
  248.   end;
  249.  
  250.   [JavaSignature('android/nfc/NdefRecord')]
  251.   JNdefRecord = interface(JObject)
  252.     ['{0E552F6E-B67C-4A19-9BD0-82864906025B}']
  253.     { Methods }
  254.     function describeContents: Integer; cdecl;
  255.     function equals(obj: JObject): Boolean; cdecl;
  256.     function getId: TJavaArray<Byte>; cdecl;
  257.     function getPayload: TJavaArray<Byte>; cdecl;
  258.     function getTnf: SmallInt; cdecl;
  259.     function getType: TJavaArray<Byte>; cdecl;
  260.     function hashCode: Integer; cdecl;
  261.     function toByteArray: TJavaArray<Byte>; cdecl; deprecated;
  262.     function toMimeType: JString; cdecl;
  263.     function toString: JString; cdecl;
  264.     function toUri: Jnet_Uri; cdecl;
  265.     procedure writeToParcel(dest: JParcel; flags: Integer); cdecl;
  266.   end;
  267.  
  268.   TJNdefRecord = class(TJavaGenericImport<JNdefRecordClass, JNdefRecord>)
  269.   end;
  270.  
  271.   JNfcAdapter_CreateBeamUrisCallbackClass = interface(IJavaClass)
  272.     ['{BFE6DE18-1854-4C2C-A523-6425F39AE21C}']
  273.   end;
  274.  
  275.   [JavaSignature('android/nfc/NfcAdapter$CreateBeamUrisCallback')]
  276.   JNfcAdapter_CreateBeamUrisCallback = interface(IJavaInstance)
  277.     ['{609C5FF3-B699-4E05-AF60-567A0BBF0E01}']
  278.     { Methods }
  279.     function createBeamUris(Param0: JNfcEvent): TJavaObjectArray<Jnet_Uri>; cdecl;
  280.   end;
  281.  
  282.   TJNfcAdapter_CreateBeamUrisCallback = class(TJavaGenericImport<JNfcAdapter_CreateBeamUrisCallbackClass, JNfcAdapter_CreateBeamUrisCallback>)
  283.   end;
  284.  
  285.   JNfcAdapter_CreateNdefMessageCallbackClass = interface(IJavaClass)
  286.     ['{51DBF0BD-EF76-40F6-9570-4CA6C447E19A}']
  287.   end;
  288.  
  289.   [JavaSignature('android/nfc/NfcAdapter$CreateNdefMessageCallback')]
  290.   JNfcAdapter_CreateNdefMessageCallback = interface(IJavaInstance)
  291.     ['{A72FD9C9-8A67-499D-B3B0-10E8EC2D6139}']
  292.     { Methods }
  293.     function createNdefMessage(Param0: JNfcEvent): JNdefMessage; cdecl;
  294.   end;
  295.  
  296.   TJNfcAdapter_CreateNdefMessageCallback = class(TJavaGenericImport<JNfcAdapter_CreateNdefMessageCallbackClass, JNfcAdapter_CreateNdefMessageCallback>)
  297.   end;
  298.  
  299.   JNfcAdapter_OnNdefPushCompleteCallbackClass = interface(IJavaClass)
  300.     ['{D859E3F0-641A-410A-9876-DD609FA72DAD}']
  301.   end;
  302.  
  303.   [JavaSignature('android/nfc/NfcAdapter$OnNdefPushCompleteCallback')]
  304.   JNfcAdapter_OnNdefPushCompleteCallback = interface(IJavaInstance)
  305.     ['{01D93D7A-2E1E-4C87-ABE1-77EE7D98C77B}']
  306.     { Methods }
  307.     procedure onNdefPushComplete(Param0: JNfcEvent); cdecl;
  308.   end;
  309.  
  310.   TJNfcAdapter_OnNdefPushCompleteCallback = class(TJavaGenericImport<JNfcAdapter_OnNdefPushCompleteCallbackClass, JNfcAdapter_OnNdefPushCompleteCallback>)
  311.   end;
  312.  
  313.   JNfcAdapter_ReaderCallbackClass = interface(IJavaClass)
  314.     ['{823E7F01-FCE8-43A5-96D4-57B348EDCDF2}']
  315.   end;
  316.  
  317.   [JavaSignature('android/nfc/NfcAdapter$ReaderCallback')]
  318.   JNfcAdapter_ReaderCallback = interface(IJavaInstance)
  319.     ['{F7435248-FC54-4183-923D-BE74FF7E3D40}']
  320.     { Methods }
  321.     procedure onTagDiscovered(Param0: JTag); cdecl;
  322.   end;
  323.  
  324.   TJNfcAdapter_ReaderCallback = class(TJavaGenericImport<JNfcAdapter_ReaderCallbackClass, JNfcAdapter_ReaderCallback>)
  325.   end;
  326.  
  327.   JNfcAdapterClass = interface(JObjectClass)
  328.     ['{16C97862-EAB8-4A85-A481-2DBF26084379}']
  329.     { Property methods }
  330.     function _GetACTION_ADAPTER_STATE_CHANGED: JString;
  331.     function _GetACTION_NDEF_DISCOVERED: JString;
  332.     function _GetACTION_TAG_DISCOVERED: JString;
  333.     function _GetACTION_TECH_DISCOVERED: JString;
  334.     function _GetEXTRA_ADAPTER_STATE: JString;
  335.     function _GetEXTRA_ID: JString;
  336.     function _GetEXTRA_NDEF_MESSAGES: JString;
  337.     function _GetEXTRA_READER_PRESENCE_CHECK_DELAY: JString;
  338.     function _GetEXTRA_TAG: JString;
  339.     function _GetFLAG_READER_NFC_A: Integer;
  340.     function _GetFLAG_READER_NFC_B: Integer;
  341.     function _GetFLAG_READER_NFC_BARCODE: Integer;
  342.     function _GetFLAG_READER_NFC_F: Integer;
  343.     function _GetFLAG_READER_NFC_V: Integer;
  344.     function _GetFLAG_READER_NO_PLATFORM_SOUNDS: Integer;
  345.     function _GetFLAG_READER_SKIP_NDEF_CHECK: Integer;
  346.     function _GetSTATE_OFF: Integer;
  347.     function _GetSTATE_ON: Integer;
  348.     function _GetSTATE_TURNING_OFF: Integer;
  349.     function _GetSTATE_TURNING_ON: Integer;
  350.     { Methods }
  351.     function getDefaultAdapter(context: JContext): JNfcAdapter; cdecl;
  352.     { Properties }
  353.     property ACTION_ADAPTER_STATE_CHANGED: JString read _GetACTION_ADAPTER_STATE_CHANGED;
  354.     property ACTION_NDEF_DISCOVERED: JString read _GetACTION_NDEF_DISCOVERED;
  355.     property ACTION_TAG_DISCOVERED: JString read _GetACTION_TAG_DISCOVERED;
  356.     property ACTION_TECH_DISCOVERED: JString read _GetACTION_TECH_DISCOVERED;
  357.     property EXTRA_ADAPTER_STATE: JString read _GetEXTRA_ADAPTER_STATE;
  358.     property EXTRA_ID: JString read _GetEXTRA_ID;
  359.     property EXTRA_NDEF_MESSAGES: JString read _GetEXTRA_NDEF_MESSAGES;
  360.     property EXTRA_READER_PRESENCE_CHECK_DELAY: JString read _GetEXTRA_READER_PRESENCE_CHECK_DELAY;
  361.     property EXTRA_TAG: JString read _GetEXTRA_TAG;
  362.     property FLAG_READER_NFC_A: Integer read _GetFLAG_READER_NFC_A;
  363.     property FLAG_READER_NFC_B: Integer read _GetFLAG_READER_NFC_B;
  364.     property FLAG_READER_NFC_BARCODE: Integer read _GetFLAG_READER_NFC_BARCODE;
  365.     property FLAG_READER_NFC_F: Integer read _GetFLAG_READER_NFC_F;
  366.     property FLAG_READER_NFC_V: Integer read _GetFLAG_READER_NFC_V;
  367.     property FLAG_READER_NO_PLATFORM_SOUNDS: Integer read _GetFLAG_READER_NO_PLATFORM_SOUNDS;
  368.     property FLAG_READER_SKIP_NDEF_CHECK: Integer read _GetFLAG_READER_SKIP_NDEF_CHECK;
  369.     property STATE_OFF: Integer read _GetSTATE_OFF;
  370.     property STATE_ON: Integer read _GetSTATE_ON;
  371.     property STATE_TURNING_OFF: Integer read _GetSTATE_TURNING_OFF;
  372.     property STATE_TURNING_ON: Integer read _GetSTATE_TURNING_ON;
  373.   end;
  374.  
  375.   [JavaSignature('android/nfc/NfcAdapter')]
  376.   JNfcAdapter = interface(JObject)
  377.     ['{DADBBFEC-CED5-4E38-8BCD-A45F01CE3EFE}']
  378.     { Methods }
  379.     procedure disableForegroundDispatch(activity: JActivity); cdecl;
  380.     procedure disableForegroundNdefPush(activity: JActivity); cdecl; deprecated;
  381.     procedure disableReaderMode(activity: JActivity); cdecl;
  382.     procedure enableForegroundDispatch(activity: JActivity; intent: JPendingIntent; filters: TJavaObjectArray<JIntentFilter>; techLists: TJavaObjectArray<JString>); cdecl;
  383.     procedure enableForegroundNdefPush(activity: JActivity; &message: JNdefMessage); cdecl; deprecated;
  384.     procedure enableReaderMode(activity: JActivity; callback: JNfcAdapter_ReaderCallback; flags: Integer; extras: JBundle); cdecl;
  385.     function isEnabled: Boolean; cdecl;
  386.     function isNdefPushEnabled: Boolean; cdecl;
  387.     procedure setBeamPushUris(uris: TJavaObjectArray<Jnet_Uri>; activity: JActivity); cdecl;
  388.     procedure setBeamPushUrisCallback(callback: JNfcAdapter_CreateBeamUrisCallback; activity: JActivity); cdecl;
  389.     procedure setNdefPushMessage(&message: JNdefMessage; activity: JActivity; activities: TJavaObjectArray<JActivity>); cdecl;
  390.     procedure setNdefPushMessageCallback(callback: JNfcAdapter_CreateNdefMessageCallback; activity: JActivity; activities: TJavaObjectArray<JActivity>); cdecl;
  391.     procedure setOnNdefPushCompleteCallback(callback: JNfcAdapter_OnNdefPushCompleteCallback; activity: JActivity; activities: TJavaObjectArray<JActivity>); cdecl;
  392.   end;
  393.  
  394.   TJNfcAdapter = class(TJavaGenericImport<JNfcAdapterClass, JNfcAdapter>)
  395.   end;
  396.  
  397.   JNfcEventClass = interface(JObjectClass)
  398.     ['{83B91408-3117-4EC6-AC92-6D62F859ADCF}']
  399.   end;
  400.  
  401.   [JavaSignature('android/nfc/NfcEvent')]
  402.   JNfcEvent = interface(JObject)
  403.     ['{AB045C54-D04D-418B-921A-6D63C2F234A4}']
  404.     { Property methods }
  405.     function _GetnfcAdapter: JNfcAdapter;
  406.     procedure _SetnfcAdapter(Value: JNfcAdapter);
  407.     { Properties }
  408.     property nfcAdapter: JNfcAdapter read _GetnfcAdapter write _SetnfcAdapter;
  409.   end;
  410.  
  411.   TJNfcEvent = class(TJavaGenericImport<JNfcEventClass, JNfcEvent>)
  412.   end;
  413.  
  414.   JNfcManagerClass = interface(JObjectClass)
  415.     ['{7C17404C-DC8B-45BF-95F5-89BB7C8ACD7B}']
  416.   end;
  417.  
  418.   [JavaSignature('android/nfc/NfcManager')]
  419.   JNfcManager = interface(JObject)
  420.     ['{CC1C67F6-DB7C-422E-AEED-8BE978E38F82}']
  421.     { Methods }
  422.     function getDefaultAdapter: JNfcAdapter; cdecl;
  423.   end;
  424.  
  425.   TJNfcManager = class(TJavaGenericImport<JNfcManagerClass, JNfcManager>)
  426.   end;
  427.  
  428.   JTagClass = interface(JObjectClass)
  429.     ['{70D70482-9B7C-4FED-8F69-531F49E8F179}']
  430.     { Property methods }
  431.     function _GetCREATOR: JParcelable_Creator;
  432.     procedure _SetCREATOR(Value: JParcelable_Creator);
  433.     { Properties }
  434.     property CREATOR: JParcelable_Creator read _GetCREATOR write _SetCREATOR;
  435.   end;
  436.  
  437.   [JavaSignature('android/nfc/Tag')]
  438.   JTag = interface(JObject)
  439.     ['{F0137B87-18CA-4D88-A95B-0E02B5A8448C}']
  440.     { Methods }
  441.     function describeContents: Integer; cdecl;
  442.     function getId: TJavaArray<Byte>; cdecl;
  443.     function getTechList: TJavaObjectArray<JString>; cdecl;
  444.     function toString: JString; cdecl;
  445.     procedure writeToParcel(dest: JParcel; flags: Integer); cdecl;
  446.   end;
  447.  
  448.   TJTag = class(TJavaGenericImport<JTagClass, JTag>)
  449.   end;
  450.  
  451.   JTagLostExceptionClass = interface(JObjectClass)
  452.     ['{1FFE5C44-ABD4-487B-9755-0F5250B7C1F5}']
  453.     { Methods }
  454.     function init: JTagLostException; cdecl; overload;
  455.     function init(&message: JString): JTagLostException; cdecl; overload;
  456.   end;
  457.  
  458.   [JavaSignature('android/nfc/TagLostException')]
  459.   JTagLostException = interface(JObject)
  460.     ['{FD51EE40-3222-4B5F-96E5-E03C32DF270C}']
  461.   end;
  462.  
  463.   TJTagLostException = class(TJavaGenericImport<JTagLostExceptionClass, JTagLostException>)
  464.   end;
  465.  
  466.   JBasicTagTechnologyClass = interface(JObjectClass)
  467.     ['{EAB8AA93-40FD-4CD1-9D54-794094E3242E}']
  468.   end;
  469.  
  470.   [JavaSignature('android/nfc/tech/BasicTagTechnology')]
  471.   JBasicTagTechnology = interface(JObject)
  472.     ['{783BBD0E-6377-4C10-9D11-0D6F496F9180}']
  473.     { Methods }
  474.     procedure close; cdecl;
  475.     procedure connect; cdecl;
  476.     function getTag: JTag; cdecl;
  477.     function isConnected: Boolean; cdecl;
  478.   end;
  479.  
  480.   TJBasicTagTechnology = class(TJavaGenericImport<JBasicTagTechnologyClass, JBasicTagTechnology>)
  481.   end;
  482.  
  483.   JIsoDepClass = interface(JObjectClass)
  484.     ['{CFC924FE-2D4A-49A6-AB30-BAF82FEBD2A6}']
  485.     { Methods }
  486.     function get(tag: JTag): JIsoDep; cdecl;
  487.   end;
  488.  
  489.   [JavaSignature('android/nfc/tech/IsoDep')]
  490.   JIsoDep = interface(JObject)
  491.     ['{2DC3AA71-4565-4D17-99DA-9B82DB9FFD06}']
  492.     { Methods }
  493.     procedure close; cdecl;
  494.     procedure connect; cdecl;
  495.     function getHiLayerResponse: TJavaArray<Byte>; cdecl;
  496.     function getHistoricalBytes: TJavaArray<Byte>; cdecl;
  497.     function getMaxTransceiveLength: Integer; cdecl;
  498.     function getTag: JTag; cdecl;
  499.     function getTimeout: Integer; cdecl;
  500.     function isConnected: Boolean; cdecl;
  501.     function isExtendedLengthApduSupported: Boolean; cdecl;
  502.     procedure setTimeout(timeout: Integer); cdecl;
  503.     function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>; cdecl;
  504.   end;
  505.  
  506.   TJIsoDep = class(TJavaGenericImport<JIsoDepClass, JIsoDep>)
  507.   end;
  508.  
  509.   JMifareClassicClass = interface(JObjectClass)
  510.     ['{354CDE1A-A65C-43A7-A03F-11614913B0EB}']
  511.     { Property methods }
  512.     function _GetBLOCK_SIZE: Integer;
  513.     function _GetKEY_DEFAULT: TJavaArray<Byte>;
  514.     procedure _SetKEY_DEFAULT(Value: TJavaArray<Byte>);
  515.     function _GetKEY_MIFARE_APPLICATION_DIRECTORY: TJavaArray<Byte>;
  516.     procedure _SetKEY_MIFARE_APPLICATION_DIRECTORY(Value: TJavaArray<Byte>);
  517.     function _GetKEY_NFC_FORUM: TJavaArray<Byte>;
  518.     procedure _SetKEY_NFC_FORUM(Value: TJavaArray<Byte>);
  519.     function _GetSIZE_1K: Integer;
  520.     function _GetSIZE_2K: Integer;
  521.     function _GetSIZE_4K: Integer;
  522.     function _GetSIZE_MINI: Integer;
  523.     function _GetTYPE_CLASSIC: Integer;
  524.     function _GetTYPE_PLUS: Integer;
  525.     function _GetTYPE_PRO: Integer;
  526.     function _GetTYPE_UNKNOWN: Integer;
  527.     { Methods }
  528.     function get(tag: JTag): JMifareClassic; cdecl;
  529.     { Properties }
  530.     property BLOCK_SIZE: Integer read _GetBLOCK_SIZE;
  531.     property KEY_DEFAULT: TJavaArray<Byte> read _GetKEY_DEFAULT write _SetKEY_DEFAULT;
  532.     property KEY_MIFARE_APPLICATION_DIRECTORY: TJavaArray<Byte> read _GetKEY_MIFARE_APPLICATION_DIRECTORY write _SetKEY_MIFARE_APPLICATION_DIRECTORY;
  533.     property KEY_NFC_FORUM: TJavaArray<Byte> read _GetKEY_NFC_FORUM write _SetKEY_NFC_FORUM;
  534.     property SIZE_1K: Integer read _GetSIZE_1K;
  535.     property SIZE_2K: Integer read _GetSIZE_2K;
  536.     property SIZE_4K: Integer read _GetSIZE_4K;
  537.     property SIZE_MINI: Integer read _GetSIZE_MINI;
  538.     property TYPE_CLASSIC: Integer read _GetTYPE_CLASSIC;
  539.     property TYPE_PLUS: Integer read _GetTYPE_PLUS;
  540.     property TYPE_PRO: Integer read _GetTYPE_PRO;
  541.     property TYPE_UNKNOWN: Integer read _GetTYPE_UNKNOWN;
  542.   end;
  543.  
  544.   [JavaSignature('android/nfc/tech/MifareClassic')]
  545.   JMifareClassic = interface(JObject)
  546.     ['{AB88587E-A31A-4797-BF79-F178123160E3}']
  547.     { Methods }
  548.     function authenticateSectorWithKeyA(sectorIndex: Integer; key: TJavaArray<Byte>): Boolean; cdecl;
  549.     function authenticateSectorWithKeyB(sectorIndex: Integer; key: TJavaArray<Byte>): Boolean; cdecl;
  550.     function blockToSector(blockIndex: Integer): Integer; cdecl;
  551.     procedure close; cdecl;
  552.     procedure connect; cdecl;
  553.     procedure decrement(blockIndex: Integer; Value: Integer); cdecl;
  554.     function getBlockCount: Integer; cdecl;
  555.     function getBlockCountInSector(sectorIndex: Integer): Integer; cdecl;
  556.     function getMaxTransceiveLength: Integer; cdecl;
  557.     function getSectorCount: Integer; cdecl;
  558.     function getSize: Integer; cdecl;
  559.     function getTag: JTag; cdecl;
  560.     function getTimeout: Integer; cdecl;
  561.     function getType: Integer; cdecl;
  562.     procedure increment(blockIndex: Integer; Value: Integer); cdecl;
  563.     function isConnected: Boolean; cdecl;
  564.     function readBlock(blockIndex: Integer): TJavaArray<Byte>; cdecl;
  565.     procedure restore(blockIndex: Integer); cdecl;
  566.     function sectorToBlock(sectorIndex: Integer): Integer; cdecl;
  567.     procedure setTimeout(timeout: Integer); cdecl;
  568.     function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>; cdecl;
  569.     procedure transfer(blockIndex: Integer); cdecl;
  570.     procedure writeBlock(blockIndex: Integer; data: TJavaArray<Byte>); cdecl;
  571.   end;
  572.  
  573.   TJMifareClassic = class(TJavaGenericImport<JMifareClassicClass, JMifareClassic>)
  574.   end;
  575.  
  576.   JMifareUltralightClass = interface(JObjectClass)
  577.     ['{6677366A-EC35-4855-9D4A-29833A20930B}']
  578.     { Property methods }
  579.     function _GetPAGE_SIZE: Integer;
  580.     function _GetTYPE_ULTRALIGHT: Integer;
  581.     function _GetTYPE_ULTRALIGHT_C: Integer;
  582.     function _GetTYPE_UNKNOWN: Integer;
  583.     { Methods }
  584.     function get(tag: JTag): JMifareUltralight; cdecl;
  585.     { Properties }
  586.     property PAGE_SIZE: Integer read _GetPAGE_SIZE;
  587.     property TYPE_ULTRALIGHT: Integer read _GetTYPE_ULTRALIGHT;
  588.     property TYPE_ULTRALIGHT_C: Integer read _GetTYPE_ULTRALIGHT_C;
  589.     property TYPE_UNKNOWN: Integer read _GetTYPE_UNKNOWN;
  590.   end;
  591.  
  592.   [JavaSignature('android/nfc/tech/MifareUltralight')]
  593.   JMifareUltralight = interface(JObject)
  594.     ['{25C8EEF0-D566-4014-8DF8-6FF039A88DEB}']
  595.     { Methods }
  596.     procedure close; cdecl;
  597.     procedure connect; cdecl;
  598.     function getMaxTransceiveLength: Integer; cdecl;
  599.     function getTag: JTag; cdecl;
  600.     function getTimeout: Integer; cdecl;
  601.     function getType: Integer; cdecl;
  602.     function isConnected: Boolean; cdecl;
  603.     function readPages(pageOffset: Integer): TJavaArray<Byte>; cdecl;
  604.     procedure setTimeout(timeout: Integer); cdecl;
  605.     function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>; cdecl;
  606.     procedure writePage(pageOffset: Integer; data: TJavaArray<Byte>); cdecl;
  607.   end;
  608.  
  609.   TJMifareUltralight = class(TJavaGenericImport<JMifareUltralightClass, JMifareUltralight>)
  610.   end;
  611.  
  612.   JNdefClass = interface(JObjectClass)
  613.     ['{952E5F09-C924-419A-AEA0-802C8F4B018C}']
  614.     { Property methods }
  615.     function _GetMIFARE_CLASSIC: JString;
  616.     function _GetNFC_FORUM_TYPE_1: JString;
  617.     function _GetNFC_FORUM_TYPE_2: JString;
  618.     function _GetNFC_FORUM_TYPE_3: JString;
  619.     function _GetNFC_FORUM_TYPE_4: JString;
  620.     { Methods }
  621.     function get(tag: JTag): JNdef; cdecl;
  622.     { Properties }
  623.     property MIFARE_CLASSIC: JString read _GetMIFARE_CLASSIC;
  624.     property NFC_FORUM_TYPE_1: JString read _GetNFC_FORUM_TYPE_1;
  625.     property NFC_FORUM_TYPE_2: JString read _GetNFC_FORUM_TYPE_2;
  626.     property NFC_FORUM_TYPE_3: JString read _GetNFC_FORUM_TYPE_3;
  627.     property NFC_FORUM_TYPE_4: JString read _GetNFC_FORUM_TYPE_4;
  628.   end;
  629.  
  630.   [JavaSignature('android/nfc/tech/Ndef')]
  631.   JNdef = interface(JObject)
  632.     ['{07CB3172-9D1B-48BE-A9A6-01884C306109}']
  633.     { Methods }
  634.     function canMakeReadOnly: Boolean; cdecl;
  635.     procedure close; cdecl;
  636.     procedure connect; cdecl;
  637.     function getCachedNdefMessage: JNdefMessage; cdecl;
  638.     function getMaxSize: Integer; cdecl;
  639.     function getNdefMessage: JNdefMessage; cdecl;
  640.     function getTag: JTag; cdecl;
  641.     function getType: JString; cdecl;
  642.     function isConnected: Boolean; cdecl;
  643.     function isWritable: Boolean; cdecl;
  644.     function makeReadOnly: Boolean; cdecl;
  645.     procedure writeNdefMessage(msg: JNdefMessage); cdecl;
  646.   end;
  647.  
  648.   TJNdef = class(TJavaGenericImport<JNdefClass, JNdef>)
  649.   end;
  650.  
  651.   JNdefFormatableClass = interface(JObjectClass)
  652.     ['{FD2507AE-8201-4056-9603-01834A2E375D}']
  653.     { Methods }
  654.     function get(tag: JTag): JNdefFormatable; cdecl;
  655.   end;
  656.  
  657.   [JavaSignature('android/nfc/tech/NdefFormatable')]
  658.   JNdefFormatable = interface(JObject)
  659.     ['{08C293E6-9130-457A-BE7D-0EFCCB5AB8AF}']
  660.     { Methods }
  661.     procedure close; cdecl;
  662.     procedure connect; cdecl;
  663.     procedure format(firstMessage: JNdefMessage); cdecl;
  664.     procedure formatReadOnly(firstMessage: JNdefMessage); cdecl;
  665.     function getTag: JTag; cdecl;
  666.     function isConnected: Boolean; cdecl;
  667.   end;
  668.  
  669.   TJNdefFormatable = class(TJavaGenericImport<JNdefFormatableClass, JNdefFormatable>)
  670.   end;
  671.  
  672.   JNfcAClass = interface(JObjectClass)
  673.     ['{C7CC1347-7CCB-4ED5-9A2C-1D82FA20AD1B}']
  674.     { Methods }
  675.     function get(tag: JTag): JNfcA; cdecl;
  676.   end;
  677.  
  678.   [JavaSignature('android/nfc/tech/NfcA')]
  679.   JNfcA = interface(JObject)
  680.     ['{6EAD7DA0-95A6-4230-B33E-FDDF98D80ACD}']
  681.     { Methods }
  682.     procedure close; cdecl;
  683.     procedure connect; cdecl;
  684.     function getAtqa: TJavaArray<Byte>; cdecl;
  685.     function getMaxTransceiveLength: Integer; cdecl;
  686.     function getSak: SmallInt; cdecl;
  687.     function getTag: JTag; cdecl;
  688.     function getTimeout: Integer; cdecl;
  689.     function isConnected: Boolean; cdecl;
  690.     procedure setTimeout(timeout: Integer); cdecl;
  691.     function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>; cdecl;
  692.   end;
  693.  
  694.   TJNfcA = class(TJavaGenericImport<JNfcAClass, JNfcA>)
  695.   end;
  696.  
  697.   JNfcBClass = interface(JObjectClass)
  698.     ['{3AA0A259-27DC-4442-BA25-B5C44DE8FC1D}']
  699.     { Methods }
  700.     function get(tag: JTag): JNfcB; cdecl;
  701.   end;
  702.  
  703.   [JavaSignature('android/nfc/tech/NfcB')]
  704.   JNfcB = interface(JObject)
  705.     ['{ECEFD061-2CE5-4B51-AC25-C98A28C79FB5}']
  706.     { Methods }
  707.     procedure close; cdecl;
  708.     procedure connect; cdecl;
  709.     function getApplicationData: TJavaArray<Byte>; cdecl;
  710.     function getMaxTransceiveLength: Integer; cdecl;
  711.     function getProtocolInfo: TJavaArray<Byte>; cdecl;
  712.     function getTag: JTag; cdecl;
  713.     function isConnected: Boolean; cdecl;
  714.     function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>; cdecl;
  715.   end;
  716.  
  717.   TJNfcB = class(TJavaGenericImport<JNfcBClass, JNfcB>)
  718.   end;
  719.  
  720.   JNfcBarcodeClass = interface(JObjectClass)
  721.     ['{969DCC14-1526-486B-A41B-3E7DC426DB36}']
  722.     { Property methods }
  723.     function _GetTYPE_KOVIO: Integer;
  724.     function _GetTYPE_UNKNOWN: Integer;
  725.     { Methods }
  726.     function get(tag: JTag): JNfcBarcode; cdecl;
  727.     { Properties }
  728.     property TYPE_KOVIO: Integer read _GetTYPE_KOVIO;
  729.     property TYPE_UNKNOWN: Integer read _GetTYPE_UNKNOWN;
  730.   end;
  731.  
  732.   [JavaSignature('android/nfc/tech/NfcBarcode')]
  733.   JNfcBarcode = interface(JObject)
  734.     ['{0E0D7BC3-EE8B-4E84-A497-E42FEE88A6F4}']
  735.     { Methods }
  736.     procedure close; cdecl;
  737.     procedure connect; cdecl;
  738.     function getBarcode: TJavaArray<Byte>; cdecl;
  739.     function getTag: JTag; cdecl;
  740.     function getType: Integer; cdecl;
  741.     function isConnected: Boolean; cdecl;
  742.   end;
  743.  
  744.   TJNfcBarcode = class(TJavaGenericImport<JNfcBarcodeClass, JNfcBarcode>)
  745.   end;
  746.  
  747.   JNfcFClass = interface(JObjectClass)
  748.     ['{A61ADBBC-6687-442F-9005-48CFBAA1D3BF}']
  749.     { Methods }
  750.     function get(tag: JTag): JNfcF; cdecl;
  751.   end;
  752.  
  753.   [JavaSignature('android/nfc/tech/NfcF')]
  754.   JNfcF = interface(JObject)
  755.     ['{76433696-EF45-4D38-A3C2-15C5B9D6817D}']
  756.     { Methods }
  757.     procedure close; cdecl;
  758.     procedure connect; cdecl;
  759.     function getManufacturer: TJavaArray<Byte>; cdecl;
  760.     function getMaxTransceiveLength: Integer; cdecl;
  761.     function getSystemCode: TJavaArray<Byte>; cdecl;
  762.     function getTag: JTag; cdecl;
  763.     function getTimeout: Integer; cdecl;
  764.     function isConnected: Boolean; cdecl;
  765.     procedure setTimeout(timeout: Integer); cdecl;
  766.     function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>; cdecl;
  767.   end;
  768.  
  769.   TJNfcF = class(TJavaGenericImport<JNfcFClass, JNfcF>)
  770.   end;
  771.  
  772.   JNfcVClass = interface(JObjectClass)
  773.     ['{30E78EF3-BA54-43EA-A30B-E7DB2F13F635}']
  774.     { Methods }
  775.     function get(tag: JTag): JNfcV; cdecl;
  776.   end;
  777.  
  778.   [JavaSignature('android/nfc/tech/NfcV')]
  779.   JNfcV = interface(JObject)
  780.     ['{79448CB5-93BC-49D4-8424-B1CEE62FA71F}']
  781.     { Methods }
  782.     procedure close; cdecl;
  783.     procedure connect; cdecl;
  784.     function getDsfId: Byte; cdecl;
  785.     function getMaxTransceiveLength: Integer; cdecl;
  786.     function getResponseFlags: Byte; cdecl;
  787.     function getTag: JTag; cdecl;
  788.     function isConnected: Boolean; cdecl;
  789.     function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>; cdecl;
  790.   end;
  791.  
  792.   TJNfcV = class(TJavaGenericImport<JNfcVClass, JNfcV>)
  793.   end;
  794.  
  795.   JTagTechnologyClass = interface(IJavaClass)
  796.     ['{3C1A028A-02C0-4AEC-9EAC-5CFA949C5ACF}']
  797.   end;
  798.  
  799.   [JavaSignature('android/nfc/tech/TagTechnology')]
  800.   JTagTechnology = interface(IJavaInstance)
  801.     ['{C191C90F-0D45-468B-8DFC-463313DFA51D}']
  802.     { Methods }
  803.     procedure close; cdecl;
  804.     procedure connect; cdecl;
  805.     function getTag: JTag; cdecl;
  806.     function isConnected: Boolean; cdecl;
  807.   end;
  808.  
  809.   TJTagTechnology = class(TJavaGenericImport<JTagTechnologyClass, JTagTechnology>)
  810.   end;
  811.  
  812. const
  813.   TJCardEmulation_ACTION_CHANGE_DEFAULT = 'android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT';
  814.   TJCardEmulation_CATEGORY_OTHER = 'other';
  815.   TJCardEmulation_CATEGORY_PAYMENT = 'payment';
  816.   TJCardEmulation_EXTRA_CATEGORY = 'category';
  817.   TJCardEmulation_EXTRA_SERVICE_COMPONENT = 'component';
  818.   TJCardEmulation_SELECTION_MODE_ALWAYS_ASK = 1;
  819.   TJCardEmulation_SELECTION_MODE_ASK_IF_CONFLICT = 2;
  820.   TJCardEmulation_SELECTION_MODE_PREFER_DEFAULT = 0;
  821.  
  822.   TJHostApduService_DEACTIVATION_DESELECTED = 1;
  823.   TJHostApduService_DEACTIVATION_LINK_LOSS = 0;
  824.   TJHostApduService_SERVICE_INTERFACE = 'android.nfc.cardemulation.action.HOST_APDU_SERVICE';
  825.   TJHostApduService_SERVICE_META_DATA = 'android.nfc.cardemulation.host_apdu_service';
  826.  
  827.   TJOffHostApduService_SERVICE_INTERFACE = 'android.nfc.cardemulation.action.OFF_HOST_APDU_SERVICE';
  828.   TJOffHostApduService_SERVICE_META_DATA = 'android.nfc.cardemulation.off_host_apdu_service';
  829.  
  830.   TJNdefRecord_TNF_ABSOLUTE_URI = 3;
  831.   TJNdefRecord_TNF_EMPTY = 0;
  832.   TJNdefRecord_TNF_EXTERNAL_TYPE = 4;
  833.   TJNdefRecord_TNF_MIME_MEDIA = 2;
  834.   TJNdefRecord_TNF_UNCHANGED = 6;
  835.   TJNdefRecord_TNF_UNKNOWN = 5;
  836.   TJNdefRecord_TNF_WELL_KNOWN = 1;
  837.  
  838.   TJNfcAdapter_ACTION_ADAPTER_STATE_CHANGED = 'android.nfc.action.ADAPTER_STATE_CHANGED';
  839.   TJNfcAdapter_ACTION_NDEF_DISCOVERED = 'android.nfc.action.NDEF_DISCOVERED';
  840.   TJNfcAdapter_ACTION_TAG_DISCOVERED = 'android.nfc.action.TAG_DISCOVERED';
  841.   TJNfcAdapter_ACTION_TECH_DISCOVERED = 'android.nfc.action.TECH_DISCOVERED';
  842.   TJNfcAdapter_EXTRA_ADAPTER_STATE = 'android.nfc.extra.ADAPTER_STATE';
  843.   TJNfcAdapter_EXTRA_ID = 'android.nfc.extra.ID';
  844.   TJNfcAdapter_EXTRA_NDEF_MESSAGES = 'android.nfc.extra.NDEF_MESSAGES';
  845.   TJNfcAdapter_EXTRA_READER_PRESENCE_CHECK_DELAY = 'presence';
  846.   TJNfcAdapter_EXTRA_TAG = 'android.nfc.extra.TAG';
  847.   TJNfcAdapter_FLAG_READER_NFC_A = 1;
  848.   TJNfcAdapter_FLAG_READER_NFC_B = 2;
  849.   TJNfcAdapter_FLAG_READER_NFC_BARCODE = 16;
  850.   TJNfcAdapter_FLAG_READER_NFC_F = 4;
  851.   TJNfcAdapter_FLAG_READER_NFC_V = 8;
  852.   TJNfcAdapter_FLAG_READER_NO_PLATFORM_SOUNDS = 256;
  853.   TJNfcAdapter_FLAG_READER_SKIP_NDEF_CHECK = 128;
  854.   TJNfcAdapter_STATE_OFF = 1;
  855.   TJNfcAdapter_STATE_ON = 3;
  856.   TJNfcAdapter_STATE_TURNING_OFF = 4;
  857.   TJNfcAdapter_STATE_TURNING_ON = 2;
  858.  
  859.   TJMifareClassic_BLOCK_SIZE = 16;
  860.   TJMifareClassic_SIZE_1K = 1024;
  861.   TJMifareClassic_SIZE_2K = 2048;
  862.   TJMifareClassic_SIZE_4K = 4096;
  863.   TJMifareClassic_SIZE_MINI = 320;
  864.   TJMifareClassic_TYPE_CLASSIC = 0;
  865.   TJMifareClassic_TYPE_PLUS = 1;
  866.   TJMifareClassic_TYPE_PRO = 2;
  867.   TJMifareClassic_TYPE_UNKNOWN = -1;
  868.  
  869.   TJMifareUltralight_PAGE_SIZE = 4;
  870.   TJMifareUltralight_TYPE_ULTRALIGHT = 1;
  871.   TJMifareUltralight_TYPE_ULTRALIGHT_C = 2;
  872.   TJMifareUltralight_TYPE_UNKNOWN = -1;
  873.  
  874.   TJNdef_MIFARE_CLASSIC = 'com.nxp.ndef.mifareclassic';
  875.   TJNdef_NFC_FORUM_TYPE_1 = 'org.nfcforum.ndef.type1';
  876.   TJNdef_NFC_FORUM_TYPE_2 = 'org.nfcforum.ndef.type2';
  877.   TJNdef_NFC_FORUM_TYPE_3 = 'org.nfcforum.ndef.type3';
  878.   TJNdef_NFC_FORUM_TYPE_4 = 'org.nfcforum.ndef.type4';
  879.  
  880.   TJNfcBarcode_TYPE_KOVIO = 1;
  881.   TJNfcBarcode_TYPE_UNKNOWN = -1;
  882.  
  883. implementation
  884.  
  885. end.

by admin at September 11, 2014 09:22 PM

Žarko Gajić

Fun: Refactoring a Complex Delphi Boolean Function

tfRefactoring your own code is, what I guess, something that you do frequently – at least I am. Maybe a better description of the process I went through would be rewriting, but let’s stick with refactoring. Either the routines get too complex, or there’s an extra parameter needed or there’s some new special case to be handled, never mind the reason, refactoring of your own code is what we all do and should do.

I will not go here into explaining various reasons (and solutions) why and how you would want to rewrite your own functions (maybe originally coded years ago). There are plenty of possible scenarios/solutions: extract some piece of code into a separate routine, optimize sections, replace records with objects (or the opposite), introduce new language constructs and so on.

A few days ago I’ve placed my hands over a Delphi application coded years ago. My task was to extend one function with some special processing. The actual function already had some 2000 (two thousand) lines of code. There were a couple of nested subroutines including more nested subroutines. There were some 20 (twenty) input parameters.

As you might imagine: a mess!

But, a task is a task and one has to finish what was started. After a few hours (read: days) I’ve successfully refactored the entire function (introduced function overloads, removed duplicated code, normal optimization stuff…)

However, and to be honest, my first reaction was “heck, I guess the fastest would be to rewrite the entire function in the following, much simpler manner (code below). After all, a boolean function would either return a false or a true value – only 2 possible outcomes of the 2000 lines of code!

And here’s what my first (virtual) solution was:

function Refactored(const someInputParameters : integer): boolean;
const
  returnValue : array [0..1] of boolean = (false, true);
begin
  result := returnValue[GetTickCount MOD 2];
end;

From the first look, the above implementation of a boolean function is as good as any. After all, it would return either true or false, there’s no 3rd option with booleans :)

You? Had a similar moment?

by zarkogajic at September 11, 2014 11:00 AM

The Wiert Corner - irregular stream of stuff

jpluimers

For a breaking issue, there has been an important bug fix to Coninua CI. From the downloads page:

From the change log:

v1.5.0.278

September 11th, 2014

  • Download Continua CI (64 bit)
  • Download Continua CI (32 bit)
  • Download Agent Installer (64 bit)
  • Download Agent Installer (32 bit)

Changes

  • Fix: A breaking issue with the repository cache in Git and possibly other branch-aware repositories was introduced the last build to fix issue with Subversion branches. This has now been fixed.
  • Update: Cancelling a stage promotion will now cause the build finish time to be set to the finish time of the last stage run.

–jeroen

via: Version 1.5 History | Continua CI.

PS: I also updated Continua CI Version 1.5 has been released build 1.5.0.268; smaller, faster, loads of new features; Spring4D XE7 builds automated with the new links.


Filed under: .NET, Continua CI, Continuous Integration, Delphi, Development, DVCS - Distributed Version Control, git, Mercurial/Hg, Software Development, Subversion/SVN

by jpluimers at September 11, 2014 05:30 AM

jpluimers

Reminder to Self: write Eurekalog article about finding cause for hard to catch Access Violations in Delphi

–jeroen

via: web services – Access Violation (Delphi) – except the first run – Stack Overflow.


Filed under: Delphi, Development, Software Development

by jpluimers at September 11, 2014 05:00 AM

September 10, 2014

Firebird News

A new theme for FirebirdNews?

I think it is time for updating the WordPress’s theme used in FirebirdNews. The actual theme is based in the Firefox theme (old and no more maintained) and doesn’t support well some of the new features available in the most recent versions of WordPress. WordPress has thousands of themes, and choosing the right one is a difficult task, […]

by Cantu at September 10, 2014 07:29 PM