SlideShare ist ein Scribd-Unternehmen logo
1 von 37
First Android App
Create a Android Project
File > Android
Application Project
Android App Name
Eclipse Project Name
App Package Name Google play package is only
Running Your First App
Introduction directories and files in the Android
project
The first Android project architecture
http://developer.android.com/tools/projects/index.html
AndroidManifest.xml
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<manifest	
  xmlns:android="http://schemas.android.com/apk/res/android"	
  
	
  	
  	
  	
  package="com.example.firstapp"	
  
	
  	
  	
  	
  android:versionCode="1"	
  
	
  	
  	
  	
  android:versionName="1.0"	
  >	
  
!
	
  	
  	
  	
  <uses-­‐sdk	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:minSdkVersion="8"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:targetSdkVersion="21"	
  />	
  
!
	
  	
  	
  	
  <application	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:allowBackup="true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:icon="@drawable/ic_launcher"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:label="@string/app_name"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:theme="@style/AppTheme"	
  >	
  
	
  	
  	
  	
  	
  	
  	
  	
  <activity	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  android:name=".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>
AndroidManifest.xml
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<manifest	
  xmlns:android="http://schemas.android.com/apk/res/android"	
  
	
  	
  	
  	
  package="com.example.firstapp"	
  
	
  	
  	
  	
  android:versionCode="1"	
  
	
  	
  	
  	
  android:versionName="1.0"	
  >	
  
!
	
  	
  	
  	
  <uses-­‐sdk	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:minSdkVersion="8"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:targetSdkVersion="21"	
  />	
  
!
	
  	
  	
  	
  <application	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:allowBackup="true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:icon="@drawable/ic_launcher"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:label="@string/app_name"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:theme="@style/AppTheme"	
  >	
  
	
  	
  	
  	
  	
  	
  	
  	
  <activity	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  android:name=".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>
AndroidManifest.xml
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<manifest	
  xmlns:android="http://schemas.android.com/apk/res/android"	
  
	
  	
  	
  	
  package="com.example.firstapp"	
  
	
  	
  	
  	
  android:versionCode="1"	
  
	
  	
  	
  	
  android:versionName="1.0"	
  >	
  
!
	
  	
  	
  	
  <uses-­‐sdk	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:minSdkVersion="8"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:targetSdkVersion="21"	
  />	
  
!
	
  	
  	
  	
  <application	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:allowBackup="true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:icon="@drawable/ic_launcher"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:label="@string/app_name"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:theme="@style/AppTheme"	
  >	
  
	
  	
  	
  	
  	
  	
  	
  	
  <activity	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  android:name=".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>
AndroidManifest.xml
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<manifest	
  xmlns:android="http://schemas.android.com/apk/res/android"	
  
	
  	
  	
  	
  package="com.example.firstapp"	
  
	
  	
  	
  	
  android:versionCode="1"	
  
	
  	
  	
  	
  android:versionName="1.0"	
  >	
  
!
	
  	
  	
  	
  <uses-­‐sdk	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:minSdkVersion="8"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:targetSdkVersion="21"	
  />	
  
!
	
  	
  	
  	
  <application	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:allowBackup="true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:icon="@drawable/ic_launcher"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:label="@string/app_name"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:theme="@style/AppTheme"	
  >	
  
	
  	
  	
  	
  	
  	
  	
  	
  <activity	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  android:name=".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>
res/values/string.xml
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<manifest	
  xmlns:android="http://schemas.android.com/apk/res/android"	
  
	
  	
  	
  	
  package="com.example.firstapp"	
  
	
  	
  	
  	
  android:versionCode="1"	
  
	
  	
  	
  	
  android:versionName="1.0"	
  >	
  
!
	
  	
  	
  	
  <uses-­‐sdk	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:minSdkVersion="8"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:targetSdkVersion="21"	
  />	
  
!
	
  	
  	
  	
  <application	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:allowBackup="true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:icon="@drawable/ic_launcher"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:label="@string/app_name"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:theme="@style/AppTheme"	
  >	
  
	
  	
  	
  	
  	
  	
  	
  	
  <activity	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  android:name=".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>
res/values/string.xml
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<manifest	
  xmlns:android="http://schemas.android.com/apk/res/android"	
  
	
  	
  	
  	
  package="com.example.firstapp"	
  
	
  	
  	
  	
  android:versionCode="1"	
  
	
  	
  	
  	
  android:versionName="1.0"	
  >	
  
!
	
  	
  	
  	
  <uses-­‐sdk	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:minSdkVersion="8"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:targetSdkVersion="21"	
  />	
  
!
	
  	
  	
  	
  <application	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:allowBackup="true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:icon="@drawable/ic_launcher"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:label="@string/app_name"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:theme="@style/AppTheme"	
  >	
  
	
  	
  	
  	
  	
  	
  	
  	
  <activity	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  android:name=".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>
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<resources>	
  
