简体   繁体   English

如何在Android模拟器上安装和运行Java应用

[英]how to install and run a java app on android emulator

I have written a java program that takes screenshot of desktop... can i install this java app on android emulator and launch it by clicking on that..before installing on to emulator what all changes i should make to the java code and how to port it to the emulator later... 我已经编写了一个Java程序,该程序需要桌面截图...我可以在Android模拟器上安装此Java应用并通过单击该程序来启动它。.在安装到模拟器上之前,我应该对Java代码进行所有更改以及如何进行操作稍后将其移植到仿真器...

Thanks Manju 谢谢文珠

Unfortunately, if you wrote your application in JavaSE (ordinary desktop Java), there will be complications on getting it to work on Android. 不幸的是,如果您使用JavaSE(普通的桌面Java)编写应用程序,那么在Android上运行该应用程序会很复杂。 The variant of Java that Android exposes has its own API for getting access to the Desktop. Android公开的Java变体具有自己的API,可以访问桌面。 And worse, I'm pretty sure what you're positing is impossible on Android unless you have root access. 更糟糕的是,除非您具有root用户访问权限,否则我很确定您在Android上存储的内容是不可能的。

I suggest downloading ADT and running your application in an emulator to see what it does as soon as you can. 我建议下载ADT并在仿真器中运行您的应用程序,以尽快查看其功能。 As I said, the differences between Android and JavaSE are substantial and the sooner you try your code, the better. 就像我说的那样,Android与JavaSE之间的差异是巨大的,并且越早尝试代码就越好。

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

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