首发

进入这个行业也这么久了。之前在 别的网站上也更新过博客,可是一直都是断断续续,跟新了一点点,没能坚持下去,也是常常会去看下别的写的博客,可是都是做为剽窃者。以为吗这样有点很差意思,一直都是剽窃别的人,本身都不分享,就比如一直去拿别人的东西,可是本身历来就不去拿东西给别人,我这样的人是否是很小气,因此我来证实我不是一个小气的人,打算重新开始创建起本身的博客。在这里但愿本身可以坚持下去诺, 还有就是可以帮助到你们就是最好的, java

这里就给你们奉送一个Android helloWord,相信你们都不须要我介绍了。 android



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愉快。 app

相关文章
相关标签/搜索