!
	
  	
  	
  	
  <string	
  name="app_name">FirstApp</string>	
  
	
  	
  	
  	
  <string	
  name="hello_world">Hello	
  world!</string>	
  
	
  	
  	
  	
  <string	
  name="action_settings">Settings</string>	
  
!
</resources>
res/values/string.xml
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<manifest	
  xmlns:android="http://schemas.android.com/apk/res/android"	
  
	
  	
  	
  	
  package="com.example.firstapp"	
  
	
  	
  	
  	
  android:versionCode="1"	
  
	
  	
  	
  	
  android:versionName="1.0"	
  >	
  
!
	
  	
  	
  	
  <uses-­‐sdk	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:minSdkVersion="8"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:targetSdkVersion="21"	
  />	
  
!
	
  	
  	
  	
  <application	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:allowBackup="true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:icon="@drawable/ic_launcher"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:label="@string/app_name"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:theme="@style/AppTheme"	
  >	
  
	
  	
  	
  	
  	
  	
  	
  	
  <activity	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  android:name=".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>
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<resources>	
  
!
	
  	
  	
  	
  <string	
  name="app_name">FirstApp</string>	
  
	
  	
  	
  	
  <string	
  name="hello_world">Hello	
  world!</string>	
  
	
  	
  	
  	
  <string	
  name="action_settings">Settings</string>	
  
!
</resources>
AndroidManifest.xml
<?xml	
  version="1.0"	
  encoding="utf-­‐8"?>	
  
<manifest	
  xmlns:android="http://schemas.android.com/apk/res/android"	
  
	
  	
  	
  	
  package="com.example.firstapp"	
  
	
  	
  	
  	
  android:versionCode="1"	
  
	
  	
  	
  	
  android:versionName="1.0"	
  >	
  
!
	
  	
  	
  	
  <uses-­‐sdk	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:minSdkVersion="8"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:targetSdkVersion="21"	
  />	
  
!
	
  	
  	
  	
  <application	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:allowBackup="true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:icon="@drawable/ic_launcher"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:label="@string/app_name"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:theme="@style/AppTheme"	
  >	
  
	
  	
  	
  	
  	
  	
  	
  	
  <activity	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  android:name=".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>
