A question on the Xojo Forum got me thinking that it may not be obvious how to avoid having to reach inside another window (or dialog etc.) to access its controls to get and set values. I’m sure we all have done this at one time or another but it really is something you should avoid. Here’s a small app to demo how to make an API instead:
Comments closedTag: API
2017’s first “What is Xojo?” webinar was well received and there were lots of questions. Rather than include the questions in the video, I’ve included a…
Comments closedIn this Xojo tutorial we will see how simple it is to make an iOS App that shortens an entered URL using the public API of Bit.ly. We will use our own subclass inherited from Xojo.Net.HTTPSocket, and the Declare statement in order to use some functions and methods found on the native Cocoa Touch API. In fact, the use of Declare is mandatory because with the new Xojo Framewok we don’t yet have access to the EncodeURLComponent function available with the old framework. This one is a big help in substituting any ilegal character with his hexadecimal value for the final URL’s composition.
Comments closedWhile Xojo doesn’t currently provide a direct way of recursively deleting a folder, there are various options that will allow you to do this:
1. Recursively iterate through all the folders, deleting each one. You can read about that at our Developer Site, this is the best cross-platform way.
2. Use the Shell to recursively delete a folder (i.e. “del /s” on Windows, or “rm -rf” on OS X and Linux)
Windows specific ways:
3. SHFileOperation (an older API)
4. IFileOperation (the more modern API that Windows recommends over option #3)
I’ve decided to look at option #4, since this allows more customized options, like the ability to show a progress dialog. However, it is also the slightly more complicated option since it deals with COM & Delegates. The example illustrates this:
Comments closedIf you work in the technologiy industry, I’m sure you’ve heard of the Daily WTF site. Their fun stories about technology gone wrong makes it one of my favorite web sites.
Comments closedWhat is Slackbot?
Slack has an API called “slash commands” that lets a user type a slash (/) followed by a command name in order to perform a special action. For example, Slack has many built-in slash commands, one example is /help. Here’s how you can easily add your own slash commands using a Xojo web app and the HandleSpecialURL (or HandleURL) method.
Your slash command makes an HTTP request to your Xojo web service app. The web services does its thing and then returns the result back to Slack to display.
Comments closed
At Xojo, we work with a lot of HTTP REST APIs. So many in fact that I’ve spent time creating custom test harnesses to make sure that whatever I was currently coding would be compatible as well as being a test suite just in case the API changed in some subtle way (whether it be a bug fix or an API refactor gone awry). The problem with the custom test harnesses is that they’re not very portable and you end up having to create a new one for each API that you interface with.
Comments closedSlack is a new business communication tool that is taking the world by storm. Here’s how you can use it with your Xojo apps.
Comments closedOn the Internet, everyone loves cats. Using HTTPSocket and The Cat REST API, Xojo makes it easy for you to get the cat pictures you need to brighten your day. Read on to learn how to make everyday Caturday…and for more cat puns.
Comments closedThis post was updated in March 2023 in Testing REST-based Web Services.
Communicating with web services is fun and easy with Xojo. But sometimes it’s not so easy to test the actual REST API calls. As part of preparing materials for the HTTPSocket webinar, I created a simple app in Xojo that lets you test REST APIs. I call it RESTy.
Comments closed