🗊Презентация Android development

Нажмите для полного просмотра!
Android development, слайд №1Android development, слайд №2Android development, слайд №3Android development, слайд №4Android development, слайд №5Android development, слайд №6Android development, слайд №7Android development, слайд №8Android development, слайд №9Android development, слайд №10Android development, слайд №11Android development, слайд №12Android development, слайд №13Android development, слайд №14Android development, слайд №15Android development, слайд №16Android development, слайд №17Android development, слайд №18Android development, слайд №19Android development, слайд №20Android development, слайд №21Android development, слайд №22Android development, слайд №23Android development, слайд №24Android development, слайд №25Android development, слайд №26Android development, слайд №27Android development, слайд №28

Вы можете ознакомиться и скачать презентацию на тему Android development. Доклад-сообщение содержит 28 слайдов. Презентации для любого класса можно скачать бесплатно. Если материал и наш сайт презентаций Mypresentation Вам понравились – поделитесь им с друзьями с помощью социальных кнопок и добавьте в закладки в своем браузере.

Слайды и текст этой презентации


Слайд 1





Android development
Ihor Sokolyk
Описание слайда:
Android development Ihor Sokolyk

Слайд 2





Android history
Android is an open source and Linux-based Operating System for mobile devices such as smartphones and tablet computers. Android was developed by the Open Handset Alliance, led by Google, and other companies.
The first beta version of the Android Software Development Kit (SDK) was released by Google in 2007 where as the first commercial version, Android 1.0, was released in September 2008.
Описание слайда:
Android history Android is an open source and Linux-based Operating System for mobile devices such as smartphones and tablet computers. Android was developed by the Open Handset Alliance, led by Google, and other companies. The first beta version of the Android Software Development Kit (SDK) was released by Google in 2007 where as the first commercial version, Android 1.0, was released in September 2008.

Слайд 3


Android development, слайд №3
Описание слайда:

Слайд 4





Required TOOLS
Java JDK5 or later version
Java Runtime Environment (JRE) 6
Android SDK
Android Studio
Eclipse IDE for Java Developers
ADB Driver
Описание слайда:
Required TOOLS Java JDK5 or later version Java Runtime Environment (JRE) 6 Android SDK Android Studio Eclipse IDE for Java Developers ADB Driver

Слайд 5


Android development, слайд №5
Описание слайда:

Слайд 6





Project Folders 
src - This contains the .java source files for your project. By default, it includes a MainActivity.java source file having an activity class that runs when your app is launched using the app icon.
res/drawable - This is a directory for drawable objects that are designed for high-density screens.
res/layout - This is a directory for files that define your app's user interface.
res/values - This is a directory for other various XML files that contain a collection of resources, such as strings and colors definitions.
AndroidManifest.xml - This is the manifest file which describes the fundamental characteristics of the app and defines each of its components.
Описание слайда:
Project Folders src - This contains the .java source files for your project. By default, it includes a MainActivity.java source file having an activity class that runs when your app is launched using the app icon. res/drawable - This is a directory for drawable objects that are designed for high-density screens. res/layout - This is a directory for files that define your app's user interface. res/values - This is a directory for other various XML files that contain a collection of resources, such as strings and colors definitions. AndroidManifest.xml - This is the manifest file which describes the fundamental characteristics of the app and defines each of its components.

Слайд 7





Activities
An activity represents a single screen with a user interface, in-short Activity performs actions on the screen. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. If an application has more than one activity, then one of them should be marked as the activity that is presented when the application is launched.
public class MainActivity extends Activity { 
@Override 
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); 
 } 
}
Описание слайда:
Activities An activity represents a single screen with a user interface, in-short Activity performs actions on the screen. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. If an application has more than one activity, then one of them should be marked as the activity that is presented when the application is launched. public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }

Слайд 8


Android development, слайд №8
Описание слайда:

Слайд 9





Layout
<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>
Описание слайда:
Layout <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>

Слайд 10





Manifest
<manifest xmlns:android=http://schemas.android.com/apk/res/android
	package="com.example.helloworld" 
	android:versionCode="1" 
	android:versionName="1.0" > 
	<uses-sdk 
		android:minSdkVersion="8" 
		android:targetSdkVersion="22" /> 
	<uses-permission android:name="android.permission.CAMERA" />
	<uses-permission android:name="android.permission.INTERNET" />
	<application 
		android:icon="@drawable/ic_launcher" 
		android:label="@string/app_name" 
		android:theme="@style/AppTheme" > 
		<activity 
			android:name=".MainActivity“
			android:label="@string/title_activity_main" > 
			<intent-filter> 
				<action android:name="android.intent.action.MAIN" /> 
				<category android:name="android.intent.category.LAUNCHER"/> 				</intent-filter> 
		</activity> 
	</application> 
</manifest>
Описание слайда:
Manifest <manifest xmlns:android=http://schemas.android.com/apk/res/android package="com.example.helloworld" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="22" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity“ android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest>

Слайд 11





Building with gradle
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        applicationId "com.resentient.hwat"
        versionCode 2
        versionName "1.0.2"
    }
}

dependencies {
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.clarifai:clarifai-api-java:1.2.0'
}
Описание слайда:
Building with gradle apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.resentient.hwat" versionCode 2 versionName "1.0.2" } } dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.clarifai:clarifai-api-java:1.2.0' }

Слайд 12


Android development, слайд №12
Описание слайда:

Слайд 13





Passing data between activities
Ways to pass data between activities:
Save the data in a database
Save the data in a file
Use Shared preferences
Use Intent
Описание слайда:
Passing data between activities Ways to pass data between activities: Save the data in a database Save the data in a file Use Shared preferences Use Intent

Слайд 14





Shared PREFERENCES
Shared Preferences allow you to save and retrieve data in the form of key-value pair. Shared Preferences values will persist across user sessions. Data in shared preferences will be persistent even though user closes the application.
You can get values from Shared preferences using getSharedPreferences() method.
SharedPreferences sharedProperties = getSharedPreferences(“MyPreferences”, Context.MODE_PRIVATE);
if (sharedProperties.getBoolean(“LaunchedFirstly”, true)) {
SharedPreferences.Editor e = sharedProperties.edit();
e.putBoolean(“LaunchedFirstly”, false);
e.commit();
}
Описание слайда:
Shared PREFERENCES Shared Preferences allow you to save and retrieve data in the form of key-value pair. Shared Preferences values will persist across user sessions. Data in shared preferences will be persistent even though user closes the application. You can get values from Shared preferences using getSharedPreferences() method. SharedPreferences sharedProperties = getSharedPreferences(“MyPreferences”, Context.MODE_PRIVATE); if (sharedProperties.getBoolean(“LaunchedFirstly”, true)) { SharedPreferences.Editor e = sharedProperties.edit(); e.putBoolean(“LaunchedFirstly”, false); e.commit(); }

Слайд 15





Intent
An Intent in the Android operating system is a software mechanism that allows users to start some actions or just passing some info between two activities.
Example:
Intent i = new Intent(getApplicationContext(), MyActivity.class);
i.putExtra("name", “Ihor");
i.putExtra("surname", “Sokolyk";
startActivity(i);
 Intent intent = getIntent();
 String message = intent.getStringExtra(“name");
Описание слайда:
Intent An Intent in the Android operating system is a software mechanism that allows users to start some actions or just passing some info between two activities. Example: Intent i = new Intent(getApplicationContext(), MyActivity.class); i.putExtra("name", “Ihor"); i.putExtra("surname", “Sokolyk"; startActivity(i);  Intent intent = getIntent(); String message = intent.getStringExtra(“name");

Слайд 16





Starting camera example:
Starting camera example:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Uril file = Uri.fromFile(new File(pathToImage));
intent.putExtra(MediaStore.EXTRA_OUTPUT, file);
startActivityForResult(intent, 100);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == 100) {
        if (resultCode == RESULT_OK) {
            takenPhoto.setImageURI(file);
        }
    }
}
Описание слайда:
Starting camera example: Starting camera example: Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Uril file = Uri.fromFile(new File(pathToImage)); intent.putExtra(MediaStore.EXTRA_OUTPUT, file); startActivityForResult(intent, 100); @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == 100) { if (resultCode == RESULT_OK) { takenPhoto.setImageURI(file); } } }

Слайд 17





Sharing in facebook example:
Sharing in facebook example:
public void shareOnFacebook(View view) {
    Uri uri = Uri.fromFile(takeScreenshot());

    Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
    sharingIntent.setType("image/*");
    sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
    setDefaultPackageForIntent(sharingIntent, "com.facebook");

    if (sharingIntent.getPackage() != null) {
        startActivity(sharingIntent);
    } else {
        Toast.makeText(getApplicationContext(), “Facebook not installed”, 	Toast.LENGTH_SHORT).show();
    }
}
Описание слайда:
Sharing in facebook example: Sharing in facebook example: public void shareOnFacebook(View view) { Uri uri = Uri.fromFile(takeScreenshot()); Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); sharingIntent.setType("image/*"); sharingIntent.putExtra(Intent.EXTRA_STREAM, uri); setDefaultPackageForIntent(sharingIntent, "com.facebook"); if (sharingIntent.getPackage() != null) { startActivity(sharingIntent); } else { Toast.makeText(getApplicationContext(), “Facebook not installed”, Toast.LENGTH_SHORT).show(); } }

Слайд 18





Get View Elements From Activity
ImageView takenPhoto = (ImageView) findViewById(R.id.imageView);
takenPhoto.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.correct));
takenPhoto.setVisibility(View.INVISIBLE);
Описание слайда:
Get View Elements From Activity ImageView takenPhoto = (ImageView) findViewById(R.id.imageView); takenPhoto.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.correct)); takenPhoto.setVisibility(View.INVISIBLE);

Слайд 19





Adding listeners to elements
final Button button = (Button) findViewById(R.id.button_id);
button.setOnClickListener(new View.OnClickListener() {
     @Override
      public void onClick(View v) {
           // Perform action on click
      }
 });
Описание слайда:
Adding listeners to elements final Button button = (Button) findViewById(R.id.button_id); button.setOnClickListener(new View.OnClickListener() { @Override      public void onClick(View v) {            // Perform action on click      }  });

Слайд 20





On touch and swipe events
@Override
public boolean onTouchEvent(MotionEvent event) { 
    int action = event.getActionMasked();
    switch (action) {
        case MotionEvent.ACTION_DOWN:
            initialX = event.getX();
            initialY = event.getY();
            Log.d(TAG, "Action was DOWN");
            break;
        case MotionEvent.ACTION_MOVE:
            Log.d(TAG, "Action was MOVE");
            break;
Описание слайда:
On touch and swipe events @Override public boolean onTouchEvent(MotionEvent event) {      int action = event.getActionMasked();     switch (action) {         case MotionEvent.ACTION_DOWN:             initialX = event.getX();             initialY = event.getY();             Log.d(TAG, "Action was DOWN");             break;         case MotionEvent.ACTION_MOVE:             Log.d(TAG, "Action was MOVE");             break;

Слайд 21





case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_UP:
            float finalX = event.getX();
            float finalY = event.getY();
            Log.d(TAG, "Action was UP");
            if (initialX < finalX) {
                Log.d(TAG, "Left to Right swipe performed");
            }
            if (initialX > finalX) {
                Log.d(TAG, "Right to Left swipe performed");
            }
            if (initialY < finalY) {
                Log.d(TAG, "Up to Down swipe performed");
            }
            if (initialY > finalY) {
                Log.d(TAG, "Down to Up swipe performed");
            }
            break;
   }
   return super.onTouchEvent(event);
}
Описание слайда:
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:             float finalX = event.getX();             float finalY = event.getY();             Log.d(TAG, "Action was UP");             if (initialX < finalX) {                 Log.d(TAG, "Left to Right swipe performed");             }             if (initialX > finalX) {                 Log.d(TAG, "Right to Left swipe performed");             }             if (initialY < finalY) {                 Log.d(TAG, "Up to Down swipe performed");             }             if (initialY > finalY) {                 Log.d(TAG, "Down to Up swipe performed");             }             break; } return super.onTouchEvent(event); }

Слайд 22





Dialog windows
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.share_dialog);
dialog.setCanceledOnTouchOutside(true);
dialog.show();
Описание слайда:
Dialog windows final Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.share_dialog); dialog.setCanceledOnTouchOutside(true); dialog.show();

Слайд 23





Check Internet connection

ConnectivityManager connectivity = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
    if (connectivity != null) {
        NetworkInfo info = connectivity.getActiveNetworkInfo();
        if (info != null)
            if (info.getState() == NetworkInfo.State.CONNECTED) {
 	Toast.makeText(getApplicationContext(), “Connected”, 	Toast.LENGTH_SHORT).show();
            }
    }
Описание слайда:
Check Internet connection ConnectivityManager connectivity = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); if (connectivity != null) { NetworkInfo info = connectivity.getActiveNetworkInfo(); if (info != null) if (info.getState() == NetworkInfo.State.CONNECTED) { Toast.makeText(getApplicationContext(), “Connected”, Toast.LENGTH_SHORT).show(); } }

Слайд 24





Async task
class DataLoader extends AsyncTask<Void, Void, Void> {

    @Override
    protected Void doInBackground(Void... params) {
        insertLevelsDataIntoDatabase();
        return null;
    }

    @Override
    protected void onPostExecute(Void aVoid) {
        new android.os.Handler().postDelayed(
                new Runnable() {
                    public void run() {
                        Intent intent = new Intent(getApplicationContext(), WelcomeActivity.class);
                        startActivity(intent);
                        finish();
                    }
                }, 2000);
        super.onPostExecute(aVoid);
    }
}
DataLoader dataLoader = new DataLoader();
dataLoader.execute();
Описание слайда:
Async task class DataLoader extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... params) { insertLevelsDataIntoDatabase(); return null; } @Override protected void onPostExecute(Void aVoid) { new android.os.Handler().postDelayed( new Runnable() { public void run() { Intent intent = new Intent(getApplicationContext(), WelcomeActivity.class); startActivity(intent); finish(); } }, 2000); super.onPostExecute(aVoid); } } DataLoader dataLoader = new DataLoader(); dataLoader.execute();

Слайд 25





Sqlite
Creating database:
public class DatabaseCreator extends SQLiteOpenHelper {

    public DatabaseCreator(Context context) {
        super(context, “MyDatabase”, null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE IF NOT EXISTS levels ("
        + "id integer primary key autoincrement,"
        + "levelId integer NOT NULL,"
        + "question text NOT NULL,"
        + "answer text NOT NULL,"
        + "type text NOT NULL,"
        + "image BLOB default NULL,"
        + "isLevelCompleted integer);");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }

}
Описание слайда:
Sqlite Creating database: public class DatabaseCreator extends SQLiteOpenHelper { public DatabaseCreator(Context context) { super(context, “MyDatabase”, null, 1); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE TABLE IF NOT EXISTS levels (" + "id integer primary key autoincrement," + "levelId integer NOT NULL," + "question text NOT NULL," + "answer text NOT NULL," + "type text NOT NULL," + "image BLOB default NULL," + "isLevelCompleted integer);"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } }

Слайд 26





Inserting data into database:
Inserting data into database:
DatabaseCreator dbHelper = new DatabaseCreator(context);
SQLiteDatabase db = dbHelper.getWritableDatabase();
ContentValues cv = new ContentValues();
cv.put(“levelId”, 1);
cv.put(“question”,”Catch smile”);
cv.put(“answer”, “smile”);
cv.put(“type”, “emotion”);
if (db.update(“levels”, cv, “levelId = " + 1, null) == 0) {
    db.insert(“levels”, null, cv);
}
cv.clear();
Описание слайда:
Inserting data into database: Inserting data into database: DatabaseCreator dbHelper = new DatabaseCreator(context); SQLiteDatabase db = dbHelper.getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put(“levelId”, 1); cv.put(“question”,”Catch smile”); cv.put(“answer”, “smile”); cv.put(“type”, “emotion”); if (db.update(“levels”, cv, “levelId = " + 1, null) == 0) { db.insert(“levels”, null, cv); } cv.clear();

Слайд 27





Fetching data from database:
Fetching data from database:
DatabaseCreator dbHelper = new DatabaseCreator(context);
SQLiteDatabase db = dbHelper.getWritableDatabase();
Cursor cursor = db.rawQuery("SELECT * FROM levels WHERE levelId = 1", null);
if (cursor.moveToFirst()) {
    do {
        levelQuestion = cursor.getString(cursor.getColumnIndex(“question”));
        levelAnswer = cursor.getString(cursor.getColumnIndex(“answer”));
        levelType = cursor.getString(cursor.getColumnIndex(“type”));
        correctImage = cursor.getBlob(cursor.getColumnIndex(“image”));
    } while (cursor.moveToNext());
}
cursor.close();
Описание слайда:
Fetching data from database: Fetching data from database: DatabaseCreator dbHelper = new DatabaseCreator(context); SQLiteDatabase db = dbHelper.getWritableDatabase(); Cursor cursor = db.rawQuery("SELECT * FROM levels WHERE levelId = 1", null); if (cursor.moveToFirst()) { do { levelQuestion = cursor.getString(cursor.getColumnIndex(“question”)); levelAnswer = cursor.getString(cursor.getColumnIndex(“answer”)); levelType = cursor.getString(cursor.getColumnIndex(“type”)); correctImage = cursor.getBlob(cursor.getColumnIndex(“image”)); } while (cursor.moveToNext()); } cursor.close();

Слайд 28


Android development, слайд №28
Описание слайда:



Теги Android development
Похожие презентации
Mypresentation.ru
Загрузить презентацию