src/{your package name}/
MainActivity.java
public	
  class	
  MainActivity	
  extends	
  ActionBarActivity	
  {	
  
!
	
   @Override	
  
	
   protected	
  void	
  onCreate(Bundle	
  savedInstanceState)	
  {	
  
	
   	
   super.onCreate(savedInstanceState);	
  
	
   	
   setContentView(R.layout.activity_main);	
  
	
   }	
  
!
	
   @Override	
  
	
   public	
  boolean	
  onCreateOptionsMenu(Menu	
  menu)	
  {	
  
	
   	
   //	
  Inflate	
  the	
  menu;	
  this	
  adds	
  items	
  to	
  the	
  action	
  bar	
  if	
  it	
  is	
  present.	
  
	
   	
   getMenuInflater().inflate(R.menu.main,	
  menu);	
  
	
   	
   return	
  true;	
  
	
   }	
  
!
	
   @Override	
  
	
   public	
  boolean	
  onOptionsItemSelected(MenuItem	
  item)	
  {	
  
	
   	
   //	
  Handle	
  action	
  bar	
  item	
  clicks	
  here.	
  The	
  action	
  bar	
  will	
  
	
   	
   //	
  automatically	
  handle	
  clicks	
  on	
  the	
  Home/Up	
  button,	
  so	
  long	
  
	
   	
   //	
  as	
  you	
  specify	
  a	
  parent	
  activity	
  in	
  AndroidManifest.xml.	
  
	
   	
   int	
  id	
  =	
  item.getItemId();	
  
	
   	
   if	
  (id	
  ==	
  R.id.action_settings)	
  {	
  
	
   	
   	
   return	
  true;	
  
	
   	
   }	
  
	
   	
   return	
  super.onOptionsItemSelected(item);	
  
	
   }	
  
}
src/{your package name}/
MainActivity.java
public	
  class	
  MainActivity	
  extends	
  ActionBarActivity	
  {	
  
!
	
   @Override	
  
	
   protected	
  void	
  onCreate(Bundle	
  savedInstanceState)	
  {	
  
	
   	
   super.onCreate(savedInstanceState);	
  
	
   	
   setContentView(R.layout.activity_main);	
  
	
   }	
  
!
	
   @Override	
  
	
   public	
  boolean	
  onCreateOptionsMenu(Menu	
  menu)	
  {	
  
	
   	
   //	
  Inflate	
  the	
  menu;	
  this	
  adds	
  items	
  to	
  the	
  action	
  bar	
  if	
  it	
  is	
  present.	
  
	
   	
   getMenuInflater().inflate(R.menu.main,	
  menu);	
  
	
   	
   return	
  true;	
  
	
   }	
  
!
	
   @Override	
  
	
   public	
  boolean	
  onOptionsItemSelected(MenuItem	
  item)	
  {	
  
	
   	
   //	
  Handle	
  action	
  bar	
  item	
  clicks	
  here.	
  The	
  action	
  bar	
  will	
  
	
   	
   //	
  automatically	
  handle	
  clicks	
  on	
  the	
  Home/Up	
  button,	
  so	
  long	
  
	
   	
   //	
  as	
  you	
  specify	
  a	
  parent	
  activity	
  in	
  AndroidManifest.xml.	
  
	
   	
   int	
  id	
  =	
  item.getItemId();	
  
	
   	
   if	
  (id	
  ==	
  R.id.action_settings)	
  {	
  
	
   	
   	
   return	
  true;	
  
	
   	
   }	
  
	
   	
   return	
  super.onOptionsItemSelected(item);	
  
	
   }	
  
}
res/layout/activity_main.xml
public	
  class	
  MainActivity	
  extends	
  ActionBarActivity	
  {	
  
!
	
   @Override	
  
	
   protected	
  void	
  onCreate(Bundle	
  savedInstanceState)	
  {	
  
	
   	
   super.onCreate(savedInstanceState);	
  
	
   	
   setContentView(R.layout.activity_main);	
  
	
   }	
  
!
	
   @Override	
  
	
   public	
  boolean	
  onCreateOptionsMenu(Menu	
  menu)	
  {	
  
	
   	
   //	
  Inflate	
  the	
  menu;	
  this	
  adds	
  items	
  to	
  the	
  action	
  bar	
  if	
  it	
  is	
  present.	
  
	
   	
   getMenuInflater().inflate(R.menu.main,	
  menu);	
  
	
   	
   return	
  true;	
  
	
   }	
  
!
	
   @Override	
  
	
   public	
  boolean	
  onOptionsItemSelected(MenuItem	
  item)	
  {	
  
	
   	
   //	
  Handle	
  action	
  bar	
  item	
  clicks	
  here.	
  The	
  action	
  bar	
  will	
  
	
   	
   //	
  automatically	
  handle	
  clicks	
  on	
  the	
  Home/Up	
  button,	
  so	
  long	
  
	
   	
   //	
  as	
  you	
  specify	
  a	
  parent	
  activity	
  in	
  AndroidManifest.xml.	
  
	
   	
   int	
  id	
  =	
  item.getItemId();	
  
	
   	
   if	
  (id	
  ==	
  R.id.action_settings)	
  {	
  
	
   	
   	
   return	
  true;	
  
	
   	
   }	
  
	
   	
   return	
  super.onOptionsItemSelected(item);	
  
	
   }	
  
}
<RelativeLayout	
  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:paddingBottom="@dimen/activity_vertical_margin"	
  
	
  	
  	
  	
  android:paddingLeft="@dimen/activity_horizontal_margin"	
  
	
  	
  	
  	
  android:paddingRight="@dimen/activity_horizontal_margin"	
  
	
  	
  	
  	
  android:paddingTop="@dimen/activity_vertical_margin"	
  
	
  	
  	
  	
  tools:context="com.example.firstapp.MainActivity"	
  >	
  
!
	
  	
  	
  	
  <TextView	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:layout_width="wrap_content"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:layout_height="wrap_content"	
  
	
  	
  	
  	
  	
  	
  	
  	
  android:text="@string/hello_world"	
  />	
  
!
</RelativeLayout>
res gen src bin jni libs assets
layout
layout-land = 橫向

layout-port = 直向
drawable
xlarge = 960dp x 720dp

large = 640dp x 480dp

normal = 470dp x 320dp

small = 426dp x 320dp
menu Menu item
value
color.xml

string.xml

style.xml
res gen src bin jni libs assets
BuildConfig.java
/**	
  Automatically	
  generated	
  file.	
  DO	
  NOT	
  MODIFY	
  */	
  
package	
  com.example.firstapp;	
  
!
public	
  final	
  class	
  BuildConfig	
  {	
  
	
  	
  	
  	
  public	
  final	
  static	
  boolean	
  DEBUG	
  =	
  true;	
  
}
res gen src bin jni libs assets
R.java
AUTO-­‐GENERATED	
  FILE.	
  	
  DO	
  NOT	
  MODIFY.	
  
package	
  com.example.firstapp;	
  
!
public	
  final	
  class	
  R	
  {	
  
	
  	
  	
  	
  public	
  static	
  final	
  class	
  layout	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  public	
  static	
  final	
  int	
  activity_main=0x7f040000;	
  
	
  	
  	
  	
  }	
  
	
   	
  …………	
  
}
res gen src bin jni libs assets
package	
  com.example.firstapp;	
  
!
import	
  android.app.Activity;	
  
import	
  android.os.Bundle;	
  
