进入这个行业也这么久了。以前在 别的网站上也更新过博客,但是一直都是断断续续,跟新了一点点,没能坚持下去,也是经常会去看下别的写的博客,但是都是作为剽窃者。觉得吗这样有点不好意思,一直都是剽窃别的人,自己都不分享,就好比一直去拿别人的东西,但是自己从来就不去拿东西给别人,我这样的人是不是很小气,所以我来证明我不是一个小气的人,打算从新开始建立起自己的博客。在这里希望自己能够坚持下去诺, 还有就是能够帮助到大家就是最好的,
这里就给大家奉送一个Android helloWord,相信大家都不需要我介绍了。
package com.example.helloword;
import android.os.Bundle;
import android.app.Activity;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
这里在附送上界面布局
<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="vertical"
tools:context=".MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</LinearLayout>
这里在附上AndroidMainifest.xml.这里很多博客中间就会忘记附上权限对于刚开始接触Android的人来说这简直就是噩梦,应为他不知道错在哪里,因为代码本来就没错,但是就是不知道哪里错了。嘿嘿,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloword"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.helloword.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Android还有一个比较容易忽视的就是project.properties这个文件,这里其实就一直有一句话target = android-xx 这句话呢就是表示你当前编译的版本,(然后还有新出Android studio这里又有些不同,AS的话以后再更新吧,对于初学还是建议使用ADT, java相关的配置环境和路径我这里就不会跟新了,相信大家自己去百度就可以百度出来了)最后祝大家学习Android愉快。