我不得不说,我是Android开发领域的新手。我只是在昨天下载它,并希望看看我今晚能否获得一些简单的应用程序。应用程序的Android测试代码?
以前的代码是当我把按钮放在屏幕上时的代码。我对XML和Java有很好的理解,所以我对这个概念并不陌生,但是我不得不说,我试图让Android应用程序工作一段时间,它遇到问题后会遇到问题,从来没有看到过示例运行。这不可能是一个复杂的问题。
我知道在Eclipse IDE中有一些测试设备是我模拟Nexus 7的。我有一个Nexus 7并希望看到即使在我自己的设备上也能测试它,但首先我必须获取它甚至在一些仿真中运行。这是我无法想象的。
我的问题是我要去哪里?
确切地说,您如何获得一个Android应用程序来编译和运行,以便您可以在仿真器或Nexus 7的屏幕上看到它的内容。实际上,我没有看到任何Java代码,而是看到了XML基本代码。那是Android系统如何在基于XML的代码上运行?
的Android代码:
<FrameLayout 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:background="#0099cc"
tools:context=".FullscreenActivity" >
<!--
The primary full-screen view. This can be replaced with whatever view
is needed to present your content, e.g. VideoView, SurfaceView,
TextureView, etc.
-->
<TextView
android:id="@+id/fullscreen_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:keepScreenOn="true"
android:text="@string/dummy_content"
android:textColor="#33b5e5"
android:textSize="50sp"
android:textStyle="bold" />
<!--
This FrameLayout insets its children based on system windows using
android:fitsSystemWindows.
-->
<android.support.v7.widget.GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</android.support.v7.widget.GridLayout>
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_star" />
<Button
android:id="@+id/button1"
android:layout_width="301dp"
android:layout_height="142dp"
android:text="Button" />
</FrameLayout>
那究竟是什么问题? – PsyGik
究竟是什么^ - 那家伙说。另外,显示你使用的Java代码。 – csmckelvey