对于高版本ADT,手动创建Helloworld程序
2015-04-18 22:33
459 查看
新建一个android应用项目后,无java源文件,无layout文件
这时,新建一个Package,再在新建的Package里新建一个Java文件:
package cn.busymonkey.test; import android.app.Activity; import android.os.Bundle; public class Hello extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
然后添加layout文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>
接着是string.xml
<resources> <string name="hello">Hello World, AndroidhelloActivity!</string> <string name="app_name">Hello</string> </resources>
最后是AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cn.busymonkey.test" android:versionCode="1" android:versionName="1.0" > <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".Hello" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
相关文章推荐
- 微信小程序商城后台修改商城配置信息提示“上传目录Data/UploadFiles不存在请手动创建”
- ubuntu 下面手动创建引用程序启动项(转)
- Android adt v22.6.2 自动创建 appcompat_v7 解决方法,最低版本2.2也不会出现
- 手动创建第一个OC程序
- 手动修复输入表时的发现---对于IID输入表和IAT和INT对应关系及程序载入DLL
- 自动批改android模拟器的imei的小程序 和 下载各个版本SDK Tools及ADT
- SpringMVC基础入门,创建一个HelloWorld程序
- thinkphp3.2.3版本在windows本地apache环境运行正常,上传到centos服务器apache环境中出现:thinkphp 上传根目录不存在!请尝试手动创建:uploads/
- 创建第一个android 应用程序时,SDK和ADT一定要保持版本一致。
- 2-创建第一个QT程序——helloworld
- PHP之道推荐使用PHP版本,数据库方式,以及虚拟机的创建程序
- ubuntu下Pycharm快捷方式程序创建失败后的手动创建指南
- Java手动创建一个内存泄漏的程序
- Visual Studio手动升级旧版本程序
- Android开发 第一课 Mac系统上搭建开发环境,创建Helloworld程序
- Eclipse创建简单helloworld的servlet小程序
- 从HelloWorld看iphone程序的生命周期(XCode4.0版本)
- Hibernate---第一个helloworld程序 (XML版本, annotation版本)
- 在fedora20下面手动为自己的安装程序创建桌面图标
- objective-c入门(xcode helloworld程序 创建类)