【问题标题】:How can I create directory path and put my files in it while installing apk?安装apk时如何创建目录路径并将文件放入其中?
【发布时间】:2011-11-21 01:31:31
【问题描述】:

如何在安装 APK 时创建目录路径并将文件放入其中? (在安装 apk 时;而不是在运行程序时)。

【问题讨论】:

  • 在您的应用程序启动之前,您不能做这样的事情。
  • 在安装 apk 时,您希望将什么类型的文件放入所需目录?
  • 我在文件夹中有 600 个 html 文件,我想将文件夹放在外部 sd 中

标签: android path directory apk installation


【解决方案1】:

在安装应用程序时无法进行更改。它唯一发生的事情是您在应用程序运行时执行此操作。

对于在外部存储上安装 apk,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"    android:installLocation="preferExternal"    ... >

记住这些,

When your application is installed on the external storage:

1.There is no effect on the application performance so long as the external storage is
mounted on the device. 


2.The .apk file is saved on the external storage, but all private user data, databases,
optimized .dex files, and extracted native code are saved on the internal device
memory. 

3.The unique container in which your application is stored is encrypted with a randomly
generated key that can be decrypted only by the device that originally installed it.
Thus, an application installed on an SD card works for only one device. 


4.The user can move your application to the internal storage through the system
settings.

Warning: When the user enables USB mass storage to share files with a computer or
unmounts the SD card via the system settings, the external storage is unmounted from
the device and all applications running on the external storage are immediately killed.

【讨论】:

  • 怎么样?我看到在外部 sd 上创建文件夹并将在程序中使用的数据文件放在文件夹中的程序我可以在安装 apk 之后和运行程序之前看到该文件夹​​
  • 有些应用程序在清单文件上设置了一个变量,以便安装在外部存储上,然后这个应用程序将它们的所有文件或文件夹提取到 sdcard 上,这就是为什么你在运行之前在 sdcard 上看到这种类型的应用程序文件夹的原因程序。
  • schemas.android.com/apk/res/android" android:installLocation="preferExternal" ... >
猜你喜欢
  • 2011-03-14
  • 1970-01-01
  • 1970-01-01
  • 2011-08-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-30
  • 1970-01-01
相关资源
最近更新 更多