【发布时间】:2013-04-06 22:17:09
【问题描述】:
我是一个自学android开发的新手
我已经设置并安装了 Eclipse/android sdk 和 ADT 插件包
一切正常,包括我的第一个测试“Hello world”程序,当您选择 new->Android 应用程序时已经预安装:
在将应用导出为未签名应用时,Eclipse 已成功将这个“Hello world”应用转换为 .apk 文件。
在指导我的 Android 教程的帮助下 - 我想在我的应用程序中添加一个简单的文本框,我通过添加和更改以下文件来完成此操作:
首先:我将activity_main.xml 文件更改为以下内容:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="@string/edit_message" />
</LinearLayout>
其次:我在 strings.xml 文件中添加了一个字符串“名称”和硬编码文本“输入消息” - 所以现在可以解析文本框对象 ID 名称。
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Gizmodo2</string>
<string name="action_settings">Settings</string>
<string name="edit_message">Enter a message</string>
</resources>
我的新简单应用程序可以使用添加的文本框编译,一切都已解决。
但现在的问题是,当我现在尝试将应用程序导出为未签名的 android 应用程序时,Eclipse 不会生成 .apk 文件,它只会生成扩展名为 .file 的文件!!! - 为什么?以及如何从这个应用程序生成我需要的 .apk 文件?
【问题讨论】: