android - 如何创建 Delphi Android 应用程序 APK 以包含文件

标签 android delphi

如何在 Android 应用程序 APK 文件中包含文件和/或包含文件的文件夹。 Delphi 运行过程删除 Assets 目录的内容,我放置在那里的文件/文件夹不包含在 APK 包中。我假设您必须手动将 System.StartupCopy 添加到您的 .DRP 单元以将文件和/或文件夹复制到 TPath.GetDocumentsPath() 指定的路径。

最佳答案

使用Project->Deployment 主菜单项,它允许您将文件放入安装中并在安装后指定它们的位置。请参阅 Android Mobile Application Development 中的部署您的最终 Android 应用程序文档中的主题。

点击一下即可到达 Preparing an Android Application for Deployment ,其中包含有关配置部署应用程序选项的分步列表:

You must configure several options for your Android app before you build the application for distribution. The properties that you configure are bundled with your application, in the AndroidManifest.xml file. You cannot modify these properties after you build and sign your application. Because these properties provide key information about your application, you should ensure that they contain the correct values before you deploy your application, or you might have to rebuild your application in order to change the configured values.

Before each release of your Android application, you should check that every setting is properly configured.

To configure your Android app:

  • On the Project > Options > Application page, provide the icons and images to represent your application.
  • On the Project > Options > Version Info page, increase the version code of your application. Application stores such as Google Play may require that newer versions of your application always have a higher version code than previous versions.
  • On the Project > Options > Uses Permissions page, define the permissions that your application requires to work.
  • On the Project > Options > Provisioning page, select in Target the build configuration that you want to use to deploy your application (for example, Release) and provide a KeyStore file if you have not already created one. This step is necessary in order to install your application in a device that has USB debugging disabled and to distribute your application to others. For more information about keystore files, see: http://docs.oracle.com/javase/1.5.0/docs/api/java/security/KeyStore.html.

还有一个部分是关于为版本号和名称、所需权限等自定义 AndroidManifest.xml 文件。

关于android - 如何创建 Delphi Android 应用程序 APK 以包含文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20150121/

相关文章:

delphi - 在 Delphi XE2 中开发 Mac 或 iOS 应用程序需要哪些硬件/软件?

java - XStream 在 Android 上抛出异常 "no-args constructor"

java - 如何打开 Android 设备的 GPS 设置?

Android Wear 表盘 StatusBar Gravity Bottom 不受尊重

delphi - 为什么我的控件不接受键盘输入?

delphi - 回复 Indy 10 中的地址?

delphi - URLOpenBlockingStream 给出相同的页面

delphi - Delphi 窗体启动时如何进行操作

android - 从动态数据表 flutter 中获取选定的行索引

java - 按名称获取 ArrayList<NameValuePair> 值