!
public	
  class	
  MainActivity	
  extends	
  Activity	
  {	
  
!
	
   @Override	
  
	
   protected	
  void	
  onCreate(Bundle	
  savedInstanceState)	
  {	
  
	
   	
   super.onCreate(savedInstanceState);	
  
	
   	
   setContentView(R.layout.activity_main);	
  
	
   }	
  
!
}
res gen src bin jni libs assets
res gen src bin jni libs assets
res gen src bin jni libs assets
Third party library
res gen src bin jni libs assets
This is empty. You can use it to store raw asset files. Files
that you save here are compiled into an .apk file as-is,
and the original filename is preserved. You can navigate
this directory in the same way as a typical file system
using URIs and read files as a stream of bytes using the
AssetManager. For example, this is a good location for
textures and game data.
res gen src bin jni libs assets
Android Project Builder
res gen src bin jni libs assets

Weitere ähnliche Inhalte

Was ist angesagt?

Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cyclemssaman
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basicsAnton Narusberg
 
7 Ways to improve your gradle build
7 Ways to improve your gradle build7 Ways to improve your gradle build
7 Ways to improve your gradle buildTania Pinheiro
 
Invading the home screen
Invading the home screenInvading the home screen
Invading the home screenMatteo Bonifazi
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminarJoemarie Amparo
 
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample ProjectAndroid Development Made Easy - With Sample Project
Android Development Made Easy - With Sample ProjectJoemarie Amparo
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusEng Teong Cheah
 
Android studio
Android studioAndroid studio
Android studioAndri Yabu
 
android level 3
android level 3android level 3
android level 3DevMix
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidgetKrazy Koder
 
Ionic으로 모바일앱 만들기 #3
Ionic으로 모바일앱 만들기 #3Ionic으로 모바일앱 만들기 #3
Ionic으로 모바일앱 만들기 #3성일 한
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfacesC.o. Nieto
 
Desenvolver para Chromecast
Desenvolver para ChromecastDesenvolver para Chromecast
Desenvolver para ChromecastPedro Veloso
 
Droidcon: Sean Owen: Driving Downloads via Intents- 29/10/2010
Droidcon: Sean Owen: Driving Downloads via Intents- 29/10/2010Droidcon: Sean Owen: Driving Downloads via Intents- 29/10/2010
Droidcon: Sean Owen: Driving Downloads via Intents- 29/10/2010Skills Matter
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espressoÉdipo Souza
 

Was ist angesagt? (20)

Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
 
Android in practice
Android in practiceAndroid in practice
Android in practice
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
 
7 Ways to improve your gradle build
7 Ways to improve your gradle build7 Ways to improve your gradle build
7 Ways to improve your gradle build
 
Invading the home screen
Invading the home screenInvading the home screen
Invading the home screen
 
Hierarchy viewer
Hierarchy viewerHierarchy viewer
Hierarchy viewer
 
Android development orientation for starters v4 seminar
Android development orientation for starters v4   seminarAndroid development orientation for starters v4   seminar
Android development orientation for starters v4 seminar
 
Lesson 10
Lesson 10Lesson 10
Lesson 10
 
Android Development Made Easy - With Sample Project
Android Development Made Easy - With Sample ProjectAndroid Development Made Easy - With Sample Project
Android Development Made Easy - With Sample Project
 
Android Basics
Android BasicsAndroid Basics
Android Basics
 
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & MenusLearn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
Learn Xamarin Absolute Beginners - Permissions, Building the App GUI & Menus
 
Android studio
Android studioAndroid studio
Android studio
 
android level 3
android level 3android level 3
android level 3
 
Android Widget
Android WidgetAndroid Widget
Android Widget
 
Android appwidget
Android appwidgetAndroid appwidget
Android appwidget
 
Ionic으로 모바일앱 만들기 #3
Ionic으로 모바일앱 만들기 #3Ionic으로 모바일앱 만들기 #3
Ionic으로 모바일앱 만들기 #3
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
 
Desenvolver para Chromecast
Desenvolver para ChromecastDesenvolver para Chromecast
Desenvolver para Chromecast
 
Droidcon: Sean Owen: Driving Downloads via Intents- 29/10/2010
Droidcon: Sean Owen: Driving Downloads via Intents- 29/10/2010Droidcon: Sean Owen: Driving Downloads via Intents- 29/10/2010
Droidcon: Sean Owen: Driving Downloads via Intents- 29/10/2010
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espresso
 

Andere mochten auch

BPUT PROJECT LIST @ 2014-15
BPUT PROJECT LIST @ 2014-15BPUT PROJECT LIST @ 2014-15
BPUT PROJECT LIST @ 2014-15Shriram Agrawal
 
2015-2016 IEEE-PROJECTS FOR ME-M.TECH-BE-BTECH-MCA-M.SC-COMPUTERSCIENCE-ENGIN...
2015-2016 IEEE-PROJECTS FOR ME-M.TECH-BE-BTECH-MCA-M.SC-COMPUTERSCIENCE-ENGIN...2015-2016 IEEE-PROJECTS FOR ME-M.TECH-BE-BTECH-MCA-M.SC-COMPUTERSCIENCE-ENGIN...
2015-2016 IEEE-PROJECTS FOR ME-M.TECH-BE-BTECH-MCA-M.SC-COMPUTERSCIENCE-ENGIN...Irissolution
 
Simple Android Project (SAP)... A Test Application
Simple Android Project (SAP)... A Test ApplicationSimple Android Project (SAP)... A Test Application
Simple Android Project (SAP)... A Test ApplicationAritra Mukherjee
 
Restaurant Finder Android Application project Presentation
Restaurant Finder Android Application project PresentationRestaurant Finder Android Application project Presentation
Restaurant Finder Android Application project PresentationAbhinav Jain
 
Android College Application Project Report
Android College Application Project ReportAndroid College Application Project Report
Android College Application Project Reportstalin george
 
Final year project presentation in android application
Final year project presentation in android applicationFinal year project presentation in android application
Final year project presentation in android applicationChirag Thaker
 
My Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsMy Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsUsman Sait
 

Andere mochten auch (7)

BPUT PROJECT LIST @ 2014-15
BPUT PROJECT LIST @ 2014-15BPUT PROJECT LIST @ 2014-15
BPUT PROJECT LIST @ 2014-15
 
2015-2016 IEEE-PROJECTS FOR ME-M.TECH-BE-BTECH-MCA-M.SC-COMPUTERSCIENCE-ENGIN...
2015-2016 IEEE-PROJECTS FOR ME-M.TECH-BE-BTECH-MCA-M.SC-COMPUTERSCIENCE-ENGIN...2015-2016 IEEE-PROJECTS FOR ME-M.TECH-BE-BTECH-MCA-M.SC-COMPUTERSCIENCE-ENGIN...
2015-2016 IEEE-PROJECTS FOR ME-M.TECH-BE-BTECH-MCA-M.SC-COMPUTERSCIENCE-ENGIN...
 
Simple Android Project (SAP)... A Test Application
Simple Android Project (SAP)... A Test ApplicationSimple Android Project (SAP)... A Test Application
Simple Android Project (SAP)... A Test Application
 
Restaurant Finder Android Application project Presentation
Restaurant Finder Android Application project PresentationRestaurant Finder Android Application project Presentation
Restaurant Finder Android Application project Presentation
 
Android College Application Project Report
Android College Application Project ReportAndroid College Application Project Report
Android College Application Project Report
 
Final year project presentation in android application
Final year project presentation in android applicationFinal year project presentation in android application
Final year project presentation in android application
 
My Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & SnapshotsMy Project Report Documentation with Abstract & Snapshots
My Project Report Documentation with Abstract & Snapshots
 

Ähnlich wie Ch2 first app

Share kmu itbz_20181106
Share kmu itbz_20181106Share kmu itbz_20181106
Share kmu itbz_20181106DongHyun Gang
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development PracticesRoy Clarkson
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by steppriya Nithya
 
Lecture #1 Creating your first android project
Lecture #1  Creating your first android projectLecture #1  Creating your first android project
Lecture #1 Creating your first android projectVitali Pekelis
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in androidMahmudul Hasan
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Gustavo Fuentes Zurita
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Gustavo Fuentes Zurita
 
Android Bootcamp Tanzania: android manifest
Android Bootcamp Tanzania: android manifestAndroid Bootcamp Tanzania: android manifest
Android Bootcamp Tanzania: android manifestDenis Minja
 
Android LAb - Creating an android app with Radio button
Android LAb - Creating an android app with Radio buttonAndroid LAb - Creating an android app with Radio button
Android LAb - Creating an android app with Radio buttonpriya Nithya
 
How to Setup App Indexation
How to Setup App IndexationHow to Setup App Indexation
How to Setup App IndexationJustin Briggs
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - AndroidWingston
 
An Introduction to Deep Linking and App Indexing Codelab
An Introduction to Deep Linking and App Indexing CodelabAn Introduction to Deep Linking and App Indexing Codelab
An Introduction to Deep Linking and App Indexing CodelabJarek Wilkiewicz
 
Mobile Software Engineering Crash Course - C03 Android
Mobile Software Engineering Crash Course - C03 AndroidMobile Software Engineering Crash Course - C03 Android
Mobile Software Engineering Crash Course - C03 AndroidMohammad Shaker
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
4.preference management
4.preference management 4.preference management
4.preference management maamir farooq
 
Android Tutorials : Basic widgets
Android Tutorials : Basic widgetsAndroid Tutorials : Basic widgets
Android Tutorials : Basic widgetsPrajyot Mainkar
 
Practical 14 android.docx
Practical 14 android.docxPractical 14 android.docx
Practical 14 android.docxVedantIbitwar
 

Ähnlich wie Ch2 first app (20)

Share kmu itbz_20181106
Share kmu itbz_20181106Share kmu itbz_20181106
Share kmu itbz_20181106
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by step
 
Lecture #1 Creating your first android project
Lecture #1  Creating your first android projectLecture #1  Creating your first android project
Lecture #1 Creating your first android project
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
 
Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9Androidoscon20080721 1216843094441821-9
Androidoscon20080721 1216843094441821-9
 
Android Bootcamp Tanzania: android manifest
Android Bootcamp Tanzania: android manifestAndroid Bootcamp Tanzania: android manifest
Android Bootcamp Tanzania: android manifest
 
Android LAb - Creating an android app with Radio button
Android LAb - Creating an android app with Radio buttonAndroid LAb - Creating an android app with Radio button
Android LAb - Creating an android app with Radio button
 
How to Setup App Indexation
How to Setup App IndexationHow to Setup App Indexation
How to Setup App Indexation
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 
An Introduction to Deep Linking and App Indexing Codelab
An Introduction to Deep Linking and App Indexing CodelabAn Introduction to Deep Linking and App Indexing Codelab
An Introduction to Deep Linking and App Indexing Codelab
 
Services
ServicesServices
Services
 
Mobile Software Engineering Crash Course - C03 Android
Mobile Software Engineering Crash Course - C03 AndroidMobile Software Engineering Crash Course - C03 Android
Mobile Software Engineering Crash Course - C03 Android
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
4.preference management
4.preference management 4.preference management
4.preference management
 
Android Tutorials : Basic widgets
Android Tutorials : Basic widgetsAndroid Tutorials : Basic widgets
Android Tutorials : Basic widgets
 
Practical 14 android.docx
Practical 14 android.docxPractical 14 android.docx
Practical 14 android.docx
 
Android Programming.pptx
Android Programming.pptxAndroid Programming.pptx
Android Programming.pptx
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
 

Mehr von Chia Wei Tsai

GDGK (LT) - Git 工作流程
GDGK (LT) - Git 工作流程GDGK (LT) - Git 工作流程
GDGK (LT) - Git 工作流程Chia Wei Tsai
 
聲點典(第一版)
聲點典(第一版)聲點典(第一版)
聲點典(第一版)Chia Wei Tsai
 
KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享Chia Wei Tsai
 
iHelp-資訊服務創新應用競賽
iHelp-資訊服務創新應用競賽iHelp-資訊服務創新應用競賽
iHelp-資訊服務創新應用競賽Chia Wei Tsai
 
iHelp-台北警政局分享
iHelp-台北警政局分享iHelp-台北警政局分享
iHelp-台北警政局分享Chia Wei Tsai
 
IHelp@Taiwan - App 創意搖籃
IHelp@Taiwan - App 創意搖籃 IHelp@Taiwan - App 創意搖籃
IHelp@Taiwan - App 創意搖籃 Chia Wei Tsai
 
iHELP @ Taipei Google Develop Group mobile day
iHELP @ Taipei Google Develop Group mobile dayiHELP @ Taipei Google Develop Group mobile day
iHELP @ Taipei Google Develop Group mobile dayChia Wei Tsai
 
KSDG - iHelp 心路歷程
KSDG - iHelp 心路歷程KSDG - iHelp 心路歷程
KSDG - iHelp 心路歷程Chia Wei Tsai
 

Mehr von Chia Wei Tsai (19)

iHelp & Open Data
iHelp & Open DataiHelp & Open Data
iHelp & Open Data
 
從競賽到創業
從競賽到創業從競賽到創業
從競賽到創業
 
沒有 GUI 的 Git
沒有 GUI 的 Git沒有 GUI 的 Git
沒有 GUI 的 Git
 
GDGK (LT) - Git 工作流程
GDGK (LT) - Git 工作流程GDGK (LT) - Git 工作流程
GDGK (LT) - Git 工作流程
 
人生歷程
人生歷程人生歷程
人生歷程
 
人生歷程
人生歷程人生歷程
人生歷程
 
聲點典(第一版)
聲點典(第一版)聲點典(第一版)
聲點典(第一版)
 
KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享KSDG-iSlide App 開發心得分享
KSDG-iSlide App 開發心得分享
 
iHelp-資訊服務創新應用競賽
iHelp-資訊服務創新應用競賽iHelp-資訊服務創新應用競賽
iHelp-資訊服務創新應用競賽
 
Mopcon2014(LT)
Mopcon2014(LT)Mopcon2014(LT)
Mopcon2014(LT)
 
iHelp-台經院
iHelp-台經院iHelp-台經院
iHelp-台經院
 
iHelp(交點)
iHelp(交點)iHelp(交點)
iHelp(交點)
 
iHelp-台北警政局分享
iHelp-台北警政局分享iHelp-台北警政局分享
iHelp-台北警政局分享
 
IHelp@Taiwan - App 創意搖籃
IHelp@Taiwan - App 創意搖籃 IHelp@Taiwan - App 創意搖籃
IHelp@Taiwan - App 創意搖籃
 
IHELP@KSDG
IHELP@KSDG IHELP@KSDG
IHELP@KSDG
 
iHELP @ Taipei Google Develop Group mobile day
iHELP @ Taipei Google Develop Group mobile dayiHELP @ Taipei Google Develop Group mobile day
iHELP @ Taipei Google Develop Group mobile day
 
iHELP
iHELPiHELP
iHELP
 
Word教材
Word教材Word教材
Word教材
 
