SlideShare a Scribd company logo
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

More Related Content

What's hot

Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
mssaman
 
Android in practice
Android in practiceAndroid in practice
Android in practice
Jose Manuel Ortega Candel
 
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 build
Tania Pinheiro
 
Invading the home screen
Invading the home screenInvading the home screen
Invading the home screen
Matteo Bonifazi
 
Hierarchy viewer
Hierarchy viewerHierarchy viewer
Hierarchy viewer
Badrinath Kulkarni
 
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
Joemarie 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 Project
Joemarie 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 & Menus
Eng Teong Cheah
 
Android studio
Android studioAndroid studio
Android studio
Andri Yabu
 
android level 3
android level 3android level 3
android level 3
DevMix
 
Android Widget
Android WidgetAndroid Widget
Android Widget
ELLURU Kalyan
 
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 interfaces
C.o. Nieto
 
Desenvolver para Chromecast
Desenvolver para ChromecastDesenvolver para Chromecast
Desenvolver para Chromecast
Pedro 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/2010
Skills Matter
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espresso
Édipo Souza
 

What's hot (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
 

Viewers also liked

BPUT PROJECT LIST @ 2014-15
BPUT PROJECT LIST @ 2014-15BPUT PROJECT LIST @ 2014-15
BPUT PROJECT LIST @ 2014-15
Shriram 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 Application
Aritra Mukherjee
 
Restaurant Finder Android Application project Presentation
Restaurant Finder Android Application project PresentationRestaurant Finder Android Application project Presentation
Restaurant Finder Android Application project Presentation
Abhinav Jain
 
Android College Application Project Report
Android College Application Project ReportAndroid College Application Project Report
Android College Application Project Report
stalin 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 application
Chirag 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 & Snapshots
Usman Sait
 

Viewers also liked (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
 

Similar to Ch2 first app

Share kmu itbz_20181106
Share kmu itbz_20181106Share kmu itbz_20181106
Share kmu itbz_20181106
DongHyun Gang
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
Roy 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 step
priya 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 project
Vitali 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 android
Mahmudul 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 manifest
Denis 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 button
priya Nithya
 
How to Setup App Indexation
How to Setup App IndexationHow to Setup App Indexation
How to Setup App Indexation
Justin Briggs
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
Wingston
 
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
Jarek Wilkiewicz
 
Services
ServicesServices
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 Apps
Gil 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 widgets
Prajyot Mainkar
 
Practical 14 android.docx
Practical 14 android.docxPractical 14 android.docx
Practical 14 android.docx
VedantIbitwar
 
Android Programming.pptx
Android Programming.pptxAndroid Programming.pptx
Android Programming.pptx
vishal choudhary
 
Android Development Basics
Android Development BasicsAndroid Development Basics
Android Development Basics
Prajakta Dharmpurikar
 

Similar to 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
 

More from Chia Wei Tsai

iHelp & Open Data
iHelp & Open DataiHelp & Open Data
iHelp & Open Data
Chia Wei Tsai
 
從競賽到創業
從競賽到創業從競賽到創業
從競賽到創業
Chia Wei Tsai
 
沒有 GUI 的 Git
沒有 GUI 的 Git沒有 GUI 的 Git
沒有 GUI 的 Git
Chia Wei Tsai
 
GDGK (LT) - Git 工作流程
GDGK (LT) - Git 工作流程GDGK (LT) - Git 工作流程
GDGK (LT) - Git 工作流程
Chia Wei Tsai
 
人生歷程
人生歷程人生歷程
人生歷程
Chia Wei Tsai
 
人生歷程
人生歷程人生歷程
人生歷程
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
 
Mopcon2014(LT)
Mopcon2014(LT)Mopcon2014(LT)
Mopcon2014(LT)
Chia Wei Tsai
 
iHelp-台經院
iHelp-台經院iHelp-台經院
iHelp-台經院
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@KSDG
IHELP@KSDG IHELP@KSDG
IHELP@KSDG
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
 
iHELP
iHELPiHELP
KSDG - iHelp 心路歷程
KSDG - iHelp 心路歷程KSDG - iHelp 心路歷程
KSDG - iHelp 心路歷程Chia Wei Tsai
 

More from 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 心路歷程
 

Recently uploaded

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 

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