问题标签 [delphi-xe4]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1949 浏览

ios - How do I get an Indy HTTP Server in Delphi to receive connections in an iOS application?

I am writing a multi-platform application that is a sort of 'proxy', designed to field HTTP requests and pass some of them to a remote server and respond to others directly. So it acts as both an HTTP client and an HTTP server.

I have been using the Indy 10 components in both Delphi and Lazarus, and they work well on desktop platforms. I have ported the project successfully to Windows, Linux, and MacOS using Lazarus. Now I am attempting to do the same to iOS, using Delphi XE4. I am currently running the project in the iOS Simulator on a Mac running OSX 10.8.2; later I will be targeting an iPad device.

But I'm finding that I can't get the TIdHTTPServer component to create a connection to an incoming request on iOS. I bind the server to an IP address and port and activate it; this starts the listener thread. But when I try to send a GET request to the server it raises the exception EIdIPVersionUnsupported, with the message "The requested IPVersion / Address family is not supported." This error happens whether I try to route the GET request from within the application itself, or externally from a browser running on another machine.

I normally bind the HTTP Server to the localhost IP address, as the proxy is intended to run as a background process fielding requests from the browser running in the foreground. For the external browser test, I bound it instead to the Mac's own IP address.

0 投票
1 回答
2562 浏览

ios - 在 ios 应用程序中打开 URL

我需要在我的 iOS 应用程序中打开一个带有 safari 的网页。
XE2 有iphoneall单元,它暴露了UIApplication。XE4 不再使用 FPC,所以我不能使用它。
Embarcadero 文档 说我只能将 SDK 与 C++ 或使用 delphi 接口一起使用(而且,macapi 仅适用于 OSX,而​​不适用于 iOS)。所以,UIKit框架好像没有接口?!
我尝试的另一个解决方案是:

但这根本没有影响!
有没有其他方法可以打开网址,或者我运气不好?
我知道 ios 有 TWebBrowser 组件,但我不想走这条路只是为了显示一个网页。

0 投票
2 回答
2465 浏览

ios - 打开 pdf 文件时,TwebBrowser Zoom/Gesture 不适用于 XE4 中的 firemonkey/iOs

我想在 iOS 应用程序中显示 PDF,到目前为止,我发现的唯一方法是在 TwebBrowser 中打开它。

A.默认显示为“适合页面宽度”缩放

B.没有“缩放”功能