KSDG - iHelp 心路歷程
KSDG - iHelp 心路歷程KSDG - iHelp 心路歷程
KSDG - iHelp 心路歷程
 

Kürzlich hochgeladen

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Kürzlich hochgeladen (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

Ch2 first app

  • 6. App Package Name Google play package is only
  • 7.
  • 8.
  • 9.
  • 10.
  • 12.
  • 13.
  • 14.
  • 15. Introduction directories and files in the Android project
  • 16. The first Android project architecture http://developer.android.com/tools/projects/index.html
  • 17. AndroidManifest.xml <?xml  version="1.0"  encoding="utf-­‐8"?>   <manifest  xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.firstapp"          android:versionCode="1"          android:versionName="1.0"  >   !        <uses-­‐sdk                  android:minSdkVersion="8"                  android:targetSdkVersion="21"  />   !        <application                  android:allowBackup="true"                  android:icon="@drawable/ic_launcher"                  android:label="@string/app_name"                  android:theme="@style/AppTheme"  >                  <activity                          android:name=".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>
  • 18. AndroidManifest.xml <?xml  version="1.0"  encoding="utf-­‐8"?>   <manifest  xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.firstapp"          android:versionCode="1"          android:versionName="1.0"  >   !        <uses-­‐sdk                  android:minSdkVersion="8"                  android:targetSdkVersion="21"  />   !        <application                  android:allowBackup="true"                  android:icon="@drawable/ic_launcher"                  android:label="@string/app_name"                  android:theme="@style/AppTheme"  >                  <activity                          android:name=".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>
  • 19. AndroidManifest.xml <?xml  version="1.0"  encoding="utf-­‐8"?>   <manifest  xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.firstapp"          android:versionCode="1"          android:versionName="1.0"  >   !        <uses-­‐sdk                  android:minSdkVersion="8"                  android:targetSdkVersion="21"  />   !        <application                  android:allowBackup="true"                  android:icon="@drawable/ic_launcher"                  android:label="@string/app_name"                  android:theme="@style/AppTheme"  >                  <activity                          android:name=".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>
  • 20. AndroidManifest.xml <?xml  version="1.0"  encoding="utf-­‐8"?>   <manifest  xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.firstapp"          android:versionCode="1"          android:versionName="1.0"  >   !        <uses-­‐sdk                  android:minSdkVersion="8"                  android:targetSdkVersion="21"  />   !        <application                  android:allowBackup="true"                  android:icon="@drawable/ic_launcher"                  android:label="@string/app_name"                  android:theme="@style/AppTheme"  >                  <activity                          android:name=".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>
  • 21. res/values/string.xml <?xml  version="1.0"  encoding="utf-­‐8"?>   <manifest  xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.firstapp"          android:versionCode="1"          android:versionName="1.0"  >   !        <uses-­‐sdk                  android:minSdkVersion="8"                  android:targetSdkVersion="21"  />   !        <application                  android:allowBackup="true"                  android:icon="@drawable/ic_launcher"                  android:label="@string/app_name"                  android:theme="@style/AppTheme"  >                  <activity                          android:name=".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>
  • 22. res/values/string.xml <?xml  version="1.0"  encoding="utf-­‐8"?>   <manifest  xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.firstapp"          android:versionCode="1"          android:versionName="1.0"  >   !        <uses-­‐sdk                  android:minSdkVersion="8"                  android:targetSdkVersion="21"  />   !        <application                  android:allowBackup="true"                  android:icon="@drawable/ic_launcher"                  android:label="@string/app_name"                  android:theme="@style/AppTheme"  >                  <activity                          android:name=".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> <?xml  version="1.0"  encoding="utf-­‐8"?>   <resources>   !        <string  name="app_name">FirstApp</string>          <string  name="hello_world">Hello  world!</string>          <string  name="action_settings">Settings</string>   ! </resources>
  • 23. res/values/string.xml <?xml  version="1.0"  encoding="utf-­‐8"?>   <manifest  xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.firstapp"          android:versionCode="1"          android:versionName="1.0"  >   !        <uses-­‐sdk                  android:minSdkVersion="8"                  android:targetSdkVersion="21"  />   !        <application                  android:allowBackup="true"                  android:icon="@drawable/ic_launcher"                  android:label="@string/app_name"                  android:theme="@style/AppTheme"  >                  <activity                          android:name=".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> <?xml  version="1.0"  encoding="utf-­‐8"?>   <resources>   !        <string  name="app_name">FirstApp</string>          <string  name="hello_world">Hello  world!</string>          <string  name="action_settings">Settings</string>   ! </resources>
  • 24. AndroidManifest.xml <?xml  version="1.0"  encoding="utf-­‐8"?>   <manifest  xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.firstapp"          android:versionCode="1"          android:versionName="1.0"  >   !        <uses-­‐sdk                  android:minSdkVersion="8"                  android:targetSdkVersion="21"  />   !        <application                  android:allowBackup="true"                  android:icon="@drawable/ic_launcher"                  android:label="@string/app_name"                  android:theme="@style/AppTheme"  >                  <activity                          android:name=".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>
  • 25. src/{your package name}/ MainActivity.java public  class  MainActivity  extends  ActionBarActivity  {   !   @Override     protected  void  onCreate(Bundle  savedInstanceState)  {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);     }   !   @Override     public  boolean  onCreateOptionsMenu(Menu  menu)  {       //  Inflate  the  menu;  this  adds  items  to  the  action  bar  if  it  is  present.       getMenuInflater().inflate(R.menu.main,  menu);       return  true;     }   !   @Override     public  boolean  onOptionsItemSelected(MenuItem  item)  {       //  Handle  action  bar  item  clicks  here.  The  action  bar  will       //  automatically  handle  clicks  on  the  Home/Up  button,  so  long       //  as  you  specify  a  parent  activity  in  AndroidManifest.xml.       int  id  =  item.getItemId();       if  (id  ==  R.id.action_settings)  {         return  true;       }       return  super.onOptionsItemSelected(item);     }   }
  • 26. src/{your package name}/ MainActivity.java public  class  MainActivity  extends  ActionBarActivity  {   !   @Override     protected  void  onCreate(Bundle  savedInstanceState)  {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);     }   !   @Override     public  boolean  onCreateOptionsMenu(Menu  menu)  {       //  Inflate  the  menu;  this  adds  items  to  the  action  bar  if  it  is  present.       getMenuInflater().inflate(R.menu.main,  menu);       return  true;     }   !   @Override     public  boolean  onOptionsItemSelected(MenuItem  item)  {       //  Handle  action  bar  item  clicks  here.  The  action  bar  will       //  automatically  handle  clicks  on  the  Home/Up  button,  so  long       //  as  you  specify  a  parent  activity  in  AndroidManifest.xml.       int  id  =  item.getItemId();       if  (id  ==  R.id.action_settings)  {         return  true;       }       return  super.onOptionsItemSelected(item);     }   }
  • 27. res/layout/activity_main.xml public  class  MainActivity  extends  ActionBarActivity  {   !   @Override     protected  void  onCreate(Bundle  savedInstanceState)  {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);     }   !   @Override     public  boolean  onCreateOptionsMenu(Menu  menu)  {       //  Inflate  the  menu;  this  adds  items  to  the  action  bar  if  it  is  present.       getMenuInflater().inflate(R.menu.main,  menu);       return  true;     }   !   @Override     public  boolean  onOptionsItemSelected(MenuItem  item)  {       //  Handle  action  bar  item  clicks  here.  The  action  bar  will       //  automatically  handle  clicks  on  the  Home/Up  button,  so  long       //  as  you  specify  a  parent  activity  in  AndroidManifest.xml.       int  id  =  item.getItemId();       if  (id  ==  R.id.action_settings)  {         return  true;       }       return  super.onOptionsItemSelected(item);     }   } <RelativeLayout  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:paddingBottom="@dimen/activity_vertical_margin"          android:paddingLeft="@dimen/activity_horizontal_margin"          android:paddingRight="@dimen/activity_horizontal_margin"          android:paddingTop="@dimen/activity_vertical_margin"          tools:context="com.example.firstapp.MainActivity"  >   !        <TextView                  android:layout_width="wrap_content"                  android:layout_height="wrap_content"                  android:text="@string/hello_world"  />   ! </RelativeLayout>
  • 28. res gen src bin jni libs assets layout layout-land = 橫向 layout-port = 直向 drawable xlarge = 960dp x 720dp large = 640dp x 480dp normal = 470dp x 320dp small = 426dp x 320dp menu Menu item value color.xml string.xml style.xml
  • 29. res gen src bin jni libs assets BuildConfig.java /**  Automatically  generated  file.  DO  NOT  MODIFY  */   package  com.example.firstapp;   ! public  final  class  BuildConfig  {          public  final  static  boolean  DEBUG  =  true;   }
  • 30. res gen src bin jni libs assets R.java AUTO-­‐GENERATED  FILE.    DO  NOT  MODIFY.   package  com.example.firstapp;   ! public  final  class  R  {          public  static  final  class  layout  {                  public  static  final  int  activity_main=0x7f040000;          }      …………   }
  • 31. res gen src bin jni libs assets package  com.example.firstapp;   ! import  android.app.Activity;   import  android.os.Bundle;   ! public  class  MainActivity  extends  Activity  {   !   @Override     protected  void  onCreate(Bundle  savedInstanceState)  {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);     }   ! }
  • 32. res gen src bin jni libs assets
  • 33. res gen src bin jni libs assets
  • 34. res gen src bin jni libs assets Third party library
  • 35. res gen src bin jni libs assets This is empty. You can use it to store raw asset files. Files that you save here are compiled into an .apk file as-is, and the original filename is preserved. You can navigate this directory in the same way as a typical file system using URIs and read files as a stream of bytes using the AssetManager. For example, this is a good location for textures and game data.
  • 36. res gen src bin jni libs assets Android Project Builder
  • 37. res gen src bin jni libs assets