DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: tino0914
今日帖子: 27
在线用户: 20
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2019/12/7 10:46:23
标题:
Delphi Android 64-bit Support in RAD Studio 10.3.3 by Marco Cantu 浏览:1173
加入我的收藏
楼主: Delphi Android 64-bit Support in RAD Studio 10.3.3
Marco Cantu
22/11/2019

The main feature of just released RAD Studio 10.3.3 is the Delphi language support for the Android 64-bit platform.

Android 64-bit Delphi Support
The platform support is provided via a new Delphi compiler for the Android 64-bit platform, based on the LLVM compiler infrastructure like the Android 32-bit counterpart (and the iOS compilers). This compiler still uses ARC memory model, to reduce migration effort to 64-bit that Google requires for store submissions. The IDE offers the ability to add the new platform to an existing project, compile and debug, and deploy to the store (more on this later).

按此在新窗口浏览图片

All of the libraries we support on Android are available, from RTL to FireMonkey, form database access with FireDAC to Parallel Programming Library, so your code should migrate fairly smoothly. There is also support for InterBase 2020 (just released) on Android 64-bit.

Android 64-Bit Caveats
There are a few hurdles to consider when you start building Android 64-bit applications The biggest issue is that about 50% of Android devices out there have a 32-bit CPU, or they have 64-bit CPU but run a 32-bit version of the OS, and therefore cannot run 64-bit Android applications.

If you want to verify your Android device CPU can run 64-bit apps one option is to use existing apps on the Play Store, like the following:

AIDA64 (check the information in the CPU page) https://play.google.com/store/apps/details?id=com.finalwire.aida64
CPU-Z (check the System page)  https://play.google.com/store/apps/details?id=com.cpuid.cpu_z

If it indicates your CPU has 64-bit ARMv8-A instruction set, but it is set in 32-bit mode, it implies the Android version is not 64-bit. In case of a mismatch, at the moment you’ll get a specific error message when running a 64-bit APK, but a not-co-clear error message when you try to debug.

Notice also that adding new 64-bit platform doesn’t automatically add all deployment files and additional Java libraries, these might needs some fine tuning as part of the project migration. You can also consider creating a new project file (dproj) from scratch with all the correct defaults.

64-Bit Code Migration is Generally Smooth
In most cases, your Delphi code will just recompile on 64-bit platforms, and you can a larger address space -- one you'd likely never use on your phone.

What is different in practice is that pointers, object references, string references and any other data type referring to a memory location becomes a 64-bit, 8 bytes pointer. This also implies that SizeOf (Integer) is now different from SizeOf (Pointer). In fact, Integers remain 4 bytes while the NativeInt type depends on the platform (4 or 8 bytes on 32-bit and 64-bit, respectively).

If you are doing any pointer math or have code that depends on data structure alignment, you might have to change it. And the same if you are type casting Integers to pointers. If you are doing low level calls to native libraries, you might also need to adjust the code.

Android App Bundle Support
The other relevant feature that Delphi 10.3.3 is introducing for Android developers is the support for the AAB format (Android App Bundle). This is a deployment file format capable of bundling both 32 and 64 binaries and files, aimed to store submission -- you cannot install a bundle on your phone directly. Similarly to Apple Universal format, once you upload a bundle the end user downloading via the Play Store will just receives the proper files for the specific device (and its bitness).
https://developer.android.com/platform/technology/app-bundle


To enable App Bundle support you can use the matching compiler option for the 64-bit Android target:

按此在新窗口浏览图片

You'll also need to provide proper provisioning information and you can generate from the IDE the .aab file to upload to Google Play Store.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行2417.969毫秒 RSS