简体   繁体   English

怎么把jar文件转换成apk?

[英]How to convert jar file into apk?

I have one jar file, when I clicked that jar file, it was opened one window based application. 我有一个jar文件,当我单击该jar文件时,它是一个基于窗口的应用程序打开的。

Now I would like to convert this jar file into apk file. 现在,我想将此jar文件转换为apk文件。 That jar file having 5 class files. 该jar文件有5个类文件。 How can I know the initial class file? 我怎么知道初始班级文件? and How could I code on this in android? 以及如何在android中对此进行编码?

Please do the needful. 请只做那些需要的。

Thanks in advance. 提前致谢。

How can I know the initial class file? 我怎么知道初始班级文件?

Please read http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html .You should have a look at following part: 请阅读http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html 。您应该查看以下部分:

If you have an application bundled in a JAR file, you need some way to indicate which class within the JAR file is your application's entry point. 如果您的应用程序捆绑在JAR文件中,则需要某种方式来指示JAR文件中的哪个类是应用程序的入口点。 You provide this information with the Main-Class header in the manifest, which has the general form:....... 您可以在清单中的Main-Class标头中提供此信息,其标头格式为:.......

Answering to your next question: 回答您的下一个问题:

How could I code on this in android? 如何在android中对此进行编码?

Import JAR file to Android Project. 将JAR文件导入Android Project。 You can get JAR's entry point from Manifest file ( not AndroidManiefst.xml but from JAR's Manifest). 您可以从清单文件(不是AndroidManiefst.xml,而是从JAR的清单)获取JAR的入口点。 However, you mentioned: 但是,您提到了:

it was opened one window based application. 它被打开了一个基于窗口的应用程序。

It looks like those 5 classes have dependencies on some different JARs which could not be available on Android platform. 似乎这5个类依赖于某些不同的JAR,而这些依赖在Android平台上不可用。

You can convert J2ME apps (jar/jad) to Android (apk) using UpOnTek's conversion services. 您可以使用UpOnTek的转换服务将J2ME应用程序(jar / jad)转换为Android(apk)。 Service includes automatic conversion, followed by optimization tips. 服务包括自动转换,以及优化技巧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM