Formation aimaf-android-part1
Upcoming SlideShare
Loading in...5
×
 

Formation aimaf-android-part1

on

  • 568 views

 

Statistics

Views

Total Views
568
Views on SlideShare
568
Embed Views
0

Actions

Likes
0
Downloads
20
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Formation aimaf-android-part1 Formation aimaf-android-part1 Presentation Transcript

    • Android Android Training Part 1 RGUIG Saad - AIMAFlundi 21 janvier 13 1
    • Android Morning Program : 1.General Introduction 2.Environment Setup 3.HelloWorl Application 4.Android Application Anatomylundi 21 janvier 13 2
    • General Introduction : Androidlundi 21 janvier 13 3
    • General Introduction : Android Android has more than 48 percent of the smartphone market, versus 32 percent for iOS. Google indicates there are 850,000 Android device activations per day and total Google Play app downloads have reached more than 15 billion. App search firm Xyologic reports that in March 2012 there were 617 million app downloads on Android versus 393 million app downloads on iPhone in the U.S.lundi 21 janvier 13 4
    • General Introduction : Androidlundi 21 janvier 13 5
    • General Introduction : Android 1.0 ASTROlundi 21 janvier 13 6
    • General Introduction : Android 1.5 Cupcakelundi 21 janvier 13 7
    • General Introduction : Android 1.6 Donutlundi 21 janvier 13 8
    • General Introduction : Android 2.1 Eclairlundi 21 janvier 13 9
    • General Introduction : Android 2.2 Froyolundi 21 janvier 13 10
    • General Introduction : Android 2.3 Gingerbreadlundi 21 janvier 13 11
    • General Introduction : Android 3 Honycomblundi 21 janvier 13 12
    • General Introduction : Android 2.4 Ice Cream Sandwichlundi 21 janvier 13 13
    • General Introduction : Android 4.1 Jellybeanlundi 21 janvier 13 14
    • Environment Setup Android Environment Setup Stepslundi 21 janvier 13 15
    • Hello World Application Android Create a new Applicationlundi 21 janvier 13 16
    • Hello World Application Android Eclipse Android Perspectivelundi 21 janvier 13 17
    • Hello World Application Android Application Installation on devicelundi 21 janvier 13 18
    • Hello World Application Android Test the App Emulator Phonelundi 21 janvier 13 19
    • Hello World Application Android Android project anatomy src/ – Source folder contains all your Java source code gen/ – Generated folder contains source code generated by Android/Eclipse. It contains R.java – one of Android’s most important file to perform name lookup/resolution and referencing. R.java is automatically generated by the build system and references your resources. assets/ – Assets folder contains static files such as html which can be included in your program. res/ – Resource folder contains your program resource files. res/drawables/ – Contains image files eg. PNG, JPG etc but also drawables which are specified in XML format res/layouts/ – Contains XML files to specify your application View layouts res/values/ – Contains XML files where you can specify static string,text, numeric and other constant values. libs/ – A folder containing third-party/downloaded JAR libraries which can be used in your Android App. AndroidManifest.xml – A manifest file where you can specify all you Activities, Permissions, and other configurations.lundi 21 janvier 13 20
    • Hello World Application Android Android project anatomy <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="fr.aimaf" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="fr.aimaf.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>lundi 21 janvier 13 21
    • Hello World Application Android Android project anatomy <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" tools:context=".MainActivity" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:text="@string/hello_world" /> </RelativeLayout>lundi 21 janvier 13 22
    • Hello World Application Android Android Activity Life cyclelundi 21 janvier 13 23
    • Hello World Application Android Android Activity Life cycle Method Description Called when the activity is first created. This is where you should do all of your normal static set up — create views, bind data to lists, and so on. This method is passed a Bundle object containing the onCreate() activitys previous state, if that state was captured (see Saving Activity State, later). Always followed by onStart(). Called after the activity has been stopped, just prior to it being started again. onReStart() Always followed by onStart() Called just before the activity becomes visible to the user. Followed by onResume() if the activity comes to the foreground, onStart() or onStop() if it becomes hidden.lundi 21 janvier 13 24
    • Hello World Application Android Android Activity Life cycle Called just before the activity starts interacting with the user. At this point the activity is at onResume() the top of the activity stack, with user input going to it. Always followed by onPause(). Called when the system is about to start resuming another activity. This method is typically used to commit unsaved changes to persistent data, stop animations and other things that may be consuming CPU, and so on. It should do whatever it does very quickly, onPause() because the next activity will not be resumed until it returns. Followed either by onResume() if the activity returns back to the front, or by onStop() if it becomes invisible to the user. Called when the system is about to start resuming another activity. This method is typically used to commit unsaved changes to persistent data, stop animations and other things that may be consuming CPU, and so on. It should do whatever it does very quickly, onStop() because the next activity will not be resumed until it returns. Followed either by onResume() if the activity returns back to the front, or by onStop() if it becomes invisible to the user. Called before the activity is destroyed. This is the final call that the activity will receive. It could be called either because the activity is finishing (someone called finish() on it), onDestroy() or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between these two scenarios with theisFinishing() method.lundi 21 janvier 13 25
    • Hello World Application Android Android Activity Life cycle public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }lundi 21 janvier 13 26
    • Androidlundi 21 janvier 13 27