WebBrowser1.Navigate(file://mypdf.pdf')

如何

  1. 我想在打开文件后更改缩放(我的解决方案遇到q#2)
  2. 使缩放工作(我的解决方案遇到 q#3)
  3. 使手势像网页一样工作

对于#1:

我在运行时更改 WebBrowser1.height/width,它会自动缩放(缩放?)为“适合宽度”。

是的,它可以工作,垂直滚动条有一个缺陷-它不会在边缘反弹->您可以一直向下滚动..

水平滚动都没有,完全没有反应......

*这是因为 pdf 是 A4,不知道横向样式会发生什么

对于#2:

除了使用按钮单击来缩放之外,我还添加了一个手势管理器。

然后像“iOS 交互式手势 - 图像缩放”示例一样添加 Form1.ongesture。

是的,它有效,但同样的事情 - 没有垂直反弹,没有水平滚动。

*ScrollBox 不起作用,它不适用于任何具有内置 vert/hori 滚动条的东西

对于#3:我走得更远,写上/下/左/右的控制

更改 WebBrowser1.Position.X/Y 和 WebBrowser1.height/width 使其看起来像“滚动”

是的,它可以工作......但是两个自定义手势控制让它真的很难控制

(EventInfo.Distance 和 EventInfo.X/Y,如果你在 iPhone 上运行,这两个控件有点重叠)

最重要的是,WebBrowser1 将位于任何补偿之上,无论父/子结构。第二个最糟糕的部分是边距的限制很难编码,不知何故它总是可以滚动超过限制......

如果打开/打开后更改缩放,我会“感觉”,并使其打开时两个垂直/水平滚动条都可见。然后水平条应该可以工作->我只需要处理缩放->非常接近完美。

当然最好的方法是让它像网页一样工作,比如 WebBrowser1.Navigate(' http://www.embarcadero.com/ ') -> 两个滚动条都有效,缩放有效。但是...也许需要Service Pack N?

我感谢任何想法或代码答案。

这只该死的猴子着火了,总是很难从中找到答案。

0 投票
1 回答
400 浏览

ios - XE4 获取总磁盘大小

有人可以指出或帮助我使用 Delphi XE4 获取 IPHONE/IPAD 设备总磁盘大小。

我只需要一个起点,我尝试使用:

但它没有参考。

谢谢你

0 投票
1 回答
996 浏览

delphi - 如果我收到“不是有效的 win32 应用程序”错误,如何在 Delphi XE4 中从源代码安装我自己的 Indy10 副本?

使用来自 subversion 的最新 Indy10 源,安装到 Delphi XE4,当我尝试安装“dclIndyProtocols180.bpl”时出现此错误:

有问题的 BPI\Win32\Debug 文件夹包含以下文件:

我该如何解决或解决这个问题?我对 Indy 或 Delphi 并不完全陌生,但是每次发布新的 delphi 版本时,对于我们这些更喜欢从源代码构建并跟踪颠覆而不是使用随Delphi XE4 安装程序。

作为一个普遍的附带问题:与 Embarcadero 在其产品中发布的任何内容相比,是否有任何地方记录或记录了 Indy 项目的颠覆代码的状态?

0 投票
1 回答
519 浏览

ios - Delphi xe4 - 如何通过 HTTP 访问 Foursquare API

我有 delphi xe4,我需要知道如何通过 HTTP 访问 Foursquare API,例如 https://api.foursquare.com/v2/venues/explore?ll=-23,-47&venuePhotos=1§ion=food&client_id=Xxxxxxxxxx&client_secret=yyyyyyyyy&v= 20120321

到 Firemonkey 移动 IOS

0 投票
0 回答
901 浏览

delphi - XE4 iOS 应用程序:部署到 iOS 设备失败

我想在我的 iPhone 上测试我的第一个应用程序,而不仅仅是在模拟器上。Xcode 和 paserver 正在运行。所有许可证的东西都完成了。如果我在 Delphi XE4 中选择“My-iOS-Device”作为目标平台并按“运行”,我会收到以下错误:

[DCC Fehler] E2597 ld:找不到 -lcompiler_rt 的库

[DCC Fataler Fehler] F2588 Linker-Fehlercode: 1 ($00000001)

我不知道这个错误是什么意思。我的 PC 通过以太网连接到我的 iMac。部署到模拟器没有问题。如果我切断与 iMac 的所有连接,我会收到同样的错误。你有什么想法?

0 投票
1 回答
518 浏览

delphi - 如何在最新的 Delphi 中使用本机调用在 iOS 上进行 HTTPS/POST?

Delphi 的最新版本 XE4 允许构建 iOS 应用程序。新闻组上有一些关于使用原生 iOS 库进行 HTTPS/发布以避免 OpenSSL 库和 Indy 10 问题的讨论。使用原生库执行 HTTP 发布的推荐方法是什么?(在我的示例中,JSON 文档上传和响应。)

0 投票
1 回答
1811 浏览

ios - iOS 上的 XE4 Firemonkey 阻止睡眠模式

我正在为 iOS 开发一个 Firemonkey XE4 应用程序,并且需要在没有用户输入时防止设备进入睡眠状态。我找到了这个用于 xcode 开发的命令:

[应用程序 setIdleTimerDisabled:YES];

我想在 FMX 中有一个等价物?

有人可以帮忙吗?

谢谢

达里尔

0 投票
4 回答
14385 浏览

delphi - Delphi Unicode 字符串长度(以字节为单位)

我正在将一些 Delphi 7 代码移植到 XE4,因此,unicode 是这里的主题。

我有一个将字符串写入 TMemoryStream 的方法,因此根据这篇 embarcadero 文章,我应该将字符串的长度(以字符为单位)乘以 Char 类型的大小,以获得所需的字节长度WriteBuffer 的长度(以字节为单位)参数。

所以之前:

后:

我对 Delphi 的 UnicodeString 类型的理解是它内部是 UTF-16。但我对 Unicode 的一般理解是,并非所有 Unicode 字符都可以用 2 个字节表示,一些极端情况的外来字符将占用 4 个字节。embarcadero 的另一篇文章似乎证实了我的怀疑,“事实上,一个 Char 等于两个字节甚至并不总是正确的!”

所以......这让我想知道是否Length(rawHtml)* SizeOf(Char)真的足够强大以保持一致准确,或者是否有更好的方法来确定更准确的字符串大小?