如何在编译后的 Android 应用程序中包含信息?

发布于 2024-09-01 23:21:42 字数 390 浏览 0 评论 0 原文

目前,我向用户提供一个 URL,单击该 URL 即可下载我的 j2me 应用程序。该 URL 包含其用户 id 作为参数,servlet 获取该信息并动态创建包含该用户 id 的 jad 文件,从而使该用户 id 可用于 j2me 应用程序。

但是,我现在使用 j2me Polish 来编译我的程序,因此为同一程序编译了 .apk。但是,我无法弄清楚如何使编译后的程序可以访问这些信息,因为没有 jad / jar 机制。该信息仅在下载时可用。

如有任何建议,不胜感激! (这在 Android 应用程序中是否可能?)

谢谢,

CJ

p.s.我必须从用户的角度假设完全文盲,即我不能要求他们首先安装其他程序等,它需要是一个简单的“单击链接”-> “获取应用程序”之类的事情。

Currently I supply a user with a URL to click on to download my j2me application. This URL includes their user id as a parameter, a servlet takes this information and dynamically creates a jad file that includes this user id , thus making the user id available to the j2me app.

However, I am now using j2me polish to compile my program and thus have the compiled .apk for this same program. However, I cannot work out how to make this information accessible to the the compiled program as there is no jad / jar mechanism. The information is only available at the time of download.

Any suggestions gratefully received! (is this even possible in an android application?)

Thanks,

CJ

p.s. I have to assume complete illiteracy from the users point of view, i.e. I cannot ask them to first install other programs etc, it needs to be a simple "click on the link" -> "get the app" sort of thing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初见你 2024-09-08 23:21:43

.apk 格式基于 .jar 格式,因此它只是一个 ZIP 文件,这意味着您可以使用任何处理 ZIP 文件的文件打开它。

应用程序的 assets 文件夹中的文件不会被 .apk 构建过程更改,因此应该可以将 URL 存储在 的文本文件中>assets 然后使用 AssetManager.open()。您的服务器必须打开 .apk 并更新 assets 中的文本文件,然后才能提供下载。

然而,一个复杂的问题是所有 Android 应用程序都必须签名 否则他们不会安装。即使您不通过市场分发您的应用程序,情况也是如此。因此,除了更新 .apk 文件外,您的服务器还必须使用 keytool 之类的工具对其进行重新签名。

The .apk format is based on the .jar format so is just a ZIP file meaning you can open it with anything that processes ZIP files.

Files which are in the assets folder of your application aren't altered by the .apk build process so it should be possible to store the URL in a text file in assets and then read it using AssetManager.open(). Your server would have to open the .apk and update the text file in assets before offering it for download.

However, a complication is that all Android applications must be signed or they will not install. This is true even if you're not distributing your application via the Market. So as well as updating the .apk file your server would have to re-sign it using something like keytool.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文